Axway-API-Management-Plus / apim-cli

Axway API-Management CLI - Manage your platform from the command line or with your CI/CD pipeline
Apache License 2.0
43 stars 17 forks source link

failed to virtualize API again with a image #263

Closed sbui-axway closed 2 years ago

sbui-axway commented 2 years ago

API-Mgr. CLI version 1.10.1

API-Manager and Service-Pack Version

Expected behavior update api in api manager with a image

Actual behavior the import failed with an error 403 Cannot update API-Proxy. If we remove the image reference from the api-config.json, we can import again the API.

Log-Output in Debug Module: API - I M P O R T (1.10.1)

3422 INFO APIManagerAdapter| Successfully connected to API-Manager (7.7.20211130) on: https://api-env:19617/ 3838 INFO IImportConfigAdapter| Loaded stage API-Config from file: /home/axway/.jenkins/jobs/demo-accelerate-platform/branches/design/workspace/api-config.mck.json 3844 INFO SpecificationFactory| Reading API-Definition (Swagger/WSDL) from file: 'backend/endpoints/gtfs-2.yaml' (relative path) 3978 INFO SpecificationFactory| Detected: Open API 3.0 (YAML) specification. 4173 INFO IImportConfigAdapter| Loading image from: '/home/axway/.jenkins/jobs/demo-accelerate-platform/branches/design/workspace/assets/images/Transilien_(RATP).png' 4268 INFO APIImportApp| Lookup actual API based on Path: /demo/gtfs/api/v1 5382 INFO APIManagerAPIAdapter| Found existing API: 'GTFS' (published) on path: '/demo/gtfs/api/v1' (ID: '73c6f958-90ae-463e-9523-15fb070884e5') 5855 INFO APIImportManager| Recognized the following changes. Potentially Breaking: [] plus Non-Breaking: [image] 5856 INFO APIImportManager| Update API Strategy: All changes can be applied in current state. 5856 INFO UpdateExistingAPI| Update existing published API: 'GTFS' 1.0.0 (ID: 73c6f958-90ae-463e-9523-15fb070884e5) 5857 INFO APIChangeState| Updating Frontend-API (Proxy) for the following properties: image 5925 ERROR APIManagerAPIAdapter| Error updating API-Proxy. Response-Code: 403. Got response: '{"errors":[{"code":403,"message":"Cannot modify a published API"}]}' 5927 INFO AppException| You may enable debug to get more details. See: https://github.com/Axway-API-Management-Plus/apim-cli/wiki/9.1.-Enable-Debug 5928 ERROR AppException| Cannot update API-Proxy. | Error updating API-Proxy. Response-Code: 403

Test case sample

Please describe the steps you have done to replicate the issue home/axway/demo/apim-cli-1.10.1/scripts/apim.sh api import -force -s mck -c api-config.json -a backend/endpoints/gtfs-2.yaml Put an image reference in api-config, import the api to API manager. try to import again to api manager.

cwiechmann commented 2 years ago

Hi @sbui-axway, I saw this problem the other day, but not with the API-Image, but instead with the API-Description. Both properties can be modified for a published API.

I solved this problem by restarting the API-Manager. Can you please try the same and let me know?