Cal not deploying correctly on Railway

masteradit
HOBBY

a year ago

I deployed Cal template on Railway, but when I open the URL, it is showing a blank page. The logs show a lot of errors. I have tried redeploying multiple times (and tried created a new project as well), but I am getting the same errors every time. Can someone please help?

0 Replies

masteradit
HOBBY

a year ago

bec0b4e9-7ab8-4fc1-bfd2-11b968fbdfa4


a year ago

this template?


masteradit
HOBBY

a year ago

Yes


a year ago

okay ill deploy it and see whats up


masteradit
HOBBY

a year ago

Okay, thank you!


a year ago

did you provide your google api credential?


masteradit
HOBBY

a year ago

Yes


masteradit
HOBBY

a year ago

I just noticed some discrepancy on my Google Cloud Console. I'll make the changes and update you if it solves the issue.


masteradit
HOBBY

a year ago

I had not added my custom domain to my Railway project, but my Authorized redirect URIs were pointing to the custom domain on Google Cloud. I added the domain on Railway, but I am still getting the same blank screen when I open the URL.


a year ago

have you followed their docs?


masteradit
HOBBY

a year ago

Yes, I just rechecked all the steps again. The only change I made a few minutes ago was changing GOOGLELOGINENABLED from false to true (I thought it might fix the issue).


masteradit
HOBBY

a year ago

One of the errors I am seeing in the logs a lot is:

2024-03-03 04:30:07.842 UTC [159] ERROR:  relation "public.users" does not exist at character 57

2024-03-03 04:30:07.842 UTC [159] STATEMENT:  SELECT COUNT(*) FROM (SELECT "public"."users"."id" FROM "public"."users" WHERE 1=1 OFFSET $1) AS "sub"

@calcom/web:start: PrismaClientKnownRequestError:

@calcom/web:start: Invalid `prisma.user.count()` invocation:

@calcom/web:start:

@calcom/web:start:

@calcom/web:start: The table `public.users` does not exist in the current database.

@calcom/web:start:     at Cn.handleRequestError (/calcom/node_modules/@prisma/client/runtime/library.js:123:6817)

@calcom/web:start:     at Cn.handleAndLogRequestError (/calcom/node_modules/@prisma/client/runtime/library.js:123:6206)

@calcom/web:start:     at Cn.request (/calcom/node_modules/@prisma/client/runtime/library.js:123:5926)

@calcom/web:start:     at async l (/calcom/node_modules/@prisma/client/runtime/library.js:128:9968)

@calcom/web:start:     at async getServerSideProps (/calcom/apps/web/.next/server/pages/auth/login.js:1:10204) {

@calcom/web:start:   code: 'P2021',

@calcom/web:start:   clientVersion: '5.4.2',

@calcom/web:start:   meta: { table: 'public.users' }

@calcom/web:start: }

@calcom/web:start: 04:30:08:324    WARNorgDomains.ts Match of WEBAPP_URL with ALLOWED_HOSTNAME failed {

@calcom/web:start:   WEBAPP_URL: 'https://cal-production-baf8.up.railway.app';,

@calcom/web:start:   ALLOWED_HOSTNAMES: []

@calcom/web:start: }

masteradit
HOBBY

a year ago

So I went to the data tab in Railway, but it wasn't working. Spent a lot of time trying to figure out how to make it work, but then I saw a message in this server that I should use an external database client to access the database. I downloaded DBeaver, enabled external network in Postgres on Railway, entered all the details in DBeaver, but it couldn't connect to the database. So now I am back to the beginning :(


a year ago

a redeploy of the database is required after enabling the tcp proxy for the very first time


masteradit
HOBBY

a year ago

Oh, okay. Trying that now.


a year ago

are you still using the railway provided domain, or have you added a custom domain?


masteradit
HOBBY

a year ago

Added a custom domain


a year ago

have you redeployed the cal service since then?


masteradit
HOBBY

a year ago

I believe I did, but I'll try again just to be sure


masteradit
HOBBY

a year ago

Postgres redeployment done, but DBeaver connection is still timing out.


a year ago

are you sure you are using all the correct credentials?


masteradit
HOBBY

a year ago

Redeployed Cal service, same issue is still there


masteradit
HOBBY

a year ago

I noticed Railway did not automatically add the public host in Postgres service's variables:

1213709962128138200


masteradit
HOBBY

a year ago

Should I add it manually and redeploy?


a year ago

nope, please don't that would only mess something else up


a year ago

show me a screenshot of the public network section of the database service settings


masteradit
HOBBY

a year ago

1213710343923048400


a year ago

that is an http domain, postgres does not use http, postgres uses tcp


masteradit
HOBBY

a year ago

1213710745510879200


a year ago

that internal port looks wrong


a year ago

it's 5432, you where close


masteradit
HOBBY

a year ago

I'm sorry, my bad. Fixed it.

1213711300161437700


a year ago

okay now a redeploy is needed


masteradit
HOBBY

a year ago

Should I put these values in DBeaver?
Host: viaduct.proxy.rlwy.net
Port: 5432
Database: railway
Username:
Password:


a year ago

5432 is the internal port, you need to use the public port (the bigger number)


masteradit
HOBBY

a year ago

Okay, connection was done successfully!


masteradit
HOBBY

a year ago

Looks like there are no tables?

1213712747414421500


a year ago

maybe migrations didn't run for some reason


a year ago

I wonder if cal changed something


masteradit
HOBBY

a year ago

Oh, is there anything I can do to check?


a year ago

honestly no clue right now, I may have created the template, but I don't personally use it


masteradit
HOBBY

a year ago

Oh, okay


a year ago

try deploying the template again?


masteradit
HOBBY

a year ago

Already tried it thrice 🥲


masteradit
HOBBY

a year ago

I'll try again


a year ago

nah 3 times is good


masteradit
HOBBY

a year ago

I think the issue is linked to Cal. Found a thread on their server which might be linked to this:

1213719434535903263


a year ago

hmmm, my template uses postgres 16


a year ago

their offical self hosted docs for docker use postgres 16


masteradit
HOBBY

a year ago

https://github.com/calcom/docker/issues/329 - looks like the current quick fix is to use v3.7.11 tag. They haven't released the docker image for the latest version.


a year ago

okay swap the image in use to that tag


masteradit
HOBBY

a year ago

Just to confirm, I have to disconnect this and add the tag, right?

1213730514448416800


a year ago

correct


masteradit
HOBBY

a year ago

Changed it to calcom/cal.com:v3.7.11. Redeploying now.


masteradit
HOBBY

a year ago

Applying migration `20231110122349_paid_apps`

Applying migration `20231113131945_idx_teamid_verification_token`

Applying migration `20231113202947_add_ical_columns_to_booking`

Applying migration `20231114090318_add_avatar_url`

Applying migration `20231117002911_add_users_locked`

Applying migration `20231117081852_idx_eventtype_scheduleid`

Applying migration `20231202181233_adding_show_first_available_timeslot`

Applying migration `20231203154633_adding_is_mandatory_reminder_field_for_mandatory_reminders`

Applying migration `20231206191034_add_cal_video_logo`

Applying migration `20231206220118_add_recurring_event_id`

Applying migration `20231213083720_add_meeting_started_webhook`

Applying migration `20231213153230_add_instant_meeting`

Applying migration `20240105110500_removed_newbooker_feature_flag`

Applying migration `20240109041925_add_out_of_office_entry_table`

Applying migration `20240111075727_remove_brand_colours_default`

Applying migration `20240114195534_assign_all_team_members`

I see a lot of logs like this 👀
I hope it works.


a year ago

migrations are running, thats good


masteradit
HOBBY

a year ago

It worked!


a year ago

updated the template too temporarily, thanks for bringing this up

1213732530331713500


masteradit
HOBBY

a year ago

Thanks a lot for helping!


masteradit
HOBBY

a year ago

I'll keep an eye on their releases. I hope it is fixed soon. Will ping you if there's an update.


a year ago

sounds good!


a year ago

i tested a template deploy with the latest tag, and adding a DATABASE_DIRECT_URL variable and i can see that the migrations where ran


masteradit
HOBBY

a year ago

What value to put in it?


a year ago

the same as the DATABASE_URL variable

${{Postgres.DATABASE_PRIVATE_URL}}

masteradit
HOBBY

a year ago

Trying this with calcom/cal.com


masteradit
HOBBY

a year ago

It is working!


masteradit
HOBBY

a year ago

Thanks!


a year ago

awesome, then I'll add that variable to the public template and go back to the latest tag


a year ago

Hi @Master Adit I just see you were running in the same issues as I did when I’ve tried cal. Would you please be available for assisting me via dm when I do a retry, please


a year ago

Looking forward to receive your expertise