cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Localhost stick somewhere, errors on log and operational

Open ivancarlosti opened this issue 9 months ago • 2 comments

I have some issues related to 'localhost:3000' but I do not find it anywhere.

It produces the errors below:

agenda  | @calcom/web:start:   ▲ Next.js 13.5.7
agenda  | @calcom/web:start:   - Local:        http://localhost:3000
agenda  | @calcom/web:start:
agenda  | @calcom/web:start:  ✓ Ready in 4.1s
agenda  | @calcom/web:start:
agenda  | @calcom/web:start:  ⚠ metadata.metadataBase is not set for resolving social open graph or twitter images, using "http://localhost:3000". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
agenda  | @calcom/web:start: 00:25:29:387 [WARN] orgDomains.ts Org support not enabled for hostname without "." {
agenda  | @calcom/web:start:   hostname: 'localhost:3000'
agenda  | @calcom/web:start: }

Also, when I set confirmation required for a boking, when I click the confirmation link to e-mail message, it confirms properly but redirects to localhost:3000, for example:

Link on email message: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=accept Redirect page: https://localhost:3000/booking/u16################T6XS

I am running image calcom/cal.com:main directly, already tried to find the issue on database, eliminated the image and pulled it again but the issue persists.

My docker-compose.yml:

name: agenda

services:
  calcom:
    image: calcom/cal.com:main
    container_name: agenda
    ports:
      - 3000:3000
    env_file: .env
    extra_hosts:
      - host.docker.internal:host-gateway
    restart: unless-stopped

My .env

