R
Railway•15mo ago
Ruu3f

Flask app not running on the Railway domain

I know it can be the problem that I am bad at coding, but asking for help is a thing soo.... Error:
* Serving Flask app 'main'
* Debug mode: off
Name or service not known
* Serving Flask app 'main'
* Debug mode: off
Name or service not known
Code used to run the app:
app.run(host="0.0.0.0:$PORT")
app.run(host="0.0.0.0:$PORT")
59 Replies
Percy
Percy•15mo ago
Project ID: N/A
Ruu3f
Ruu3f•15mo ago
1110989921826656306
Brody
Brody•15mo ago
do you have a repo i could look at?
Ruu3f
Ruu3f•15mo ago
yes i do. may i send you the files in DMs?
Brody
Brody•15mo ago
no thank you
Ruu3f
Ruu3f•15mo ago
okay then?
Brody
Brody•15mo ago
please send a link to your repo here
Ruu3f
Ruu3f•15mo ago
okay, its private though. Let me make it public https://github.com/.../... thank you by the way.
Brody
Brody•15mo ago
im sorry but this repo breaks railways tos, twice. freeGPT, duckduckgo-search both of these packages scrape data from the service unofficially
Ruu3f
Ruu3f•15mo ago
okay i tried using duckduckgo's official JSON API but it did not work quite well
Brody
Brody•15mo ago
duckduck go no longer has an offical json api afaik one sec tho, i will provide alternatives for you
Brody
Brody•15mo ago
thats not a full search api btw
Ruu3f
Ruu3f•15mo ago
Yeah, that was the problem and I switched to duckduckgo-search wait, are online APIs allowed?
Brody
Brody•15mo ago
use this flask template https://github.com/railwayapp-templates/flask for search, google has a full search api, and they have a python package to use it https://developers.google.com/custom-search/v1/introduction for chatgpt, use openai's official package https://pypi.org/project/openai/ explain what you mean by online
Ruu3f
Ruu3f•15mo ago
but openai's official package is not free 😦 btw thanks a lot for your time and advice!
Brody
Brody•15mo ago
correct it is not entirely free, you do get 5$ from them though but yeah you need to be using official apis for the services you are using, both those packages do not use official apis
Ruu3f
Ruu3f•15mo ago
can I use alternative APIs that give GPT for free? as a normal discord guy, i'm broke 💀
Brody
Brody•15mo ago
absolutely not, that would break both openai's tos and thus railway's tos you need to be using official apis, with your own api keys
Ruu3f
Ruu3f•15mo ago
okay fine i guess
Brody
Brody•15mo ago
anything else is a big no no, and ive seen that it could result in a ban from railway
Ruu3f
Ruu3f•15mo ago
hey but you did not give me a fix to this problem 😦
Brody
Brody•15mo ago
yes i did ^
Ruu3f
Ruu3f•15mo ago
i used the flask template from railway
Brody
Brody•15mo ago
no you didnt
Ruu3f
Ruu3f•15mo ago
hmm wait oh yeah, i did now
Brody
Brody•15mo ago
can i have some reassurance that you will stop using those two packages, i really dont want you to randomly have your account banned
Ruu3f
Ruu3f•15mo ago
i will not use both of those.
Brody
Brody•15mo ago
and you understand why you cant use packages like those?
Ruu3f
Ruu3f•15mo ago
yeah, railway does not allow them since they are not original i understand.
Brody
Brody•15mo ago
perfect, thank you so much for understanding
Ruu3f
Ruu3f•15mo ago
i will change them, just let me try and run the flask app if it works now
Brody
Brody•15mo ago
you can fork railway's flask app then use that as a starting point
Ruu3f
Ruu3f•15mo ago
yeah, i started from it and then.. got lost now i fixed my code, it should work thank you for your time and assistance btw
Brody
Brody•15mo ago
happy to help
Ruu3f
Ruu3f•15mo ago
https://bot-production-3713.up.railway.app/ it does not work still ;-; its not even giving me a error now
Brody
Brody•15mo ago
can i see your repo that you deployed that from?
Ruu3f
Ruu3f•15mo ago
nevermind, i found the error Looks like your app is listening on 127.0.0.1. You may need to listen on 0.0.0.0 instead. yeah this
Brody
Brody•15mo ago
you must not be using gunicorn
Ruu3f
Ruu3f•15mo ago
what is that, i've not even heard about it
Brody
Brody•15mo ago
please use the railway flask template
Ruu3f
Ruu3f•15mo ago
yeah.... i am using it ;-;
Brody
Brody•15mo ago
you are not
Ruu3f
Ruu3f•15mo ago
the repository is still public, may you please check it?
Brody
Brody•15mo ago
send it
Ruu3f
Ruu3f•15mo ago
GitHub
GitHub - ruu3f-studio/RSearchX
Contribute to ruu3f-studio/RSearchX development by creating an account on GitHub.
Brody
Brody•15mo ago
this is not a fork of the railway flask template and it still uses those two packages
Ruu3f
Ruu3f•15mo ago
yeah, i will remove those two later I used the 'Flask' template when making my railway app and then i added my code to it
Brody
Brody•15mo ago
lets start fresh with forking the railway flask template please, we dont want to continue using this repo
Ruu3f
Ruu3f•15mo ago
okay. give me a minute.
Ruu3f
Ruu3f•15mo ago
Okay, i deleted the repository and created a new one with the original flask template: https://github.com/ruu3f-studio/RSearchX
GitHub
GitHub - ruu3f-studio/RSearchX
Contribute to ruu3f-studio/RSearchX development by creating an account on GitHub.
Brody
Brody•15mo ago
perfect! that will work on railway
Ruu3f
Ruu3f•15mo ago
okay, so i will start adding my code without those two libraries thanks!
Brody
Brody•15mo ago
keep the routes at the root level, before you had them in a function and dont touch the procfile
Ruu3f
Ruu3f•15mo ago
yeah, i wont
Brody
Brody•15mo ago
perfect, and you can use those two alternatives i linked to achieve the same functionality as your old app had, just this time it wont break tos 🙂
Ruu3f
Ruu3f•15mo ago
thanks!
Brody
Brody•15mo ago
no problem, if you run into any troubles with railway feel free to come ask
Ruu3f
Ruu3f•15mo ago
okay.