question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serialization/Deserialization UUID issue

See original GitHub issue

Description: I am using django backend and celery. Redis is the queuing mechanism which we are using to connect both. When Django backend is of version redis-4.3.4 (Kombu stable version) and celery worker code is of version redis-4.4.0rc1 (Kombu alpha version) or vice versa, there is a problem in UUID serialization. When uuid is sent from django backend to redis, it is received as dictionary due to this change. Existing production code may break due to this change if they have redis=* in pip file or when there is a version mismatch between django and celery resulting in

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/db/models/fields/__init__.py", line 2336, in to_python
    return uuid.UUID(**{input_form: value})
  File "/usr/local/lib/python3.8/uuid.py", line 166, in __init__
    hex = hex.replace('urn:', '').replace('uuid:', '')
AttributeError: 'dict' object has no attribute 'replace'

This change versions kombu is not backward compatible. We need to de-serialize a UUID as UUID and not a dictionary

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
thedrowcommented, Aug 25, 2022

The problem with reverting this is that we don’t have a way to identify the object’s type when using the json serializer and therefore when we encounter a UUID object, we get an error since the json module doesn’t know how to serialize it. When deserializing, we need to know to which object we need to convert the value.

I’d like a test case that reproduces this error. I’m also open to suggestions on how to fix this problem.

1reaction
auvipycommented, Nov 27, 2022

@nusnus whenever you have some time

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serializing UUID not working with java 17 (but same ... - GitHub
I'm running into the same issue when trying to serialize java.io.File , even when using a custom FieldSerializer like so:.
Read more >
Cannot deserialize value of type `java.util.UUID` from String
When I am trying to test my post request from Postman I get the following error. JSON parse error: Cannot deserialize value of...
Read more >
UUIDDeserializer (clients 5.3.1-ccs API)
Configure this class. java.util.UUID, deserialize(java.lang.String topic, byte[] data). Deserialize a record value from a byte array into a value or object.
Read more >
UUIDSerializer (kafka 3.1.2 API)
Convert data into a byte array. Specified by: serialize in interface Serializer<UUID>; Parameters: topic - topic associated with data ...
Read more >
Solved - UUID problem in ConfigurationSerializable?
Hello, I solved that problem by converting the list of uuids into a list of ... Where do you call this serialize and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found