NEXT_PUBLIC_WEBAPP_URL=https://mydomain.com
ALLOWED_HOSTNAMES='"mydomain.com"'
NEXTAUTH_URL=https://mydomain.com
NEXT_PUBLIC_CONSOLE_URL=https://mydomain.com
NEXT_PUBLIC_APP_URL=https://mydomain.com
NEXT_PUBLIC_WEBSITE_URL=https://mydomain.com
NEXT_PUBLIC_API_V2_URL=http://localhost:5555/api/v2
NEXTAUTH_SECRET=i20O4######################FMYo=
CALENDSO_ENCRYPTION_KEY=54a######################39dc9
POSTGRES_USER=agenda
POSTGRES_PASSWORD=1D######################hI
POSTGRES_DB=agenda
DATABASE_HOST=host.docker.internal:5432
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
DATABASE_DIRECT_URL=${DATABASE_URL}
GOOGLE_API_CREDENTIALS={"web":{"client_id":"8256######################t8c.apps.googleusercontent.com","project_id":"mydomain","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"G######################su","redirect_uris":["https://mydomain.com/api/integrations/googlecalendar/callback","https://mydomain.com/api/auth/callback/google"]}}
GOOGLE_LOGIN_ENABLED=false
CALCOM_TELEMETRY_DISABLED=1
MS_GRAPH_CLIENT_ID='3f######################ef5'
MS_GRAPH_CLIENT_SECRET='te######################Tn'
EMAIL_FROM='[email protected]'
EMAIL_SERVER_HOST='email-smtp.sa-east-1.amazonaws.com'
EMAIL_SERVER_PORT='587'
EMAIL_SERVER_USER='A######################U'
EMAIL_SERVER_PASSWORD='BG######################Abr'
NODE_ENV=production
NEXT_PUBLIC_APP_NAME='Agenda'
NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS='[email protected]'
NEXT_PUBLIC_COMPANY_NAME='mydomain'
VIRTUAL_HOST=mydomain.com
LETSENCRYPT_HOST=mydomain.com

ivancarlosti avatar Mar 14 '25 00:03 ivancarlosti

Hi @ivancarlosti, can you understand more, I want to work on this issue!

Suraj-kumar00 avatar Mar 14 '25 06:03 Suraj-kumar00

Hi @ivancarlosti, can you understand more, I want to work on this issue!

Sire, do you need any additional information? I can collaborate

Thanks a lot and regards

ivancarlosti avatar Mar 14 '25 13:03 ivancarlosti

I have the same issue!

wachirapohn avatar Apr 04 '25 10:04 wachirapohn

Same issue

Amachako avatar May 01 '25 13:05 Amachako

Issue persists on v5.3.0, reported here

ivancarlosti avatar May 16 '25 16:05 ivancarlosti

Issue persists on v.5.4.0-sh, reported here

When I set confirmation required for a booking, when I click the confirmation or rejection buttons on e-mail message, it hits server and records properly the action, but redirects to localhost:3000 after that, for example:

Links on email message: Confirm button: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=accept Reject button: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=reject

Redirect page: https://localhost:3000/booking/u16################T6XS

When I try to follow redirects using httpstatus.io, I get this error, maybe because it hoops directly to localhost because I have no issue with SSL:

write EPROTO 00789EF8477F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:

ivancarlosti avatar Jun 16 '25 17:06 ivancarlosti

Issue persists on v.5.5.0-sh, reported https://github.com/calcom/docker/issues/319

When I set confirmation required for a booking, when I click the confirmation or rejection buttons on e-mail message, it hits server and records properly the action, but redirects to localhost:3000 after that, for example:

Links on email message: Confirm button: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=accept Reject button: https://mydomain.com/api/link/?token=a8b5bc90681fb###############################7d7ef68c&action=reject

Redirect page: https://localhost:3000/booking/u16################T6XS

ivancarlosti avatar Jun 30 '25 14:06 ivancarlosti

Issue persists on v.5.4.19-sh, reported https://github.com/calcom/docker/issues/319

ivancarlosti avatar Jul 11 '25 14:07 ivancarlosti

Fow now I got a workaround rewriting proxy_redirect in my nginx reverse proxy to solve the redirect failure when confirm or reject an invite approval 🎉

  location @reverse_proxy {

  ### BEGIN fix redirect cal.com ###
    proxy_redirect https://localhost:3000/ https://mycalcomdomain/;
    proxy_redirect http://localhost:3000/ https://mycalcomdomain/;
  ### END fix redirect cal.com ###

    # ...other proxy settings...
  }

Also, about orgDomains, this solution works fine: https://github.com/calcom/docker/issues/434#issuecomment-3160259747

ivancarlosti avatar Aug 06 '25 14:08 ivancarlosti

@ivancarlosti this is a great tip until a fix in done. I'm having the same issue as well. Original install seemed to be working for a bit then stopped. I'm using a NGNXPM script to disable the sign up link on the main page as well. location /signup { deny all; } Unfortunately your script didn't work for me. Maybe I have a syntax error???

location /signup {

  deny all;
}
location @reverse_proxy {
proxy_redirect https://localhost:3000/ https://added_my_domain_here/;
proxy_redirect http://localhost:3000/ https://added_my_domain_here/;
}

nmincone avatar Aug 15 '25 16:08 nmincone

@ivancarlosti this is a great tip until a fix in done. I'm having the same issue as well. Original install seemed to be working for a bit then stopped. I'm using a NGNXPM script to disable the sign up link on the main page as well. location /signup { deny all; } Unfortunately your script didn't work for me. Maybe I have a syntax error???

location /signup {

  deny all;
}
location @reverse_proxy {
proxy_redirect https://localhost:3000/ https://added_my_domain_here/;
proxy_redirect http://localhost:3000/ https://added_my_domain_here/;
}

I am using @reverse_proxy variable to refer to my reverse proxy local port, if you do not use this variable, try using as /

location / {

Note that probably you already have this rule in your nginx config, so you just need to add the proxy_redirect lines

ivancarlosti avatar Aug 15 '25 23:08 ivancarlosti

Hmmm tried this a number of ways, doesn't seem to work. I'm using NGINX Proxy Manager not NGINX if that matters... I searched around and I saw some recommendations to use 'proxy_pass' instead of 'proxy_redirect' but that didn't work either.

location /signup { deny all; } location /localhost:3000 { proxy_redirect https://localhost:3000/ https://cal.mydomain.com/; proxy_redirect http://localhost:3000/ http://cal.mydomain.com/; }

nmincone avatar Aug 17 '25 16:08 nmincone

Hmmm tried this a number of ways, doesn't seem to work. I'm using NGINX Proxy Manager not NGINX if that matters... I searched around and I saw some recommendations to use 'proxy_pass' instead of 'proxy_redirect' but that didn't work either.

location /signup { deny all; } location /localhost:3000 { proxy_redirect https://localhost:3000/ https://cal.mydomain.com/; proxy_redirect http://localhost:3000/ http://cal.mydomain.com/; }

Can you share the complete nginx conf content?

ivancarlosti avatar Aug 17 '25 21:08 ivancarlosti

@ivancarlosti NGINX PM Advaned Settings config

nmincone avatar Aug 18 '25 01:08 nmincone

If you use a subpath, try this (change /cal/ by your subpath) and update cal.mydomain.com to your domain

location /cal/ {
    proxy_redirect http://localhost:3000/ https://cal.mydomain.com/;
    proxy_redirect https://localhost:3000/ https://cal.mydomain.com/;
}

if not, try:

location / {
    proxy_redirect http://localhost:3000/ https://cal.mydomain.com/;
    proxy_redirect https://localhost:3000/ https://cal.mydomain.com/;
}

If it requires proxy_pass, do not forget to add it on first line inside location like proxy_pass http://localhost:3000/;

ivancarlosti avatar Aug 18 '25 01:08 ivancarlosti

We're getting closer! Thanks for taking some time with me on this.

location /cal/ {
    proxy_redirect http://localhost:3000/ https://cal.mydomain.com/ /cal/;
    proxy_redirect https://localhost:3000/ https://cal.mydomain.com/ /cal/;
}

*didn't work...

location / {
    proxy_redirect http://localhost:3000/ https://cal.mydomain.com/ /cal/;
    proxy_redirect https://localhost:3000/ https://cal.mydomain.com/ /cal/;
}

redirects to my FQDN but the link is incorrect; https://cal.mydomain.com/api/link/?token=0ae2d17d23461dde9d0b087224b3aeeb%3Ae446fe0ac175cfe1d8a189c4fce38cd9d72f13ae4ce41abed407dcd3b43d841edd810357a2372a864f5afbca28634c5488713a5360a3e58e3d7b314555d98ad1&action=accept

It should resolve to; https://cal.mydomain.com/booking/uUHaqWDbSC1zQZBnK8Xq1y?error=Booking%20already%20confirmed

nmincone avatar Aug 18 '25 19:08 nmincone

We're getting closer! Thanks for taking some time with me on this.

location /cal/ {
    proxy_redirect http://localhost:3000/ https://cal.mydomain.com/ /cal/;
    proxy_redirect https://localhost:3000/ https://cal.mydomain.com/ /cal/;
}

*didn't work...

location / {
    proxy_redirect http://localhost:3000/ https://cal.mydomain.com/ /cal/;
    proxy_redirect https://localhost:3000/ https://cal.mydomain.com/ /cal/;
}

redirects to my FQDN but the link is incorrect; https://cal.mydomain.com/api/link/?token=0ae2d17d23461dde9d0b087224b3aeeb%3Ae446fe0ac175cfe1d8a189c4fce38cd9d72f13ae4ce41abed407dcd3b43d841edd810357a2372a864f5afbca28634c5488713a5360a3e58e3d7b314555d98ad1&action=accept

It should resolve to; https://cal.mydomain.com/booking/uUHaqWDbSC1zQZBnK8Xq1y?error=Booking%20already%20confirmed

Please follow each redirect here: https://httpstatus.io/

Im my case it goes to some URLs redirects before going to /booking:

Status Code,Scheme,Host,Path
308,https://,MYDOMAIN,/api/link/?token=8XXXXXXXXXXXb24fc5dbbc94c7156%3A4d95cabc4e948ac91ab7c8f5bd80113eb0745c350cbdbaf59a409d957b8a526d5b948b4f74ed71f7aa270dbe874cfad7f4ddcb60eb241d020c3f05bc45f05b59&action=reject
307,https://,MYDOMAIN,/api/link?token=8XXXXXXXXXXXb24fc5dbbc94c7156%3A4d95cabc4e948ac91ab7c8f5bd80113eb0745c350cbdbaf59a409d957b8a526d5b948b4f74ed71f7aa270dbe874cfad7f4ddcb60eb241d020c3f05bc45f05b59&action=reject
200,https://,MYDOMAIN,/booking/kSXXXXXXXip1bZYBUMr4P

ivancarlosti avatar Aug 18 '25 19:08 ivancarlosti

I stumbled on one of your other posts while investigating here. Seems like you've been chasing this dog for some time! I'll look into your suggestion.

nmincone avatar Aug 18 '25 19:08 nmincone

Same issue. Redirects to localhost:3000 after clicking the confirmation link in the email. I don't see that I have localhost:3000 anywhere configured. This issue shouldn't be closed.

mrkylegp avatar Nov 10 '25 22:11 mrkylegp