R
Railway17mo ago
inotmad

aiohttp complaining about BadStatusLine in private network

have an aiohttp server running on host ::0.0.0.0 and port 8080. sending a post to the server on the link https://discorsa-bot.railway.internal:8080/lap but i get this on the server:
2023-07-11 17:03:27 ERROR aiohttp.server Error handling request
Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 332, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"

2023-07-11 17:03:27 INFO aiohttp.access fd12:5b68:5300::2f:ca0f:e290 [11/Jul/2023:17:03:27 +0000] "UNKNOWN / HTTP/1.0" 400 204 "-" "-"
2023-07-11 17:03:27 ERROR aiohttp.server Error handling request
Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 332, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"

2023-07-11 17:03:27 INFO aiohttp.access fd12:5b68:5300::2f:ca0f:e290 [11/Jul/2023:17:03:27 +0000] "UNKNOWN / HTTP/1.0" 400 204 "-" "-"
ive tried running this server on my local machine using host 0.0.0.0 and port 8080 and it works fine so that leads me to believe it definitely has something to do with private networking if i dont add the port in the link i noticed the port it sends to is different from the port that server gets from env variables so i just defined it as 8080 and added that to the link as well pls help? project ID: 45ce4783-9560-4cd6-9fe7-8982bd5ab434
Solution:
this is an internal network, and internally your apps are running on http, thus your internal requests have to be done with http too
Jump to solution
6 Replies
Percy
Percy17mo ago
Project ID: 45ce4783-9560-4cd6-9fe7-8982bd5ab434
Solution
Brody
Brody17mo ago
this is an internal network, and internally your apps are running on http, thus your internal requests have to be done with http too
inotmad
inotmadOP17mo ago
I did do that in the start Wasnt working but i dont remember all the changes i made in trying to figure out what the problem is. Ill try using http again
Brody
Brody17mo ago
let me know how that goes, because either way you need to be using http for internal requests
inotmad
inotmadOP17mo ago
oh it did work well dam ill keep this open till im 100% sure its solved ig ty tho
Brody
Brody17mo ago
haha no problem
Want results from more Discord servers?
Add your server