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

API Error handling #578

Open
mikeshultz opened this issue Mar 2, 2021 · 1 comment
Open

API Error handling #578

mikeshultz opened this issue Mar 2, 2021 · 1 comment
Labels
bug Something isn't working as intended

Comments

@mikeshultz
Copy link
Contributor

Token data is stale according to Kay. While investigating this, I saw the following in the logs. Perhaps this is preventing updates of token data.

Traceback (most recent call last):
  File "logic/scripts/update_token_insight.py", line 442, in <module>
    token_stats.compute_ogn_stats()
  File "/app/logic/scripts/token_stats.py", line 280, in compute_ogn_stats
    ogn_staked_data = fetch_onchain_staking_stats_by_duration()
  File "/app/logic/scripts/token_stats.py", line 92, in fetch_onchain_staking_stats_by_duration
    response = raw_json.json()
  File "/app/.heroku/python/lib/python2.7/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/app/.heroku/python/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/app/.heroku/python/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/app/.heroku/python/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

The README has an example for ./logic/scripts/token_stats.py, but that script is not being run with task scheduler on heroku. Not clear yet if that's related.

@mikeshultz mikeshultz added the bug Something isn't working as intended label Mar 2, 2021
@mikeshultz mikeshultz self-assigned this Mar 2, 2021
@mikeshultz mikeshultz changed the title Token data update failure API Error handling Mar 3, 2021
@mikeshultz
Copy link
Contributor Author

Ended up being the analytics API endpoint throwing a 500. These API calls should probably handle without crashing at a minimum. Repurposing this issue.

@mikeshultz mikeshultz removed their assignment Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

1 participant