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

JSONDecodeError when all IDS are duplicated from Ralph #460

Closed
Ian2012 opened this issue Oct 15, 2024 · 0 comments · Fixed by #461
Closed

JSONDecodeError when all IDS are duplicated from Ralph #460

Ian2012 opened this issue Oct 15, 2024 · 0 comments · Fixed by #461

Comments

@Ian2012
Copy link
Contributor

Ian2012 commented Oct 15, 2024

When backfilling tracking logs is common to process already stored tracking logs, if a batch is sent to Ralph and all events are already stored the response is empty and cannot be parsed to JSON, raising a JSONDecodeError and stopping the process.

  File "/openedx/venv/lib/python3.11/site-packages/event_routing_backends/utils/xapi_lrs_client.py", line 75, in bulk_send
    response = self.lrs_client.save_statements(statement_data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/openedx/venv/lib/python3.11/site-packages/tincan/remote_lrs.py", line 234, in save_statements
    id_list = json.loads(lrs_response.data)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pyenv/versions/3.11.8/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pyenv/versions/3.11.8/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pyenv/versions/3.11.8/lib/python3.11/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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant