ERR_INVALID_URL & UPSTASH log entries - sidequest: disable telemetry & Signup
-
Excuse me for being pedantic. That's my Monk inside.
The moment we fixed the error for not sending emails, I looked at the env.example from the project (https://github.com/calcom/cal.com/blob/main/.env.example)
I want to have
CALCOM_TELEMETRY_DISABLED=1
andNEXT_PUBLIC_DISABLE_SIGNUP=true
and have tried the variants with"true"
and without. Without effects.To get an idea of what was happening, I looked at the log files and found
due to not finding UPSTASH env
&[ERR_INVALID_URL]: Invalid URL
In env.example there is an
ALLOWED_HOSTNAMES='"cal.com", "cal.dev", "cal-staging.com", "cal.community", "cal.local:3000", "localhost:3000"'
. Strangely - the moment I type something likeALLOWED_HOSTNAMES='"free.luckow.org", "localhost:3000", "cloudron:1337"'
, the logs show meSep 04 21:26:31@calcom/web:start: SyntaxError: Unexpected token ' in JSON at position 1
.So this doesn't fix the
ERR_INVALID_URL
log entry.Does anyone else have any helpful ideas?
Sep 04 21:30:56@calcom/web:start: (node:4043) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time Sep 04 21:30:56@calcom/web:start: (Use `node --trace-warnings ...` to show where the warning was created) Sep 04 21:31:27@calcom/web:start: 19:31:27.707 WARN RateLimit Disabled due to not finding UPSTASH env variables Sep 04 21:31:28@calcom/web:start: 2023-09-04 19:31:28.077 UTC [ERROR] (next-collect/server) - Invalid URL TypeError [ERR_INVALID_URL]: Invalid URL Sep 04 21:31:28@calcom/web:start: at new NodeError (node:internal/errors:393:5) Sep 04 21:31:28@calcom/web:start: at URL.onParseError (node:internal/url:565:9) Sep 04 21:31:28@calcom/web:start: at new URL (node:internal/url:645:5) Sep 04 21:31:28@calcom/web:start: at new URL (node:internal/url:642:22) Sep 04 21:31:28@calcom/web:start: at Object.parsePublicUrl (/run/calcom/node_modules/next-collect/dist/next-shim.js:74:27) Sep 04 21:31:28@calcom/web:start: at Object.nextApiHandler (/run/calcom/node_modules/next-collect/dist/server.js:58:40) Sep 04 21:31:28@calcom/web:start: at /run/calcom/node_modules/next-collect/dist/server.js:180:25 Sep 04 21:31:28@calcom/web:start: at /run/calcom/node_modules/next/dist/server/api-utils/node.js:463:16 Sep 04 21:31:28@calcom/web:start: at /run/calcom/node_modules/next/dist/server/lib/trace/tracer.js:117:36 Sep 04 21:31:28@calcom/web:start: at NoopContextManager.with (/run/calcom/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js:25:19) { Sep 04 21:31:28@calcom/web:start: input: 'https,http://free.luckow.org', Sep 04 21:31:28@calcom/web:start: code: 'ERR_INVALID_URL' Sep 04 21:31:28@calcom/web:start: }
-
-
At least for telemetry settings, the start.sh already disables it https://git.cloudron.io/cloudron/calcom-app/-/blob/main/start.sh?ref_type=heads#L63 is this not working?
Have to check the
NEXT_PUBLIC_DISABLE_SIGNUP
later.Is the URL issue with upstash a separate thing, or related to telemetry?
-
ok, you started with the sidequest, which was my first task, and later I found the quoted parts in the logs.
To create more structure:-
OK. Disable telemetry
CALCOM_TELEMETRY_DISABLED=1
is not necessary because ofstart.sh
. I have no idea how to test this. -
Disable signup
NEXT_PUBLIC_DISABLE_SIGNUP=true
did not work in my tests. -
I tried to fix the error in the log file
Sep 04 21:31:28@calcom/web:start: code: 'ERR_INVALID_URL'
with the optionALLOWED_HOSTNAMES=
in the env file. Did not work. robi had suggested that the internal Docker IP could be the url. -
The only information I found about the UPSTASH warning in the logs (
Sep 04 21:31:27@calcom/web:start: 19:31:27.707 WARN RateLimit Disabled
) comes from the env.example and seems to have something to do with redisUPSTASH_REDIS_REST_URL=
Maybe it's complete nonsense
-
-
So the URL issue is because the code crashes at https://github.com/jitsucom/next-collect/blob/d6e9a03bbd79279f5cc2fe66c424fe2ef55c804f/packages/next-collect/src/next-shim.ts#L133
This is again due to the fact that the
x-forwarded-proto
ishttps,http
(specifying two protocols...same for ports actualy80,443
also wrong) So far I am not sure where this comes from, our nginx configs only set the correcthttps
.I assume this is some cal.com or next.js issue
-
I just posted a separate topic that might be part of the issue here, too: https://forum.cloudron.io/topic/10971/allowed_hostnames-environment-variable-breaks-app-startup
-