Project instance running twice

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
Solution:
youre running a flask app that is starting two processes, thus starting two bots
Jump to solution
42 Replies
Percy
Percy8mo ago
Project ID: 8d69af02-8b2e-4480-ab5e-c0ac7c80ebd6
Brody
Brody8mo ago
what makes you think it's running twice?
Lightning
LightningOP8mo ago
8d69af02-8b2e-4480-ab5e-c0ac7c80ebd6 I'm not sure. I've disabled private networking but that didn't solve it
Brody
Brody8mo ago
where does private networking come into this issue?
Lightning
LightningOP8mo ago
I dont know I just thought It would fix something. Again I've ran the code on my computer and it ran once
Brody
Brody8mo ago
what makes you think it's running twice on railway?
Lightning
LightningOP8mo ago
Like I said I don't know. Thats why I am asking for help
Brody
Brody8mo ago
I'm not sure what I can do for you here if you don't know what the issue is
Lightning
LightningOP8mo ago
The issue is that its starting twice. I'm not sure what else you want me to say?
Brody
Brody8mo ago
what makes you think it's starting twice?
Lightning
LightningOP8mo ago
Railway thats what
Brody
Brody8mo ago
what about railway?
Lightning
LightningOP8mo 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
Brody
Brody8mo ago
you are not answering the question, you claim it's running twice, what has made you come to that conclusion?
Lightning
LightningOP8mo ago
It keeps logging on to discord twice It as in my bot
Brody
Brody8mo ago
are there anything in the logs that would indicate it's running twice
Lightning
LightningOP8mo ago
Didn't understand the question earlier sorry about that. But yeah, heres the instance logging in twice in railway
No description
Brody
Brody8mo ago
are you running two replicas?
Lightning
LightningOP8mo ago
No
Brody
Brody8mo ago
do you know what a replica is?
Lightning
LightningOP8mo ago
Yeah this
No description
Brody
Brody8mo ago
are you using nixpacks or a dockerfile
Lightning
LightningOP8mo ago
It is using nixpacks as the default
Brody
Brody8mo ago
deploy logs please
Brody
Brody8mo ago
how do you start the bot locally
Lightning
LightningOP8mo ago
Just running python3 main.py
Brody
Brody8mo ago
send the main.py file
Lightning
LightningOP8mo ago
Oh shit
Solution
Brody
Brody8mo ago
youre running a flask app that is starting two processes, thus starting two bots
Lightning
LightningOP8mo ago
That was the dev code but its the same Alright Ill try to find a work around
Brody
Brody8mo ago
you where using environment variables for the discord token, do the same for the database too haha
Lightning
LightningOP8mo ago
Oh shoot Yeah I guess I exposed my self there too
Brody
Brody8mo ago
you will also need to be using gunicorn for a flask app, but you still need to fix the underlying code issue first
Lightning
LightningOP8mo ago
Gunicorn?
Brody
Brody8mo ago
yes you are currently running flask in development mode, and while thats not the main issue, it is still an issue
Lightning
LightningOP8mo ago
My problem has been fixed. Thank you so much and sorry for not understanding the question earlier
Brody
Brody8mo ago
make sure you are now using gunicorn too 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.
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
Lightning
LightningOP8mo ago
Yeah I am Alright got no other questions
Brody
Brody8mo ago
sounds good
Want results from more Discord servers?
Add your server