Post requests aren't received

Morning guys, i have a really bad issue that keeps me away from using my app. I have a flask web server with a callback function that needs to process a post request and send message in a telegram chat. The problem is that the webserver receives get requests, but post requests made by another website arent received and i cant see them not in the logs, neither in the chat. Do you know maybe what can the problem be? On localhost it works just fine, but when i deploy it this problem appears... The post requests are made from pubsubhubbub with xml content, do you know what might be the problem? Thank you
32 Replies
Percy
Percy17mo ago
Project ID: d43e2a8d-01ab-49aa-94c5-d7cd0c9058d6
EvilPanda
EvilPandaOP17mo ago
d43e2a8d-01ab-49aa-94c5-d7cd0c9058d6 up up
Brody
Brody17mo ago
the bumps are not needed, this is community help and people will come to help if and when they want with that said, make sure you are using https when calling your endpoints
EvilPanda
EvilPandaOP17mo ago
Another website is calling the post endpoint, so i believe it uses https
Brody
Brody17mo ago
please make sure the requests are made as https
EvilPanda
EvilPandaOP17mo ago
* Serving Flask app 'callback_server' * Debug mode: off WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on all addresses (0.0.0.0) * Running on https://127.0.0.1:443 * Running on https://172.17.1.24:443 Press CTRL+C to quit Now the server doesnt respond to the endpoint at all
Brody
Brody17mo ago
i did not say to run the server in https mode you need to be using gunicorn
EvilPanda
EvilPandaOP17mo ago
[2023-07-28 16:34:04 +0000] [1] [INFO] Starting gunicorn 21.2.0 [2023-07-28 16:34:04 +0000] [1] [INFO] Listening at: http://0.0.0.0:443 (1) [2023-07-28 16:34:04 +0000] [1] [INFO] Using worker: sync [2023-07-28 16:34:04 +0000] [7] [INFO] Booting worker with pid: 7 Still nothing server started but it doesnt register any calls
Brody
Brody17mo ago
do not specify a port in the gunicorn start command
EvilPanda
EvilPandaOP17mo ago
this is the starting command gunicorn --bind 0.0.0.0 callback_server:gunicorn_app Now the server doesnt run at all, [2023-07-28 16:38:24 +0000] [1] [INFO] Starting gunicorn 21.2.0 [2023-07-28 16:38:24 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000/ (1) [2023-07-28 16:38:24 +0000] [1] [INFO] Using worker: sync [2023-07-28 16:38:24 +0000] [7] [INFO] Booting worker with pid: 7 this is the starting command gunicorn --bind 0.0.0.0 callback_server:gunicorn_app
Brody
Brody17mo ago
remove the bind and remove the PORT from your service variables
EvilPanda
EvilPandaOP17mo ago
only --bind or along with the ip?
Brody
Brody17mo ago
yes 0.0.0.0 too
EvilPanda
EvilPandaOP17mo ago
[2023-07-28 16:43:33 +0000] [1] [INFO] Starting gunicorn 21.2.0 [2023-07-28 16:43:33 +0000] [1] [INFO] Listening at: http://0.0.0.0:7270 (1) [2023-07-28 16:43:33 +0000] [1] [INFO] Using worker: sync [2023-07-28 16:43:33 +0000] [7] [INFO] Booting worker with pid: 7 Running but doesnt return anything Not for get neither for post
Brody
Brody17mo ago
make sure you are calling the domain with https
EvilPanda
EvilPandaOP17mo ago
with https i get the status 200 for the endpoint, but in the logs i dont see what it returns
Brody
Brody17mo ago
if you want access logs you need to enable access logs with gunicorn
EvilPanda
EvilPandaOP17mo ago
So, with the logs enabled i see again only get requests, it doesnt want to process posst requests :\
Brody
Brody17mo ago
once again, make requests with https
EvilPanda
EvilPandaOP17mo ago
This website is making the requests https://pubsubhubbub.appspot.com/ not me i subsscribe it to my endpoint in order to send youtube feed
Brody
Brody17mo ago
the website needs to make https requests, please show me a screenshot of the network request in the browsers dev tools
EvilPanda
EvilPandaOP17mo ago
i cant see the request made from the website to another website this website subscribes to my endpoint and to youtube, when youtube has changes it sends them to my endpoint
Brody
Brody17mo ago
is the request not done by the web page?
EvilPanda
EvilPandaOP17mo ago
its made by the webpage but i dont need to be on it while it does it i just subscribe the website only once
Brody
Brody17mo ago
ah the backend is making the requets
Brody
Brody17mo ago
well you need to find a way to get this site to use https when making the requests, this is not an issue with railway
EvilPanda
EvilPandaOP17mo ago
but i can not redirect http requests to https? to be sure that this is the problem
Brody
Brody17mo ago
railway does not allow you to do that, that would be insecure, you must always use https
EvilPanda
EvilPandaOP17mo ago
oh.. so i will stich than with localhosting thank you
Brody
Brody17mo ago
no problem
WavyBoyJodii
WavyBoyJodii14mo ago
i had this same problem as i was running tests via postman for my backend api i deployed on railway. no POST requests went through, after tacking on https:// ALL IS SOLVED thank you guys
Want results from more Discord servers?
Add your server