rails 502 bad geateway
alejandrouda
FREEOP

2 months ago

Hi there!

I have been trying to deploy my Rails App to Railway, although I'm getting stuck with the 502 bad gateway error.

I should have the proper settings, and my app should be listening to the port 3000.

This is the URL: https://gastropilotapi-production.up.railway.app/

I can see the deploy was successful and it is running.

The port is set to 3000 on the Railway domain. This is my puma config:

threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
threads threads_count, threads_count

# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
port ENV.fetch("PORT", 3000)

# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart

# Run the Solid Queue supervisor inside of Puma for single-server deployments
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]

# Specify the PID file. Defaults to tmp/pids/server.pid in development.
# In other environments, only set the PID file if requested.
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]

Is there any recommendations for troublsehooting steps on this one?

Thanks for your help!

$10 Bounty

3 Replies

Railway
BOT

2 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


noahd
EMPLOYEE

2 months ago

Hey there!
Are you currently binding to ip 0.0.0.0? Unfamiliar with puma but that might be a case


alejandrouda
FREEOP

2 months ago

Hey there, thanks for taking a look!

I added the following on my puma.rb file:

port ENV.fetch("PORT", 3000), "0.0.0.0"

Also, you can find attached a screenshot with my domain config.

Is there anything that I should check on the Railway bash to better understand what could be causing the issue?

Attachments


Loading...