Skip to content

Update of the backendBasepath not possible when a "per-method override" is present #581

@matthias-franke

Description

@matthias-franke

APIM-CLI version

1.14.2

API-Management version

7.7-20250830

Bug description

Exception if updating backendBasepath for APIs with per "per-method-override" (inboundProfile):

com.axway.apim.lib.error.AppException: No operation found with name: '23508dcd-7245-4811-bb34-bff265525a83'
	at com.axway.apim.adapter.apis.APIManagerAPIMethodAdapter.getMethodForName(APIManagerAPIMethodAdapter.java:81)
	at com.axway.apim.adapter.apis.APIManagerAPIAdapter.translateMethodIds(APIManagerAPIAdapter.java:377)
	at com.axway.apim.adapter.apis.APIManagerAPIAdapter.translateMethodIds(APIManagerAPIAdapter.java:278)
	at com.axway.apim.adapter.apis.APIManagerAPIAdapter.translateMethodIds(APIManagerAPIAdapter.java:256)
	at com.axway.apim.adapter.apis.APIManagerAPIAdapter.updateAPIProxy(APIManagerAPIAdapter.java:595)
	at com.axway.apim.apiimport.actions.UpdateExistingAPI.execute(UpdateExistingAPI.java:64)
	at com.axway.apim.apiimport.APIImportManager.applyChanges(APIImportManager.java:68)
	at com.axway.apim.APIImportApp.importAPI(APIImportApp.java:130)
	at com.axway.apim.APIImportApp.importAPI(APIImportApp.java:57)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.axway.apim.cli.APIManagerCLI.run(APIManagerCLI.java:133)
	at com.axway.apim.cli.APIManagerCLI.main(APIManagerCLI.java:72)
2026-06-16 17:52:09,305 [APIImportApp] ERROR: Error updating existing API
com.axway.apim.lib.error.AppException: Error updating existing API
	at com.axway.apim.apiimport.actions.UpdateExistingAPI.execute(UpdateExistingAPI.java:91)
	at com.axway.apim.apiimport.APIImportManager.applyChanges(APIImportManager.java:68)
	at com.axway.apim.APIImportApp.importAPI(APIImportApp.java:130)
	at com.axway.apim.APIImportApp.importAPI(APIImportApp.java:57)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.axway.apim.cli.APIManagerCLI.run(APIManagerCLI.java:133)
	at com.axway.apim.cli.APIManagerCLI.main(APIManagerCLI.java:72)

Steps to reproduce

1. create an api with "per-method-override"

api.json:

{
 "summary": "n.a.",
 "inboundProfiles": {
  "_default": {
   "queryStringPassThrough": false,
   "monitorAPI": true,
   "securityProfile": "_default",
   "corsProfile": "_default",
   "monitorSubject": "authentication.subject.id"
  },
  "dummyOpOne": {
   "queryStringPassThrough": false,
   "monitorAPI": true,
   "securityProfile": "profile-dummyOpOne",
   "monitorSubject": "authentication.subject.id"
  }
 },
 "backendBasepath": "https://new-devstage.backendUrl.com",
 "grantAccessFrom": [],
 "apiSpecification": {"resource": "oas.json"},
 "version": "5.4.3",
 "securityProfiles": [
  {
   "isDefault": true,
   "devices": [{
    "name": "OAuth (External)",
    "type": "oauthExternal",
    "properties": {
     "scopesMustMatch": "Any",
     "subjectSelector": "${oauth.token.client_id}",
     "removeCredentialsOnSuccess": "false",
     "useClientRegistry": "true",
     "authorizationHeaderPrefix": "Bearer",
     "authCodeGrantTypeRequestSecretName": "client_secret",
     "authCodeGrantTypeEnabled": "true",
     "authCodeGrantTypeTokenEndpointTokenName": "access_code",
     "tokenStore": "AuthorizationCode",
     "clientCredentialsGrantTypeTokenName": "access_token",
     "oauth.token.valid": "${oauth.token.valid}",
     "authCodeGrantTypeRequestClientIdName": "client_id",
     "implicitGrantLoginTokenName": "access_token",
     "authCodeGrantTypeRequestEndpointUrl": "https://localhost:8089/api/oauth/authorize",
     "authCodeGrantTypeTokenEndpointUrl": "https://localhost:8089/api/oauth/token",
     "oauth.token.scopes": "${oauth.token.scopes}",
     "clientCredentialsGrantTypeTokenEndpointUrl": "https://localhost:8089/api/oauth/token",
     "accessTokenLocationQueryString": "",
     "implicitGrantLoginEndpointUrl": "https://localhost:8089/api/oauth/authorize",
     "accessTokenLocation": "HEADER",
     "scopes": "DUMMY_SCOPE",
     "clientCredentialsGrantTypeEnabled": "false",
     "oauth.token.client_id": "${oauth.token.client_id}",
     "implicitGrantEnabled": "true"
    },
    "order": 1
   }],
   "name": "_default"
  },
  {
   "isDefault": false,
   "devices": [{
    "name": "device-dummyOpOne",
    "type": "oauthExternal",
    "properties": {
     "scopesMustMatch": "Any",
     "subjectSelector": "${oauth.token.client_id}",
     "removeCredentialsOnSuccess": "false",
     "useClientRegistry": "true",
     "authorizationHeaderPrefix": "Bearer",
     "authCodeGrantTypeRequestSecretName": "client_secret",
     "authCodeGrantTypeEnabled": "true",
     "authCodeGrantTypeTokenEndpointTokenName": "access_code",
     "tokenStore": "AuthorizationCode",
     "clientCredentialsGrantTypeTokenName": "access_token",
     "oauth.token.valid": "${oauth.token.valid}",
     "authCodeGrantTypeRequestClientIdName": "client_id",
     "implicitGrantLoginTokenName": "access_token",
     "authCodeGrantTypeRequestEndpointUrl": "https://localhost:8089/api/oauth/authorize",
     "authCodeGrantTypeTokenEndpointUrl": "https://localhost:8089/api/oauth/token",
     "oauth.token.scopes": "${oauth.token.scopes}",
     "clientCredentialsGrantTypeTokenEndpointUrl": "https://localhost:8089/api/oauth/token",
     "accessTokenLocationQueryString": "",
     "implicitGrantLoginEndpointUrl": "https://localhost:8089/api/oauth/authorize",
     "accessTokenLocation": "HEADER",
     "scopes": "DUMMY_SCOPE",
     "clientCredentialsGrantTypeEnabled": "false",
     "oauth.token.client_id": "${oauth.token.client_id}",
     "implicitGrantEnabled": "true"
    },
    "order": 1
   }],
   "name": "profile-dummyOpOne"
  }
 ],
 "tags": {
  "MaxConnections": ["60"],
  "Subdomain": ["Subdomain Staging Testing"]
 },
 "path": "/test-api/patcht10stagebackendurl/v5",
 "customProperties": {
  "api_category_severity": "MEDIUM",
  "errorPassthrough": "111,112"
 },
 "apiMethods": [{
  "descriptionType": "original",
  "name": "dummyOpOne",
  "tags": {
   "callbackHeaders": ["Dummy-Callback-URL"]
  }
 }],
 "organization": "Developer",
 "name": "patchT10.stage.backendUrl",
 "outboundProfiles": {"_default": {
  "authenticationProfile": "_default",
  "responsePolicy": "Global Response Policy",
  "routePolicy": "Backend Routing Policy",
  "routeType": "policy",
  "requestPolicy": "Global Request Policy"
 }},
 "state": "published",
 "caCerts": []
}

