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

Clicking on a chart causes an error in logs: ERROR:superset.utils.json:JSON is not valid (4.1.0rc2) #30079

Closed
3 tasks done
sfirke opened this issue Aug 30, 2024 · 1 comment · Fixed by #30138
Closed
3 tasks done
Assignees
Labels
global:error Related to global errors affecting the platform

Comments

@sfirke
Copy link
Member

sfirke commented Aug 30, 2024

Bug description

I am seeing this error often in the logs as I demo 4.1.0rc2. One way I can produce it is by navigating to the Charts list, then clicking on a chart. Same for Dashboards. When I do that I get:

superset_app          | 2024-08-30 21:02:54,015:ERROR:superset.utils.json:JSON is not valid Expecting value: line 1 column 1 (char 0)
superset_app          | Traceback (most recent call last):
superset_app          |   File "/app/superset/utils/json.py", line 244, in loads
superset_app          |     return simplejson.loads(
superset_app          |   File "/usr/local/lib/python3.10/site-packages/simplejson/__init__.py", line 514, in loads
superset_app          |     return _default_decoder.decode(s)
superset_app          |   File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 386, in decode
superset_app          |     obj, end = self.raw_decode(s)
superset_app          |   File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 416, in raw_decode
superset_app          |     return self.scan_once(s, idx=_w(s, idx).end())
superset_app          | simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The chart edit view loads correctly, I don't see a way in which this is causing problems but it is spamming the logs.

How to reproduce the bug

  1. Load the list of charts or dashboards
  2. Click one of them

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

I don't know

Node version

I don't know

Browser

Firefox

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added the global:error Related to global errors affecting the platform label Aug 30, 2024
@deuspt
Copy link

deuspt commented Sep 1, 2024

Seems related with cache interaction, I see such errors following retrieval attempts e.g.:
(... are just omitted similar log lines, for simplicity)

...
2024-09-01 17:33:40,365:INFO:superset.utils.screenshots:Attempting to get from cache: 1f1bbb3875c6c4b245734da15a366917
...
2024-09-01 17:33:40,446:INFO:superset.utils.screenshots:Attempting to get from cache: 9ac7aac76755e14d175d865d1cedcd3c
2024-09-01 17:34:11,728:ERROR:superset.utils.json:JSON is not valid Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/app/superset/utils/json.py", line 244, in loads
    return simplejson.loads(
  File "/usr/local/lib/python3.10/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-09-01 17:34:11,786:INFO:superset.viz:Cache key: c11beccf261da40e33f4c680892375ea
2024-09-01 17:34:11,789:ERROR:superset.utils.json:JSON is not valid Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/app/superset/utils/json.py", line 244, in loads
    return simplejson.loads(
  File "/usr/local/lib/python3.10/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-09-01 17:34:11,811:WARNING:superset.views.base:Superset.explore_json This API endpoint is deprecated and will be removed in version 5.0.0
2024-09-01 17:34:11,812:ERROR:superset.utils.json:JSON is not valid Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/app/superset/utils/json.py", line 244, in loads
    return simplejson.loads(
  File "/usr/local/lib/python3.10/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-09-01 17:34:11,942:INFO:superset.viz:Cache key: 5d5c68a6a844ad9a2240ff187701bb5a
2024-09-01 17:34:12,601:WARNING:superset.models.helpers:Unable to parse SQL to format it, passing it as-is
2024-09-01 17:34:12,748:ERROR:superset.utils.json:JSON is not valid Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/app/superset/utils/json.py", line 244, in loads
    return simplejson.loads(
  File "/usr/local/lib/python3.10/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
...

There's also the SQL parsing warning, which may be unrelated.
Besides log pollution with these exceptions, the cache failures also lead to increasing number of requests to Celery workers in order to regenerate thumbnails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
global:error Related to global errors affecting the platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants