SAP / cf-html5-apps-repo-cli-plugin

Cloud Foundry CLI plugin to work with SAP Cloud HTML5 Applications Repository
Apache License 2.0
43 stars 5 forks source link

html5-list never completes _ Possible regression in 1.4.7 with cf api V3 support #66

Open jeannich opened 8 months ago

jeannich commented 8 months ago

Description

command "cf html5-list" never ends with plugin version 1.4.7 If I add DEBUG=2, I see that the plugin is constantly querying the same end point forever. If I revert back to 1.4.6 on the same environment, commands works fine

Environment

CLI Output

Set environment variable DEBUG=1, run the flow and paste output here.

/workdir# DEBUG=2 cf html5-list
18:23:35.536441 Running CloudFoundry html5-plugin 1.4.7
18:23:35.536574 Initializing command 'html5-list'
18:23:35.536632 Configuration file does not exist. No cache to clear
18:23:35.536794 Executing command 'html5-list': args: '[]'
18:23:35.536824 Getting context (org/space/username)
Getting list of HTML5 applications in org ----my-cf-org---- / space ----my-cf-space---- as me@blaaa.com...
18:23:35.538803 Getting HTML5 context
18:23:35.538855 Getting list of services
18:23:35.539350 Making request to: /v3/service_offerings?space_guids=----my-cf-space-GUID-------------------------
18:23:35.948073 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:36.148838 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:36.435369 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:36.701777 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:36.918024 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:37.058633 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:37.206084 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:37.424222 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:37.702915 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:37.941241 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:38.177544 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:38.452886 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:38.677136 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:38.935742 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:39.159212 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:39.304649 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:39.441307 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:39.772345 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:40.020345 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:40.263853 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:40.510683 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:40.756558 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:41.032628 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:41.359726 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:41.592778 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:41.848412 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:42.096888 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:42.325717 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:42.615421 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:42.832337 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
18:23:43.098407 Making request to: https://----my-cf-server-url----/v3/service_offerings?page=2&per_page=50&space_guids=----my-cf-space-GUID-------------------------
...
...
...
...

If I rollback to previous version 1.4.6, commands work fine, here is below a normal output:

cf install-plugin -f https://github.com/SAP/cf-html5-apps-repo-cli-plugin/releases/download/v1.4.6/cf-html5-apps-repo-cli-plugin-linux-amd64
root@36bb8a8c8b89:/workdir# DEBUG=2 cf html5-list
18:35:18.689922 Running CloudFoundry html5-plugin 1.4.6
18:35:18.690337 Initializing command 'html5-list'
18:35:18.690436 Configuration file does not exist. No cache to clear
18:35:18.690510 Executing command 'html5-list': args: '[]'
18:35:18.690623 Getting context (org/space/username)
Getting list of HTML5 applications in org ----my-cf-org---- / space ----my-cf-space---- as me@blaaa.com...
18:35:18.694614 Getting HTML5 context
18:35:18.694657 Getting list of services
18:35:18.695528 Making request to: /v2/spaces/----my-cf-space-GUID-------------------------/services
18:35:19.495306 Looking for 'html5-apps-repo' service
18:35:19.495369 Getting service plans for 'html5-apps-repo' service (GUID: ----some-GUID-------------------------------)
18:35:19.495375 Making request to: /v2/service_plans?q=service_guid:----some-GUID-------------------------------
18:35:19.762803 Looking for app-runtime service plan
...
...

For now I'll live with 1.4.6 but as cf api V2 is being deprecated, a fix to this issue will become necessary in a near future. Thanks for your help !!

micellius commented 7 months ago

Hi @jeannich , Thanks for reporting an issue!

The problem that you face is indeed regression related to CF API V3 support, and is most probably the same as #63. This was already fixed and published as part of 1.4.8 release. The 1.4.8 version of plugin is not yet available in CF CLI Plugins repository, therefore to use it you may install binary in your docker from GitHub release directly, e.g.:

cf install-plugin -f https://github.com/SAP/cf-html5-apps-repo-cli-plugin/releases/latest/download/cf-html5-apps-repo-cli-plugin-linux-amd64

Note: depending on CPU architecture in your target environment, the suffix of the binary name would be either -amd64 or -arm64.

jeannich commented 7 months ago

Thanks I'll use 1.4.8 then.

Is it possible to get an estimation of when we could have this version as default of cf cli plugins repository ?