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

Canonicaljson dependency fix #4

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

mcalinghee
Copy link

@mcalinghee mcalinghee commented Mar 16, 2023

Fix from : matrix-org#13172

When installing synapse it will bring canonicaljson==2.0.0 and raise the following issue

Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:     _check_size_limits(event)
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:   File "/opt/synapse/env/lib/python3.7/site-packages/synapse/event_auth.py", line 276, in _check_size_limits
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:     if len(encode_canonical_json(event.get_pdu_json())) > MAX_PDU_SIZE:
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:   File "/opt/synapse/env/lib/python3.7/site-packages/canonicaljson/__init__.py", line 84, in encode_canonical_json
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:     s = _canonical_encoder.encode(data)
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:   File "/usr/lib/python3.7/json/encoder.py", line 199, in encode
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:     chunks = self.iterencode(o, _one_shot=True)
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:   File "/usr/lib/python3.7/json/encoder.py", line 257, in iterencode
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:     return _iterencode(o, 0)
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:   File "/opt/synapse/env/lib/python3.7/functools.py", line 827, in wrapper
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:     return dispatch(args[0].__class__)(*args, **kw)
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:   File "/opt/synapse/env/lib/python3.7/site-packages/canonicaljson/__init__.py", line 31, in _preprocess_for_serialisation
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]:     "Object of type %s is not JSON serializable" % obj.__class__.__name__
Mar 15 17:55:41 tchap-agent1 matrix-synapse_event_creator[4864]: TypeError: Object of type frozendict is not JSON serializable


Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Pull request includes a sign off
  • Code style is correct
    (run the linters)

@mcalinghee mcalinghee merged commit 5f282d9 into release-v1.59.x Mar 16, 2023
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 this pull request may close these issues.

1 participant