Top-gg-Community / python-sdk

A simple API wrapper for top.gg written in Python
https://docs.top.gg/docs/Libraries/python
MIT License
91 stars 54 forks source link

Topgg 'Error handling request' issue #72

Open Splashtair opened 2 years ago

Splashtair commented 2 years ago

This issue tracker is ONLY used for reporting bugs with topggpy. Feel free to share your suggestions in the #api channel in our Discord server!

For help with general Python issues, use StackOverflow, our #development channel, or the Python Discord server.

Expected Behavior

Shouldn't post this error:

Error handling request
Traceback (most recent call last):
File "/root/Senpai/venv/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 314, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 546, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'invalid HTTP method'"

Current Behavior

Posts this error:

Error handling request
Traceback (most recent call last):
File "/root/Senpai/venv/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 314, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 546, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'invalid HTTP method'"

Development Environment

Python v3.8.10 Topggpy v1.4.0 OS is Linux

Steps to Reproduce

  1. Post your server count to top.gg
  2. Wait the X amount u set
  3. Error should post when posting server count

Context

My logs are spammed with this error and sometimes crashes it seems like

Possible Solution

Detailed Description

Possible Implementation

Esmeray6 commented 1 year ago

Fun fact, no one figured out the cause (as far as I am aware, at least).

This Reddit post gets into the causes of this error, although it is weird that a random request (one that does not use an appropriate HTTP method) manages to reach web servers (yes, web servers) you, a Top.gg user, list in webhook URL settings. However, as a rule of thumb, such requests can be ignored.

Esmeray6 commented 3 months ago

@null8626 Look into this, perhaps? Neither nori nor I figured out the reason (or, rather, never really bothered) and simply stuck with telling people to ignore it.

Could use an error handler that checks for this specific case.

Esmeray6 commented 3 months ago

Alternatively, this issue can be closed.

null8626 commented 3 months ago

I'll look into this later.