oas.json:

{
  "openapi": "3.0.1",
  "info": {
    "title": "patchT10.stage.backendUrl",
    "description": "patchT10.stage.backendUrl",
    "version": "5.4.3"
  },
  "servers": [
    {
      "url": "https://localhost"
    }
  ],
  "security": [
    {
      "OAuth-Internal": [
        "read"
      ]
    }
  ],
  "paths": {
    "/dummyOpOne": {
      "get": {
        "summary": "Just to have a dummy operation in the swagger.",
        "description": "Would return something if there was a backend.",
        "operationId": "dummyOpOne",
        "responses": {
          "200": {
            "description": "no backend, no response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dummyDTO"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/dummyDTO"
                }
              }
            }
          }
        }
      }
    },
    "/dummyOpTwo": {
      "get": {
        "summary": "Just to have a dummy operation in the swagger.",
        "description": "Would return something if there was a backend.",
        "operationId": "dummyOpTwo",
        "responses": {
          "200": {
            "description": "no backend, no response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dummyDTO"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/dummyDTO"
                }
              }
            }
          }
        }
      }
    },
    "/dummyInfo": {
      "get": {
        "summary": "Just to have a dummy operation in the swagger.",
        "description": "Would return something if there was a backend.",
        "operationId": "retrieveApplicationInfo",
        "responses": {
          "200": {
            "description": "no backend, no response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/dummyDTO"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/dummyDTO"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "dummyDTO": {
        "type": "object",
        "description": "Mocked Display",
        "properties": {
          "dummyOne": {
            "type": "string",
            "description": "dummy #1"
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth-Internal": {
        "type": "oauth2",
        "flows": {
          "password": {
            "tokenUrl": "https://password.tokenUrl.oas3.dev",
            "refreshUrl": "https://password.refreshUrl.oas3.dev",
            "scopes": {}
          },
          "clientCredentials": {
            "tokenUrl": "https://clientCredentials.tokenUrl.oas3.dev",
            "refreshUrl": "https://clientCredentials.refreshUrl.oas3.dev",
            "scopes": {}
          },
          "authorizationCode": {
            "authorizationUrl": "https://authorizationCode.authorizationUrl.oas3.dev",
            "tokenUrl": "https://authorizationCode.tokenUrl.oas3.dev",
            "refreshUrl": "https://authorizationCode.refreshUrl.oas3.dev",
            "scopes": {}
          }
        }
      }
    }
  }
}

2. update the backendBasepath

api.json:

{
 "summary": "n.a.",
 "inboundProfiles": {
  "_default": {
   "queryStringPassThrough": false,
   "monitorAPI": true,
   "securityProfile": "_default",
   "corsProfile": "_default",
   "monitorSubject": "authentication.subject.id"
  },
  "dummyOpOne": {
   "queryStringPassThrough": false,
   "monitorAPI": true,
   "securityProfile": "profile-dummyOpOne",
   "monitorSubject": "authentication.subject.id"
  }
 },
 "backendBasepath": "https://new-devstage.backendUrlNEW.com",
 "grantAccessFrom": [],
 "apiSpecification": {"resource": "oas.json"},
 "version": "5.4.3",
 "securityProfiles": [
  {
   "isDefault": true,
   "devices": [{
    "name": "OAuth (External)",
    "type": "oauthExternal",
    "properties": {
     "scopesMustMatch": "Any",
     "subjectSelector": "${oauth.token.client_id}",
     "removeCredentialsOnSuccess": "false",
     "useClientRegistry": "true",
     "authorizationHeaderPrefix": "Bearer",
     "authCodeGrantTypeRequestSecretName": "client_secret",
     "authCodeGrantTypeEnabled": "true",
     "authCodeGrantTypeTokenEndpointTokenName": "access_code",
     "tokenStore": "AuthorizationCode",
     "clientCredentialsGrantTypeTokenName": "access_token",
     "oauth.token.valid": "${oauth.token.valid}",
     "authCodeGrantTypeRequestClientIdName": "client_id",
     "implicitGrantLoginTokenName": "access_token",
     "authCodeGrantTypeRequestEndpointUrl": "https://localhost:8089/api/oauth/authorize",
     "authCodeGrantTypeTokenEndpointUrl": "https://localhost:8089/api/oauth/token",
     "oauth.token.scopes": "${oauth.token.scopes}",
     "clientCredentialsGrantTypeTokenEndpointUrl": "https://localhost:8089/api/oauth/token",
     "accessTokenLocationQueryString": "",
     "implicitGrantLoginEndpointUrl": "https://localhost:8089/api/oauth/authorize",
     "accessTokenLocation": "HEADER",
     "scopes": "DUMMY_SCOPE",
     "clientCredentialsGrantTypeEnabled": "false",
     "oauth.token.client_id": "${oauth.token.client_id}",
     "implicitGrantEnabled": "true"
    },
    "order": 1
   }],
   "name": "_default"
  },
  {
   "isDefault": false,
   "devices": [{
    "name": "device-dummyOpOne",
    "type": "oauthExternal",
    "properties": {
     "scopesMustMatch": "Any",
     "subjectSelector": "${oauth.token.client_id}",
     "removeCredentialsOnSuccess": "false",
     "useClientRegistry": "true",
     "authorizationHeaderPrefix": "Bearer",
     "authCodeGrantTypeRequestSecretName": "client_secret",
     "authCodeGrantTypeEnabled": "true",
     "authCodeGrantTypeTokenEndpointTokenName": "access_code",
     "tokenStore": "AuthorizationCode",
     "clientCredentialsGrantTypeTokenName": "access_token",
     "oauth.token.valid": "${oauth.token.valid}",
     "authCodeGrantTypeRequestClientIdName": "client_id",
     "implicitGrantLoginTokenName": "access_token",
     "authCodeGrantTypeRequestEndpointUrl": "https://localhost:8089/api/oauth/authorize",
     "authCodeGrantTypeTokenEndpointUrl": "https://localhost:8089/api/oauth/token",
     "oauth.token.scopes": "${oauth.token.scopes}",
     "clientCredentialsGrantTypeTokenEndpointUrl": "https://localhost:8089/api/oauth/token",
     "accessTokenLocationQueryString": "",
     "implicitGrantLoginEndpointUrl": "https://localhost:8089/api/oauth/authorize",
     "accessTokenLocation": "HEADER",
     "scopes": "DUMMY_SCOPE",
     "clientCredentialsGrantTypeEnabled": "false",
     "oauth.token.client_id": "${oauth.token.client_id}",
     "implicitGrantEnabled": "true"
    },
    "order": 1
   }],
   "name": "profile-dummyOpOne"
  }
 ],
 "tags": {
  "MaxConnections": ["60"],
  "Subdomain": ["Subdomain Staging Testing"]
 },
 "path": "/test-api/patcht10stagebackendurl/v5",
 "customProperties": {
  "api_category_severity": "MEDIUM",
  "errorPassthrough": "111,112"
 },
 "apiMethods": [{
  "descriptionType": "original",
  "name": "dummyOpOne",
  "tags": {
   "callbackHeaders": ["Dummy-Callback-URL"]
  }
 }],
 "organization": "Developer",
 "name": "patchT10.stage.backendUrl",
 "outboundProfiles": {"_default": {
  "authenticationProfile": "_default",
  "responsePolicy": "Global Response Policy",
  "routePolicy": "Backend Routing Policy",
  "routeType": "policy",
  "requestPolicy": "Global Request Policy"
 }},
 "state": "published",
 "caCerts": []
}

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions