Skip to content

Error on linux when importing an API with no changes. #555

@jschutte27

Description

@jschutte27

APIM-CLI version

1.14.11

API-Management version

7.7.0.20240830

Bug description

When running apim.sh to import an api in linux that does not have changes the response code is and error (1) which is failing our deploy job. This works fine on windows.

Steps to reproduce

Import an API twice in a row on linux.

Relevant log output

Windows output:
Run C:\actions-runner\_work\it-axway-automation\it-axway-automation\./\src\deploy.ps1  -ConfigPath "C:\actions-runner\_work\it-axway-automation\it-axway-automation/testfiles/test-api-config.json"  -ApimPath "apim.bat"  -ApiDefinitionPath "https://petstore.swagger.io/v2/swagger.json"  -AxwayHost devwebapi.domain.com  -AxwayUser devbuildservice  -AxwayPassword '***'  -OverrideBasePath 0
Run /opt/actions-runner/_work/it-axway-automation/it-axway-automation/./\src\deploy.ps1  -ConfigPath "/opt/actions-runner/_work/it-axway-automation/it-axway-automation/testfiles/test-api-config.json"  -ApimPath "apim.sh"  -ApiDefinitionPath "https://petstore.swagger.io/v2/swagger.json"  -AxwayHost devwebapi.domain.com  -AxwayUser devbuildservice  -AxwayPassword '***'  -OverrideBasePath 0
2025-06-12 10:56:37,824 [APIManagerCLI] INFO : API-Manager CLI: 1.14.11
2025-06-12 10:56:37,839 [APIManagerCLI] INFO : Module: API - I M P O R T  (1.14.11)
2025-06-12 10:56:37,839 [CoreParameters] INFO : Retrying unexpected API-Manager REST-API responses with a delay of 3000 milliseconds.
2025-06-12 10:56:38,860 [APIManagerOrganizationAdapter] WARN : Using OrgAdmin only to load all organizations.
2025-06-12 10:56:38,969 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20240830) on: https://devwebapi.domain.com:8075
2025-06-12 10:56:39,313 [APISpecificationFactory] INFO : Detected: Swagger 2.0 specification. 
2025-06-12 10:56:39,657 [APIImportApp] INFO : Lookup actual API based on Path: /sample/api/v1  
2025-06-12 10:56:39,922 [APIManagerAPIAdapter] INFO : Loading application quotas for 1 subscribed applications.
2025-06-12 10:56:40,094 [APIImportApp] INFO : You may enable debug to get more details. See: https://github.com/Axway-API-Management-Plus/apim-cli/wiki/9.1.-Enable-Debug
2025-06-12 10:56:40,094 [APIImportApp] WARN : No changes detected between Import- and API-Manager-API: 'Test Deploy Petstore API' (d28a1215-95ec-4348-a825-9bcc038badc6)
"No changes detected. Existing with RC: 0"



Linux output:

Run /opt/actions-runner/_work/it-axway-automation/it-axway-automation/./\src\deploy.ps1  -ConfigPath "/opt/actions-runner/_work/it-axway-automation/it-axway-automation/testfiles/test-api-config.json"  -ApimPath "apim.sh"  -ApiDefinitionPath "https://petstore.swagger.io/v2/swagger.json"  -AxwayHost devwebapi.domain.com  -AxwayUser devbuildservice  -AxwayPassword '***'  -OverrideBasePath 0
2025-06-12 15:55:51,927 [APIManagerCLI] INFO : API-Manager CLI: 1.14.11
2025-06-12 15:55:51,928 [APIManagerCLI] INFO : Module: API - I M P O R T  (1.14.11)
2025-06-12 15:55:51,935 [CoreParameters] INFO : Retrying unexpected API-Manager REST-API responses with a delay of 3000 milliseconds.
2025-06-12 15:55:52,494 [APIManagerOrganizationAdapter] WARN : Using OrgAdmin only to load all organizations.
2025-06-12 15:55:52,585 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20240830) on: https://devwebapi.domain.com:8075
2025-06-12 15:55:52,862 [APISpecificationFactory] INFO : Detected: Swagger 2.0 specification. 
2025-06-12 15:55:53,060 [APIImportApp] INFO : Lookup actual API based on Path: /sample/api/v1  
2025-06-12 15:55:53,278 [APIManagerAPIAdapter] INFO : Loading application quotas for 1 subscribed applications.
2025-06-12 15:55:53,402 [APIImportApp] INFO : You may enable debug to get more details. See: https://github.com/Axway-API-Management-Plus/apim-cli/wiki/9.1.-Enable-Debug
2025-06-12 15:55:53,403 [APIImportApp] WARN : No changes detected between Import- and API-Manager-API: 'Test Deploy Petstore API' (d28a1215-95ec-4348-a825-9bcc038badc6)

Error: Process completed with exit code 1.



deploy.ps1 contains:
$ArgumentList = @("api","import","-c", $outputFilePath, "-a", $ApiDefinitionPath, "-h", $AxwayHost, "-u",  $AxwayUser, "-p", $AxwayPassword, "-force", "-retryDelay", "3000") # "-forceUpdate",

if ($OverrideBasePath)
{
  $ArgumentList += "-overrideSpecBasePath"
}

& $ApimPath $ArgumentList 
exit $LASTEXITCODE

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions