i run into this error when i try logging into calcom" https://api/auth/error"
I installed calcom in docker, below is my .en and doceker file. Iam able to access the web interface via the url. the issue i am having is, once i type in my login details into the webinterface. it runs into "https://api/auth/error"
please help me with this issue.
root@transformersagencyworkspace028432://cal/docker# cat d
database-data/ docker-compose.yaml
root@transformersagencyworkspace028432://cal/docker# cat docker-compose.yaml
Use postgres/example user/password credentials
version: '3.8'
networks: stack: name: stack external: false
services: database: container_name: database_calcom image: postgres restart: always volumes: - ./database-data:/var/lib/postgresql/data/ env_file: .env networks: - stack
calcom: image: calcom.docker.scarf.sh/calcom/cal.com build: context: . dockerfile: Dockerfile args: NEXT_PUBLIC_WEBAPP_URL: ${NEXT_PUBLIC_WEBAPP_URL} NEXT_PUBLIC_LICENSE_CONSENT: ${NEXT_PUBLIC_LICENSE_CONSENT} CALCOM_TELEMETRY_DISABLED: ${CALCOM_TELEMETRY_DISABLED} NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} CALENDSO_ENCRYPTION_KEY: ${CALENDSO_ENCRYPTION_KEY} DATABASE_URL: ${DATABASE_URL} DATABASE_DIRECT_URL: ${DATABASE_URL} network: stack restart: always networks: - stack ports: - 3000:3000 env_file: .env environment: - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB} - DATABASE_DIRECT_URL=${DATABASE_URL} depends_on: - database
root@transformersagencyworkspace028432://cal/docker# cat .env
Set this value to 'agree' to accept our license:
LICENSE: https://github.com/calendso/calendso/blob/main/LICENSE
Summary of terms:
- The codebase has to stay open source, whether it was modified or not
- You can not repackage or sell the codebase
- Acquire a commercial license to remove these terms by emailing: [email protected]
NEXT_PUBLIC_LICENSE_CONSENT=true LICENSE=
BASE_URL and NEXT_PUBLIC_APP_URL are both deprecated. Both are replaced with one variable, NEXT_PUBLIC_WEBAPP_URL
BASE_URL=http://localhost:3000
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_WEBAPP_URL=https://schedule.transformers.agency
Configure NEXTAUTH_URL manually if needed, otherwise it will resolve to {NEXT_PUBLIC_WEBAPP_URL}/api/auth
NEXTAUTH_URL=https://schedule.transformers.agency/api/auth
It is highly recommended that the NEXTAUTH_SECRET must be overridden and very unique
Use openssl rand -base64 32 to generate a key
NEXTAUTH_SECRET=secret
Encryption key that will be used to encrypt CalDAV credentials, choose a random string, for example with dd if=/dev/urandom bs=1K count=1 | md5sum
CALENDSO_ENCRYPTION_KEY=secret
Deprecation note: JWT_SECRET is no longer used
JWT_SECRET=secret
POSTGRES_USER=calcom_postgres POSTGRES_PASSWORD=magical POSTGRES_DB=calendso DATABASE_HOST=database:5432 DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
Needed to run migrations while using a connection pooler like PgBouncer
Use the same one as DATABASE_URL if you're not using a connection pooler
DATABASE_DIRECT_URL=${DATABASE_URL} GOOGLE_API_CREDENTIALS={}
Set this to '1' if you don't want Cal to collect anonymous usage
CALCOM_TELEMETRY_DISABLED=1
Used for the Office 365 / Outlook.com Calendar integration
MS_GRAPH_CLIENT_ID= MS_GRAPH_CLIENT_SECRET=
Used for the Zoom integration
ZOOM_CLIENT_ID= ZOOM_CLIENT_SECRET=
E-mail settings
Configures the global From: header whilst sending emails.
EMAIL_FROM=
Configure SMTP settings (@see https://nodemailer.com/smtp/).
EMAIL_SERVER_HOST= EMAIL_SERVER_PORT= EMAIL_SERVER_USER= EMAIL_SERVER_PASSWORD=
NODE_ENV=production
Hey @awakgeek ! So I ran into a similar issue and here’s what worked for me:
What I did to fix it:
I set DATABASE_DIRECT_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB} directly in my .env. Yep, it’s exactly the same as DATABASE_URL, so you'd think the ${} variables should work, right? But for some reason, explicitly setting it like that fixed the issue ¯\__(ツ)_/¯
.env
DATABASE_DIRECT_URL=${DATABASE_URL} ❌
DATABASE_DIRECT_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB} ✅
Why this might work (even though it doesn’t totally make sense to me 🤔?):
It could be a funky variable expansion quirk in Docker or how the app is parsing the environment file. Sometimes the app or Docker-compose might not be evaluating the variable ${DATABASE_URL} exactly as you'd expect—maybe it doesn’t resolve nested variables correctly. I don't really know, but by explicitly naming it, you’re giving it no choice but to set it properly!
Will it work for you?
🤷♂️ Honestly, not 100% sure, but it fixed my issue, so it’s definitely worth a shot! Give it a try and see if that clears things up for you! Best of luck :)
Closing due to lack of activity and the current .env.example works as intended.