Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request location prices error: invalid response #95

Open
tgamauf opened this issue May 1, 2022 · 0 comments
Open

Request location prices error: invalid response #95

tgamauf opened this issue May 1, 2022 · 0 comments
Labels
analyze Potential bug needs to be analyzed

Comments

@tgamauf
Copy link
Owner

tgamauf commented May 1, 2022

A couple of calls to request_location_prices calls failed in an ~2h window around 27.4.22 17:18 with the following error:

Expecting value: line 1 column 1 (char 0) : Traceback (most recent call last):
File "/home/app/web/.local/lib/python3.9/site-packages/django_q/cluster.py", line 432, in worker
res = f(*task["args"], **task["kwargs"])
File "/home/app/web/spritstat/services/price.py", line 114, in request_location_prices
prices = _request_prices(url)
File "/home/app/web/spritstat/services/price.py", line 136, in _request_prices
json_data = _execute_api_request(url)
File "/home/app/web/spritstat/services/price.py", line 157, in _execute_api_request
json_error = json.loads(r.data.decode("utf-8"))
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

As this was an ephemeral error it is most likely caused by an server error, but needs investigation.

@tgamauf tgamauf added the analyze Potential bug needs to be analyzed label May 1, 2022
tgamauf added a commit that referenced this issue May 1, 2022
* Fix invalid calls to calculate user statistics errors (actually
  this was only a change in the database, this fix only fixes the
  migration that added the calls)
* Add logging of the server response for location requests to help
  analyze issue #95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyze Potential bug needs to be analyzed
Projects
None yet
Development

No branches or pull requests

1 participant