Project instance running twice
lightningrod6
PROOP

2 years ago

Having an issue where my project is running twice. I've ran it on my computer and it runs once. Dont know what to do from here

Closed

50 Replies

2 years ago

what makes you think it's running twice?


lightningrod6
PROOP

2 years ago

8d69af02-8b2e-4480-ab5e-c0ac7c80ebd6


lightningrod6
PROOP

2 years ago

I'm not sure. I've disabled private networking but that didn't solve it


2 years ago

where does private networking come into this issue?


lightningrod6
PROOP

2 years ago

I dont know I just thought It would fix something. Again I've ran the code on my computer and it ran once


2 years ago

what makes you think it's running twice on railway?


lightningrod6
PROOP

2 years ago

Like I said I don't know. Thats why I am asking for help


2 years ago

I'm not sure what I can do for you here if you don't know what the issue is


lightningrod6
PROOP

2 years ago

The issue is that its starting twice. I'm not sure what else you want me to say?


2 years ago

what makes you think it's starting twice?


lightningrod6
PROOP

2 years ago

Railway thats what


2 years ago

what about railway?


lightningrod6
PROOP

2 years ago

Idk what do you want me to say if you're just gonna keep asking me the same question when I am giving you an answer


2 years ago

you are not answering the question, you claim it's running twice, what has made you come to that conclusion?


lightningrod6
PROOP

2 years ago

It keeps logging on to discord twice


lightningrod6
PROOP

2 years ago

It as in my bot


2 years ago

are there anything in the logs that would indicate it's running twice


lightningrod6
PROOP

2 years ago

Didn't understand the question earlier sorry about that. But yeah, heres the instance logging in twice in railway

1232872281387044895


2 years ago

are you running two replicas?


lightningrod6
PROOP

2 years ago

No


2 years ago

do you know what a replica is?


lightningrod6
PROOP

2 years ago

Yeah this

1232873035313451038


2 years ago

are you using nixpacks or a dockerfile


lightningrod6
PROOP

2 years ago

It is using nixpacks as the default


2 years ago

build logs please -


lightningrod6
PROOP

2 years ago


2 years ago

deploy logs please


lightningrod6
PROOP

2 years ago


2 years ago

how do you start the bot locally


lightningrod6
PROOP

2 years ago

Just running python3 main.py


2 years ago

send the main.py file


lightningrod6
PROOP

2 years ago

Alright, just hope you are ready for the spaghetti mess I call code

1232875602105602130


lightningrod6
PROOP

2 years ago

Oh shit


2 years ago

youre running a flask app that is starting two processes, thus starting two bots


lightningrod6
PROOP

2 years ago

That was the dev code but its the same


lightningrod6
PROOP

2 years ago

Alright Ill try to find a work around


2 years ago

you where using environment variables for the discord token, do the same for the database too haha


lightningrod6
PROOP

2 years ago

Oh shoot


lightningrod6
PROOP

2 years ago

Yeah I guess I exposed my self there too


2 years ago

you will also need to be using gunicorn for a flask app, but you still need to fix the underlying code issue first


lightningrod6
PROOP

2 years ago

Gunicorn?


2 years ago

yes


2 years ago

you are currently running flask in development mode, and while thats not the main issue, it is still an issue


lightningrod6
PROOP

2 years ago

My problem has been fixed.


lightningrod6
PROOP

2 years ago

Thank you so much and sorry for not understanding the question earlier


2 years ago

make sure you are now using gunicorn too


2 years ago

as your logs have said -

WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

lightningrod6
PROOP

2 years ago

Yeah I am


lightningrod6
PROOP

2 years ago

Alright got no other questions


2 years ago

sounds good


Welcome!

Sign in to your Railway account to join the conversation.

Loading...