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

Cannot load build logs in browser #4

Open
hoyon opened this issue Nov 9, 2023 · 1 comment
Open

Cannot load build logs in browser #4

hoyon opened this issue Nov 9, 2023 · 1 comment

Comments

@hoyon
Copy link

hoyon commented Nov 9, 2023

We've just added this plugin to our Backstage instance and are able to see our CircleCI jobs in Backstage but when clicking into a job the build logs fail to load.

What I believe is happening is that the request to get the build details succeeds because it goes through the backend proxy, but this request then returns a direct link to the build logs which looks something like this:

        {
          "index": 0,
          "step": 99,
          "allocation_id": "654cb1e089ac7d37121be7ed-0-build/ABCDEFGH",
          "name": "Preparing environment variables",
          "type": "test",
          "start_time": "2023-11-09T10:18:13.022Z",
          "truncated": false,
          "parallel": true,
          "bash_command": null,
          "background": false,
          "insignificant": false,
          "has_output": true,
          "continue": null,
          "end_time": "2023-11-09T10:18:13.03Z",
          "exit_code": null,
          "run_time_millis": 8,
          "output_url": "https://circleci.com/api/private/output/presigned/...",
          "status": "success",
          "failed": null,
          "infrastructure_fail": null,
          "timedout": null,
          "canceled": null
        }

This output_url is then fetched straight from the browser instead of going via the backend proxy. This then fails as the endpoint isn't CORS enabled.

image

This request should instead be proxied through the backend like the other API calls to avoid the CORS issue. Of course an alternative solution would be to enable CORS on that endpoint but I'm not sure if that is the best option.

@omi-jobs
Copy link

Hello Contributors, @EricRibeiro and @KyleTryon, we are experiencing this issue with the current version v1.1. Is there any update on this matter? We are encountering a CORS error when attempting to open the build logs. Requests should be proxied through the backend, similar to other API calls, to avoid the CORS issue.

image image image

Please let us know what the best alternative solution would be to address this problem. Thank you.

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