roadie-backstage-plugins
roadie-backstage-plugins copied to clipboard
argocd: create action: show the body of the http response when /api/v1/session is called
Issue
During the process to get an ArgoCD Token, I got the following error
12024-01-25T13:23:16.000Z Beginning step Create ArgoCD Resources22024-01-25T13:23:16.000Z FetchError: invalid json response body at https://openshift-gitops-server-openshift-gitops.apps.qshift.snowdrop.dev/api/v1/session,
Opens in a new window reason: Unexpected token M in JSON at position 03
at /opt/app-root/src/dynamic-plugins-root/roadiehq-scaffolder-backend-argocd-dynamic/node_modules/node-fetch/lib/index.js:273:324 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
FYI: I get (I think) a correct JSON response if I curl the argocd server
curl $URL/api/v1/session -d '{"username":"admin","password":"hU5ksdnFxK1qiH9gflR6jZIbz7BGQDEX"}'
{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhcmdvY2QiLCJzdWIiOiJhZG1pbjpsb2dpbiIsImV4cCI6MTcwNjI3NjU5MSwibmJmIjoxNzA2MTkwMTkxLCJpYXQiOjE3MDYxOTAxOTEsImp0aSI6ImIyMzhiMjdlLWI3ZmMtNDM5ZC1hYmM4LWEzZDlkNjVlZDA0MyJ9.9CzE4dljPrKuTtIoaILV7DZWFJAO5NxjYwF_MUlv8ZE"}%
Why the JSON cannot parsed ? IDK
To better understand what the problem is, it should be great to also (maybe using debug level) show the content of the HTTP body response
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Why are you closing it instead of discussing the content and reporting or not a solution ?
Why are you closing it instead of discussing the content and reporting or not a solution ?
Hi @cmoulliard, the issue was automatically marked as stale and subsequently closed by a bot. Could you send a PR to fix this and we can review your solution?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.