roadie-backstage-plugins: Backstage Jira Plugin: Proxy Path in `app-config.yaml` is Ignored
The Backstage Jira Plugin has been configure according to the Roadie Documentation found here: https://roadie.io/backstage/plugins/jira/. However, the plugin is failing with the following error in the Backstage UI:
After looking through the modest logging, I found that the apiUrl being used is as follows: /api/proxy/jira/api/rest/api/latest/project/YYYY. When I cURL using this URL, using the following cURL command
curl -vvv -X GET -H “Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXX” https://xxx.xxx.com/jira/api/rest/api/latest/project/YYYY
I get the following:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body>Found
The document has moved here.
</body></html> * Connection #0 to host xxx.xxx.com left intact
However, when I use the following cURL command, I get the correct data back:
curl -vvv -X GET -H “Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXX” https://xxx.xxx.com/**jira**/rest/api/latest/project/YYYY
Notice that the in the second invocation of the cURL command there is no api after jira. And it delivered the correct results.
The conclusion that I drew here was that the Proxy Path should not be ‘/jira/api’ as it is listed in the Roadie documentation, but should simply be ‘/jira’. When I change the Proxy Path in the Backstage app-config.yaml file to ‘/jira’,
‘/jira’: target: https://xxx.xxx.com headers: Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXX== Accept: ‘application/json’ Content-Type: ‘application/json’ X-Atlassian-Token: ‘nocheck’ User-Agent: ‘Backstage’
I find that that change to the Proxy Path is not being picked up by the Jira Plugin. Looking through the code, it should be picked up and used by the application in the following line:
And the apiUrl should resolve the Proxy Path on the following line:
Expected Behavior
The Jira Plugin should use the Proxy Path specified in the Backstage app-config.yaml file.
Current Behavior
The Jira Plugin is defaulting to the DEFAULT_PROXY_PATH as defined in the Jira Plugin code on the following line:
Steps to Reproduce
- Install Roadie Jira Plugin
- Change the Proxy Path in the Backstage
app-config.yamlfile. - The Proxy Path is not picked up in the Jira Plugin.
Possible Solution
Context
The plugin fails to work issuing either a 302 error as noted above. We are demo-ing this plugin to upper management on Friday, and advice on a fix would be much appreciated.
And: When I click on the Go to project --> in the Jira card, I am taken to the following address:
http://localhost:3000/catalog/default/component/undefined/browse/YYYY
Why is this the case?
Your Environment
@backstage/plugin-catalog-reactversion: ^0.6.7@backstage/integrationversion: ???@backstage/integration-react: ^0.1.15
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 16 (6 by maintainers)
I am facing the same issue too as @Makkuusen mentioned, somewhere with the proxy path the api call is unsuccessful from the backstage:
Using JIRA api token auth in Curl which returned the expected data-
However with the proxy path as in the following curl - it returned 404
@kissmikijr, Thank you for that very nice explanation.
I am having difficult with getting the plugin to work correctly. Any advice would be much appreciated. As I mentioned, I followed the instructions completely, but am still not getting any data back from Jira for the Plugin.
Here is the relevant section of my
app-config.yaml:proxy: ‘/jira’: target: https://xxx.xxx.com headers: Authorization: Basic ${BASE64_ENCODED_EMAIL:API_TOKEN} Accept: ‘application/json’ Content-Type: ‘application/json’ X-Atlassian-Token: ‘nocheck’ User-Agent: ‘Backstage’
The above ${BASE64_ENCODED_EMAIL:API_TOKEN} was formatted from the following string:
The Jira API token was defined using the Jira site:
Profile --> Personal Access Token --> Create TokenAs an aside: I too am puzzled why the following cURL command works:
When I try any of the variation on the URL, I get either 302 response.
Or a 404 response: