hyperdxio / hyperdx

Resolve production issues, fast. An open source observability platform unifying session replays, logs, metrics, traces and errors powered by Clickhouse and OpenTelemetry.
https://hyperdx.io/
MIT License
6.39k stars 175 forks source link

[Bug] Invalid `SERVER_URL` in the first few requests #420

Open micouy opened 4 weeks ago

micouy commented 4 weeks ago

I'm running local HyperDX with the app and API ports mapped:

docker run -p 8001:8000 -p 4318:4318 -p 4317:4317 -p 8081:8080 -p 8002:8002  -e HYPERDX_APP_PORT=8081 -e HYPERDX_API_PORT=8001 hyperdx/hyperdx-local

Despite the mapping, the first few requests are sent to the default API port 8000 which results in 404s or in CORS errors if another server is running on this port:

image

It seems like NEXT_PUBLIC_SERVER_URL is empty during the first request and the hardcoded value is used instead:

export const SERVER_URL =
  process.env.NEXT_PUBLIC_SERVER_URL || 'http://localhost:8000'; // NEXT_PUBLIC_SERVER_URL can be empty string

packages/app/src/config.ts

If I change the default URL, the first few requests go to that URL.

smitt04 commented 4 weeks ago

I can't seem to change the url at all, no matter what i set the env to it still loads as localhost which breaks when deployed somewhere else

smitt04 commented 4 weeks ago

turns out, the app needs to be built with those env vars preset, can not be passed into the container

micouy commented 2 weeks ago

@ernestii any updates on that?

hanwenbo commented 1 week ago

+1

lijianow commented 1 week ago
image

The first step is wrong. It doesn't work

lijianow commented 1 week ago

This docker front-end is so easy to develop why doesn't anyone update it