-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error reading application permissions. Error: Cannot coerce empty String ("") to com.axway.apim.api.model.apps.ApplicationPermission$SharePermission value #489
Comments
com.axway.apim.api.model.apps.ApplicationPermission$SharePermission
value
Hi Saper, ./apim.sh app get -id 3cc168d8-c5c6-4e94-ac23-85de01ee508d -o json -h 10.129.144.250 -u apiadmin -p xxxxxx
2024-10-07 12:52:22,613 [APIManagerCLI] INFO : API-Manager CLI: 1.14.6-SNAPSHOT
2024-10-07 12:52:22,614 [APIManagerCLI] DEBUG: Java Version: 17.0.9
2024-10-07 12:52:22,614 [APIManagerCLI] INFO : Module: Application - E X P O R T / U T I L S (1.14.6-SNAPSHOT)
2024-10-07 12:52:22,618 [EnvironmentProperties] DEBUG: Trying to load environment properties from file: env.properties ... not found.
2024-10-07 12:52:23,118 [APIMHttpClient] DEBUG: API Manager CLI http client timeout : 30000
2024-10-07 12:52:23,142 [RestAPICall] DEBUG: Http verb:POST and URI: https://10.129.144.250:8075/api/portal/v1.4/login
2024-10-07 12:52:23,678 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/currentuser
2024-10-07 12:52:23,796 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/config
2024-10-07 12:52:24,030 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20240530) on: https://10.129.144.250:8075
2024-10-07 12:52:24,031 [APIManagerCustomPropertiesAdapter] DEBUG: Read configured custom properties from API-Manager
2024-10-07 12:52:24,031 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/config/customproperties
2024-10-07 12:52:24,179 [APIMgrAppsAdapter] DEBUG: Sending request to find existing applications: https://10.129.144.250:8075/api/portal/v1.4/applications/3cc168d8-c5c6-4e94-ac23-85de01ee508d
2024-10-07 12:52:24,180 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/applications/3cc168d8-c5c6-4e94-ac23-85de01ee508d
2024-10-07 12:52:24,403 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=b790c5e6-0194-47dc-9684-e619c1247f62]
2024-10-07 12:52:24,404 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://10.129.144.250:8075/api/portal/v1.4/organizations/b790c5e6-0194-47dc-9684-e619c1247f62
2024-10-07 12:52:24,404 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/organizations/b790c5e6-0194-47dc-9684-e619c1247f62
2024-10-07 12:52:24,596 [APIManagerOrganizationAdapter] DEBUG: Organization id to be cached : /b790c5e6-0194-47dc-9684-e619c1247f62
2024-10-07 12:52:24,602 [APIMgrAppsAdapter] DEBUG: Found: 1 applications
2024-10-07 12:52:24,603 [APIManagerQuotaAdapter] DEBUG: Found quota with ID: 3cc168d8-c5c6-4e94-ac23-85de01ee508d in cache: {"id":"00000000-0000-0000-0000-000000000001","type":"APPLICATION","name":"Application Default","description":"Maximum message rates per application. Applied to each application unless an Application-Specific quota is configured","restrictions":[{"api":"5ff83c1a-d7cb-4f89-a596-feda70e0b77f","method":"*","type":"throttlemb","config":{"period":"day","per":"1","mb":"1000"}}],"system":true}
2024-10-07 12:52:24,608 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/proxies/5ff83c1a-d7cb-4f89-a596-feda70e0b77f
2024-10-07 12:52:24,753 [APIManagerOrganizationAdapter] DEBUG: Load organizations from API-Manager using filter: OrgFilter [name=null, id=a0a1d33d-8063-4b67-b872-0aeaeb4b5271]
2024-10-07 12:52:24,753 [APIManagerOrganizationAdapter] DEBUG: Load organization with URI: https://10.129.144.250:8075/api/portal/v1.4/organizations/a0a1d33d-8063-4b67-b872-0aeaeb4b5271
2024-10-07 12:52:24,753 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/organizations/a0a1d33d-8063-4b67-b872-0aeaeb4b5271
2024-10-07 12:52:25,005 [APIManagerOrganizationAdapter] DEBUG: Organization id to be cached : /a0a1d33d-8063-4b67-b872-0aeaeb4b5271
2024-10-07 12:52:25,007 [APIManagerAPIAdapter] DEBUG: Found: 1 exposed API(s):
2024-10-07 12:52:25,008 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/applications/3cc168d8-c5c6-4e94-ac23-85de01ee508d/extclients
2024-10-07 12:52:25,206 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/applications/3cc168d8-c5c6-4e94-ac23-85de01ee508d/oauth
2024-10-07 12:52:25,465 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/applications/3cc168d8-c5c6-4e94-ac23-85de01ee508d/apikeys
2024-10-07 12:52:25,576 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/applications/3cc168d8-c5c6-4e94-ac23-85de01ee508d/oauthresource
2024-10-07 12:52:25,691 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/applications/3cc168d8-c5c6-4e94-ac23-85de01ee508d/permissions
2024-10-07 12:52:25,961 [APIManagerAPIAccessAdapter] DEBUG: Load API-Access with type: applications from API-Manager with ID: 3cc168d8-c5c6-4e94-ac23-85de01ee508d
2024-10-07 12:52:25,962 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/applications/3cc168d8-c5c6-4e94-ac23-85de01ee508d/apis
2024-10-07 12:52:26,213 [RestAPICall] DEBUG: Http verb:GET and URI: https://10.129.144.250:8075/api/portal/v1.4/proxies/c6926ba9-ca50-4d34-877f-0b42d2c2bb78
2024-10-07 12:52:26,517 [APIManagerAPIAdapter] DEBUG: Found: 1 exposed API(s):
2024-10-07 12:52:26,519 [ApplicationExportApp] INFO : Found 1 application(s).
2024-10-07 12:52:26,521 [JsonApplicationExporter] INFO : Going to export applications into folder: /Users/rnatarajan/IdeaProjects/apim-cli-dev/distribution/target/axway-apimcli-1.14.6-SNAPSHOT/apim-cli-1.14.6-SNAPSHOT/scripts/Consuming Test App 499 2172
2024-10-07 12:52:26,541 [JsonApplicationExporter] INFO : Successfully exported application to folder: /Users/rnatarajan/IdeaProjects/apim-cli-dev/distribution/target/axway-apimcli-1.14.6-SNAPSHOT/apim-cli-1.14.6-SNAPSHOT/scripts/Consuming Test App 499 2172
2024-10-07 12:52:26,541 [ApplicationExportApp] DEBUG: Successfully exported 1 application(s).
2024-10-07 12:52:26,541 [APIManagerAdapter] DEBUG: Closing cache ...
2024-10-07 12:52:26,623 [RestAPICall] DEBUG: Http verb:DELETE and URI: https://10.129.144.250:8075/api/portal/v1.4/login Exported output {
"name" : "Consuming Test App 499 2172",
"organization" : "API Development 5172",
"state" : "approved",
"enabled" : true,
"credentials" : [ ],
"apis" : [ {
"apiName" : "ApplicationExportTestIT-499",
"apiVersion" : "1.0.1"
} ],
"permissions" : [ {
"permission" : "view",
"user" : "test2"
} ],
"appScopes" : [ ]
}
|
Can you tell me which URL shall I call? I was also trying to get the actual HTTP request and the response by tweaking the logging properties but didn't get far with this. |
Here is what I have tried so far to get the HTTP transactions out:
|
Add it to your apim.sh or apim.bat file "$_java" -Xms64m -Xmx256m -Dlog4j.configurationFile=../lib/log4j2.xml -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG -classpath "$CP" com.axway.apim.cli.APIManagerCLI "${@}" If compression is enabled on API gateway, add command line parameter -disableCompression to print log in plain text. |
Thank you, this works great to see the HTTP request/response. Looks like we are getting [
{
"id": "0be172d7-3a1b-413d-8e18-a7d6e6bf861c",
"userId": "815e1a5b-6c63-41df-8d96-3dd682bc59ca",
"permission": "",
"createdBy": "63680303-0794-40a7-af6f-8c90fdcdd006",
"createdOn": 1680350847704
}
] as a response to the Here is the API call:
|
On some other gateway, where I don't have this issue, I am getting the following output (for a different app of course): [
{
"id": "a95415d9-9011-4faf-a23d-c3dfd580e01b",
"userId": "fb118d1f-dae4-4863-a3c8-afd4a5685889",
"permission": "manage",
"createdBy": "ebeb67ee-6651-4210-98d5-83e32f25e7f0",
"createdOn": 1680346438281
}
] |
From what I can see in the user interface of the gateway, I seem to be able to manage the application. Both gateways (one returning |
The CLI code is not accepting empty string Find below the code. public enum SharePermission { Looks like an environment issue / product issue. Can you raise a support ticket and confirm empty string is a possible value? |
Asked my colleagues to contact the support. I have also figured out that not all apps are affected. Only some. |
APIM-CLI version
1.14.4+ e6d2e54
API-Management version
7.7.20230228
Bug description
apim -s my-environment app get -id 3a73b789-8cc2-4d04-b5a1-dd3797371022 -o json
fails with an exception fetch app permissions.Steps to reproduce
This fails for any app in my environment I have checked.
It breaks with
-o json
,-o yaml
.It works OK with
-o csv
,-wide
and-ultra
.Relevant log output
The text was updated successfully, but these errors were encountered: