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
Project ID:
d43e2a8d-01ab-49aa-94c5-d7cd0c9058d6
d43e2a8d-01ab-49aa-94c5-d7cd0c9058d6
up
up
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
Another website is calling the post endpoint, so i believe it uses https
please make sure the requests are made as https
* 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
i did not say to run the server in https mode
you need to be using gunicorn
[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
do not specify a port in the gunicorn start command
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
remove the bind
and remove the PORT from your service variables
only --bind or along with the ip?
yes 0.0.0.0 too
[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
make sure you are calling the domain with https
with https
i get the status 200 for the endpoint, but in the logs i dont see what it returns
if you want access logs you need to enable access logs with gunicorn
So, with the logs enabled i see again only get requests, it doesnt want to process posst requests :\
once again, make requests with https
This website is making the requests https://pubsubhubbub.appspot.com/ not me
i subsscribe it to my endpoint in order to send youtube feed
the website needs to make https requests, please show me a screenshot of the network request in the browsers dev tools
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
is the request not done by the web page?
its made by the webpage but i dont need to be on it while it does it
i just subscribe the website
only once
ah the backend is making the requets
[28/Jul/2023:16:56:12 +0000] "GET /callback?hub.topic=https://www.youtube.com/xml/feeds/videos.xml%3Fchannel_id%3DUCpBDfwJH-ha6v8bAd7XTUuQ&hub.challenge=16143084626368159845&hub.mode=subscribe&hub.lease_seconds=432000 HTTP/1.1" 200 24 "-" "FeedFetcher-Google; (+http://www.google.com/feedfetcher.html)"
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
but i can not redirect http requests to https?
to be sure that this is the problem
railway does not allow you to do that, that would be insecure, you must always use https
oh.. so i will stich than with localhosting
thank you
no problem
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