redis railway

nexbluHOBBY

10 months ago

i am getting error on my flask app

0 Replies

nexbluHOBBY

10 months ago

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


nexbluHOBBY

10 months ago

and finally i get error


nexbluHOBBY

10 months ago

yaml [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


nexbluHOBBY

10 months ago

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

this is my Procfile code


10 months 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.


nexbluHOBBY

10 months ago

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

1280340482907443200


10 months ago

you mean one for flask and one for celery


10 months ago

please see my second point


nexbluHOBBY

10 months ago

yes


nexbluHOBBY

10 months ago

okey wait


10 months ago

in don't see redis here?


nexbluHOBBY

10 months 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"


10 months ago

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


nexbluHOBBY

10 months ago

I have redis directly from railway

1280342028886212600


nexbluHOBBY

10 months ago

and the url that I use is redis_url


10 months ago

redis needs to be in the same project


nexbluHOBBY

10 months ago

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

1280342951079317500


10 months ago

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


nexbluHOBBY

10 months ago

okey sir


nexbluHOBBY

10 months 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?

1280384814587052000


10 months ago

where is the worker service?


10 months ago

have you read the basics page?


nexbluHOBBY

10 months 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


10 months ago

please read the entire page


nexbluHOBBY

10 months ago

this might be the log but i can only see this

1280385702395384000


10 months ago

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


nexbluHOBBY

10 months ago

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

1280404563840733200