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

[BUG] Cannot build frontend because of Sentry #6112

Open
frafra opened this issue Oct 29, 2023 · 4 comments
Open

[BUG] Cannot build frontend because of Sentry #6112

frafra opened this issue Oct 29, 2023 · 4 comments

Comments

@frafra
Copy link
Contributor

frafra commented Oct 29, 2023

Describe the bug

npm run build fails with caused by: sentry reported an error: Authentication credentials were not provided. (http status: 401).

To Reproduce
Steps to reproduce the behavior:

  1. Build frontend

Expected behavior
Sentry credentials should be read at runtime, not at build time.

Additional information

I think this happens because npm build runs sentry:sourcemaps:

"sentry:sourcemaps": "sentry-cli sourcemaps inject --org humanitarian-openstreetmap-tea --project taskingmanager-frontend ./build && sentry-cli sourcemaps upload --org humanitarian-openstreetmap-tea --project taskingmanager-frontend ./build"

It really looks an action that should not be called on build, since it contains HOT-specific configuration, which is not relevant for other setups of the TM.

Regression have been caused by b7563bf.

frafra added a commit to osmItalia/tasking-manager that referenced this issue Oct 29, 2023
frafra referenced this issue Oct 29, 2023
* Add sourcemapping for sentry

* Add sentry cli dev dependency

* Remove redundant sentry packages

* Replace sentry replay instantiation to use react package
frafra added a commit to osmItalia/tasking-manager that referenced this issue Oct 29, 2023
@kresp0
Copy link

kresp0 commented Dec 6, 2023

I can also reproduce this issue.

After removing line 96, the comma and the end of line 95 and && npm run sentry:sourcemaps, the build finishes without the error.

nicokant pushed a commit to osmItalia/tasking-manager that referenced this issue Feb 24, 2024
@ramyaragupathy
Copy link
Member

@mahesh-naxa does this get fixed with recent docker changes?

@mahesh-naxa
Copy link
Collaborator

@ramyaragupathy the new docker compose has frontend setup as per the frontend/Dockerfile_development, so npm start is performed.
I believe npm run sentry:sourcemaps is needed for production setup only and if its to be used, the environment var SENTRY_AUTH_TOKEN should have been set accordingly.
The current docker setup will not produce this error.

@ramyaragupathy
Copy link
Member

@frafra - can you please try this with the updated docker setup?

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

No branches or pull requests

5 participants