Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion apps/docs/content/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ These variables must be provided at the time of the docker build, and can be pro
- `NEXT_PUBLIC_LICENSE_CONSENT`
- `NEXT_PUBLIC_WEBAPP_URL`

> If you are self-hosting with a custom domain and OAuth redirects fail with hostname mismatch errors, check `BUILT_NEXT_PUBLIC_WEBAPP_URL` in your running container. If it still points to `http://localhost:3000`, your image was built with localhost values and must be rebuilt with your domain.

#### Important Run-time variables

- `NEXTAUTH_SECRET`
Expand All @@ -106,9 +108,25 @@ For more detailed instructions on how to build and configure your own Docker ima

### CLIENT_FETCH_ERROR

If you experience this error, it may be the way the default Auth callback in the server is using the WEBAPP_URL as a base url. The container does not necessarily have access to the same DNS as your local machine, and therefore needs to be configured to resolve to itself. You may be able to correct this by configuring `NEXTAUTH_URL=http://localhost:3000/api/auth`, to help the backend loop back to itself.
If you experience this error, it may be because the Auth callback in the server is using the web app URL as a base URL. The container does not necessarily have access to the same DNS as your local machine and may need to loop back to itself. You may be able to correct this by configuring `NEXTAUTH_URL=http://localhost:3000/api/auth` for internal callback requests while keeping `NEXT_PUBLIC_WEBAPP_URL` set to your public domain.

```
docker-calcom-1 | @calcom/web:start: [next-auth][error][CLIENT_FETCH_ERROR]
docker-calcom-1 | @calcom/web:start: https://next-auth.js.org/errors#client_fetch_error request to http://testing.localhost:3000/api/auth/session failed, reason: getaddrinfo ENOTFOUND testing.localhost
```

### WEBAPP_URL and ALLOWED_HOSTNAMES mismatch

If OAuth loops and logs show messages like `Match of WEBAPP_URL with ALLOWED_HOSTNAMES failed`, verify all of the following:

1. `ALLOWED_HOSTNAMES` is set as a comma-separated list of quoted hostnames (for example, `ALLOWED_HOSTNAMES='"cal.example.com","www.cal.example.com"'`).
2. `NEXT_PUBLIC_WEBAPP_URL` is set to your public domain.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify NEXT_PUBLIC_WEBAPP_URL as a full URL (with scheme).

Line 123 says “public domain,” which can be read as hostname-only. Please make it explicit that this must be a full URL (for example, https://cal.example.com) to avoid malformed derived auth URLs.

✏️ Suggested doc tweak
-2. `NEXT_PUBLIC_WEBAPP_URL` is set to your public domain.
+2. `NEXT_PUBLIC_WEBAPP_URL` is set to your public URL (for example, `https://cal.example.com`).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/content/docker.mdx` at line 123, Update the documentation for
NEXT_PUBLIC_WEBAPP_URL to state it must be a full URL including the scheme
(e.g., https://cal.example.com) rather than just a hostname; change the phrase
"public domain" to something like "full public URL (including http:// or
https://)" so derived auth URLs are not malformed and readers know to include
the scheme.

3. Your image was built with the same public domain values.

Quick check:

```bash
docker compose exec calcom printenv BUILT_NEXT_PUBLIC_WEBAPP_URL
```

If this value does not match your public domain, rebuild your image with the correct build-time args and restart the stack.
Loading