redis railway
nexblu
HOBBYOP

2 years ago

i am getting error on my flask app

27 Replies

nexblu
HOBBYOP

2 years ago

excuse me sir, i am trying to use redis celery for my flask app


nexblu
HOBBYOP

2 years ago

and finally i get error


nexblu
HOBBYOP

2 years ago

[2024-09-03 01:13:15,841: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.```

the error is like this


nexblu
HOBBYOP

2 years ago

web: gunicorn main:app
worker: celery -A main.celery_app worker --loglevel=info```

this is my Procfile code


2 years ago

first off, that Profile format is specific to Heroku and is not supported on railway, you would instead need two duplicate services, one to run gunicorn, and the other to run celery, you would define either command in the service settings.

secondly, amqp://guest:**@127.0.0.1:5672// is not the correct URL, make sure you are using environment variables set to the correct value.


nexblu
HOBBYOP

2 years ago

Yes sir, I have run two services, one for flask and one for redis

1280340482907443230


2 years ago

you mean one for flask and one for celery


2 years ago

please see my second point


nexblu
HOBBYOP

2 years ago

yes


nexblu
HOBBYOP

2 years ago

okey wait


2 years ago

in don't see redis here?


nexblu
HOBBYOP

2 years ago

I mean there are 2 services, one for running flask, one for running a worker like "celery -A main.celery_app worker --loglevel=info"


2 years ago

celery needs redis, where is redis? are you hosting redis elsewhere?


nexblu
HOBBYOP

2 years ago

I have redis directly from railway

1280342028886212648


nexblu
HOBBYOP

2 years ago

and the url that I use is redis_url


2 years ago

redis needs to be in the same project


nexblu
HOBBYOP

2 years ago

left is redis right is flask, is this wrong sir?

1280342951079317586


2 years ago

before we continue, please carefully read this page so that you can understand the correct terminology -


nexblu
HOBBYOP

2 years ago

okey sir


nexblu
HOBBYOP

2 years ago

excuse me sir, I have put it together, and the API is working, but after some time the background task that I created doesn't work, but locally it works fine, how can I see the Redis log?

1280384814587052052


2 years ago

where is the worker service?


2 years ago

have you read the basics page?


nexblu
HOBBYOP

2 years ago

I only read what I think I understand, in Redis there are variables like in the documentation, the contents are redis_url I use that in production


2 years ago

please read the entire page


nexblu
HOBBYOP

2 years ago

this might be the log but i can only see this

1280385702395383950


2 years ago

please read the basics page before we continue, it is a necessary read so that we can communicate with the correct terminology


nexblu
HOBBYOP

2 years ago

sorry sir Sorry sir, if it's like this, what's the cause, sir?

1280404563840733235


Welcome!

Sign in to your Railway account to join the conversation.

Loading...