Skip to content
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

Returns 404 when running on azure app service #114

Open
naramck opened this issue Apr 11, 2022 · 9 comments
Open

Returns 404 when running on azure app service #114

naramck opened this issue Apr 11, 2022 · 9 comments

Comments

@naramck
Copy link

naramck commented Apr 11, 2022

I added the plugin to a backstage instance running on azure app service as docker container. The plugin returns 404 hitting
https://my.domain.com/api/proxy/gitlabci/projects/gitlabgroup%2Fprojectname.

I verified the proxy works fine when I hit https://my.domain.com/api/proxy/test which goes to example.com.
I am seeing in the logs that returned 404 the url shown as https://my.domain.com/api/proxy/gitlabci/projects/gitlabgroup/projectname. I am not sure if the forward slash is the issue.

It works locally on my machine when using separate port for backend. Can you please let me know if there is anything I have to do for running this plugin?

thank you.

@satrox28
Copy link
Collaborator

satrox28 commented Apr 14, 2022

Hi @naramck

Please make sure of the access token used for the proxy can read those projects.

curl --request GET --header "PRIVATE-TOKEN: <TOKEN_USED_BY_BACKSTAGE_PROXY_FOR_GITLAB>" https://gitlabhost.com/api/v4/projects/<project_id>

@satrox28
Copy link
Collaborator

@naramck were you able to resolve the issue?.

@naramck
Copy link
Author

naramck commented Apr 18, 2022

Hi @satrox28,
The issue still exists. I tested the curl command. The proxy token has access to the projects. Seems like the backend proxy api call returning 404, its not even reaching to the gitlab client that is running on backstage backend api.

@naramck
Copy link
Author

naramck commented Apr 18, 2022

@satrox28,

This seems to be an issue with proxy plugin. The url that is being sent to proxy from browser (GitlabCIClient) is shown as
backstage.domain/api/proxy/gitlabci/group%2Fprojectname. but the proxy converts %2F to a forward slash and tries to send that URL to gitlab rest api which returns 404.

@satrox28
Copy link
Collaborator

Hi @naramck

Can you change it to project id in annotation and try.

@satrox28
Copy link
Collaborator

Hi @naramck
Any update?

@naramck
Copy link
Author

naramck commented Apr 27, 2022

HI @satrox28,
It is still an open issue. I spent bit of time, and based on what i observed, the issue seems to be in http-proxy-middleware.

@satrox28
Copy link
Collaborator

@naramck

were you able to check if the below proxy config for gitlabci exist on app-config.yaml?.

  '/gitlabci':
    target: https://gitlab.com/api/v4 or change to your custom gitlab host
    allowedMethods: ['GET']
    headers:
      PRIVATE-TOKEN: '<TOKEN>'

@naramck
Copy link
Author

naramck commented Apr 27, 2022

@satrox28 yes, i have the correct config and token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants