Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAL-3737] Railway deployment does not work #15032

Open
dipyamanroy opened this issue May 14, 2024 · 6 comments
Open

[CAL-3737] Railway deployment does not work #15032

dipyamanroy opened this issue May 14, 2024 · 6 comments
Labels
🐛 bug Something isn't working Medium priority Created by Linear-GitHub Sync self-hosting
Milestone

Comments

@dipyamanroy
Copy link

dipyamanroy commented May 14, 2024

Issue Summary

Deployment using Railway shows up as active, however the URL which points to Cal does not load, or loads briefly with error 500.

Steps to Reproduce

  1. Use the one-click deploy with Railway.
  2. Add your Google API key, and proceed to deploy both Cal and Postgres.
  3. Click on URL generated by Railway.

Expected result is a deployment of Cal with a login page.

Actual Results

  • Blank page or brief displays of Error 500.

Expected Results

  • Login page from Cal

Technical details

Logs from Railway:

@calcom/web:start: SyntaxError: Unexpected token A in JSON at position 0
@calcom/web:start:     at JSON.parse (<anonymous>)
@calcom/web:start:     at 761191 (/calcom/apps/web/.next/server/pages/auth/login.js:1:12370)
@calcom/web:start:     at __webpack_require__ (/calcom/apps/web/.next/server/webpack-runtime.js:1:161)
@calcom/web:start:     at /calcom/apps/web/.next/server/pages/auth/login.js:1:11124
@calcom/web:start:     at __webpack_require__.a (/calcom/apps/web/.next/server/webpack-runtime.js:1:1070)
@calcom/web:start:     at 222186 (/calcom/apps/web/.next/server/pages/auth/login.js:1:10981)
@calcom/web:start:     at __webpack_require__ (/calcom/apps/web/.next/server/webpack-runtime.js:1:161)
@calcom/web:start:     at /calcom/apps/web/.next/server/pages/auth/login.js:1:6541
@calcom/web:start:     at __webpack_require__.a (/calcom/apps/web/.next/server/webpack-runtime.js:1:1070)
@calcom/web:start:     at 130133 (/calcom/apps/web/.next/server/pages/auth/login.js:1:6135)
@calcom/web:start: 16:07:46:497	WARNorgDomains.ts Match of WEBAPP_URL with ALLOWED_HOSTNAME failed {
@calcom/web:start:   WEBAPP_URL: 'https://cal-production-a4cb.up.railway.app'/;,
@calcom/web:start:   ALLOWED_HOSTNAMES: []
@calcom/web:start: }

Evidence

  • Tested using redeployment on Railway. The same issue persists.
    image

CAL-3737

Copy link

dosubot bot commented May 14, 2024

The error logs indicate two primary issues with your Railway deployment of Cal: a JSON syntax error and a domain matching warning. Here's how to address them:

  1. JSON Syntax Error: This likely stems from improperly set or parsed environment variables. Verify that your DATABASE_URL and other relevant environment variables are correctly configured in Railway, matching the format and values expected by Cal.

  2. Domain Matching Warning: Add your Railway app's domain to the ALLOWED_HOSTNAMES environment variable to resolve the domain matching warning. If your app's URL is https://cal-production-a4cb.up.railway.app, include this in the ALLOWED_HOSTNAMES.

  3. Environment Variables: Double-check all required environment variables are set, including those for authentication, database connections, and any other services your deployment needs. For SSL connections with PostgreSQL, you might need to set PGSSLMODE to no-verify.

  4. Database Migrations: Ensure you've run the necessary database migrations for Cal, as a mismatch between the database schema and the application's expectations can lead to errors.

Addressing these points should help resolve the issues you're encountering with your Railway deployment of Cal.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added the 🐛 bug Something isn't working label May 14, 2024
@PeerRich PeerRich added this to the v4.2 milestone May 16, 2024
@PeerRich PeerRich added the Medium priority Created by Linear-GitHub Sync label May 16, 2024
@PeerRich PeerRich changed the title Railway deployment does not work [CAL-3737] Railway deployment does not work May 16, 2024
@PeerRich
Copy link
Member

would love some help from the railway team

@JakeCooper
Copy link

Looks like @brody192 owns the Cal template. Brody do you want to have a look to make sure that this works?

I’d bet it’s missing an envvar that was added or something

@JakeCooper
Copy link

Alternatively, might be good for the Cal team to own the template itself. Got thousands of people on it so:

  1. You’d control the health of that experience/deployment
  2. You’d make $$$ for it

@brody192
Copy link

Thanks for the ping Cooper, Will be heading out on a trip with friends today and tomorrow, but will see what I can find out!

@brody192
Copy link

brody192 commented May 25, 2024

After deploying the template I set a ALLOWED_HOSTNAMES variable to "${{RAILWAY_PUBLIC_DOMAIN}}" (with the quotes) and without the scheme as the env.example file shows.

@calcom/web:start: 12:14:48:757	WARNorgDomains.ts Match of WEBAPP_URL with ALLOWED_HOSTNAME failed {
@calcom/web:start:   WEBAPP_URL: 'https://cal-production-f5f0.up.railway.app';,
@calcom/web:start:   ALLOWED_HOSTNAMES: [
@calcom/web:start:     'cal-production-f5f0.up.railway.app'
@calcom/web:start:   ]
@calcom/web:start: }

I must be missing something because that hostname is definitely a match to the hostname in WEBAPP_URL?

NEXT_PUBLIC_WEBAPP_URL is set to https://${{RAILWAY_PUBLIC_DOMAIN}}

And for what it's worth, the Railway generated domain still opens and redirects to /auth/setup without any error codes or white screens returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working Medium priority Created by Linear-GitHub Sync self-hosting
Projects
None yet
Development

No branches or pull requests

4 participants