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

Tracker script always using /api/send rather than the endpoint defined by environment variable #2562

Closed
shiruken opened this issue Mar 3, 2024 · 7 comments
Labels
bug Something isn't working fixed in dev Fixed in the dev branch

Comments

@shiruken
Copy link

shiruken commented Mar 3, 2024

Describe the Bug

The tracker script always references /api/send rather than the endpoint defined by the COLLECT_API_ENDPOINT environment variable.

Database

PostgreSQL

Relevant log output

No response

Which Umami version are you using? (if relevant)

v2.10.1

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Railway Template

@dreary-ennui
Copy link

Looks like I am also having this issue. Using the MySQL Docker image.

Defining these environment variables in the compose:

TRACKER_SCRIPT_NAME: rep.js
COLLECT_API_ENDPOINT: /my/custom

@franciscao633 franciscao633 added the bug Something isn't working label Mar 6, 2024
@franciscao633
Copy link
Collaborator

Confirmed. Do you know what version you were on previously before upgrading?

@shiruken
Copy link
Author

shiruken commented Mar 6, 2024

Judging by when analytics stopped being reported, it looks like the v2.10.0 release caused the issue

@jonaskuske
Copy link
Contributor

The replacer in the script is looking for "/api/send", but the script contains `${someExpression}/api/send`

@franciscao633
Copy link
Collaborator

franciscao633 commented Mar 6, 2024

Thanks, this is fixed. The regex expression in update-tracker was incorrect as @jonaskuske noted. Need to release a new image.

@franciscao633 franciscao633 added the fixed in dev Fixed in the dev branch label Mar 6, 2024
@jonaskuske
Copy link
Contributor

Thanks for the quick update!

But the regex is now adding superfluous quotes into the script, as the double quotes were only removed from the regex, not from the replacement string ⚠️

@franciscao633

@franciscao633
Copy link
Collaborator

That was not smart... fixed again!

@mikecao mikecao closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in dev Fixed in the dev branch
Projects
None yet
Development

No branches or pull requests

5 participants