Skip to content

Schema-Registry client badly formed hexadecimal UUID string #2098

@pbabics

Description

@pbabics

Hello we've seen this error when using sync schema registry to encode messages into avro

	File "/e2e/utils/kafka/avro.py", line 43, in __call__
		return encoder(message, {})
	File "/.venv/lib/python3.13/site-packages/confluent_kafka/schema_registry/_sync/avro.py", line 290, in __call__
		return self.__serialize(obj, ctx)
					 ~~~~~~~~~~~~~~~~^^^^^^^^^^
	File "/.venv/lib/python3.13/site-packages/confluent_kafka/schema_registry/_sync/avro.py", line 327, in __serialize
		self._schema_id = SchemaId(AVRO_TYPE, registered_schema.schema_id, registered_schema.guid)
											~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	File "/.venv/lib/python3.13/site-packages/confluent_kafka/schema_registry/common/serde.py", line 336, in __init__
		self.guid = uuid.UUID(guid) if guid is not None else None
								~~~~~~~~~^^^^^^
	File "/.local/share/uv/python/cpython-3.13.7-linux-x86_64-gnu/lib/python3.13/uuid.py", line 181, in __init__
		raise ValueError('badly formed hexadecimal UUID string')
ValueError: badly formed hexadecimal UUID string

It is caused by the order of arguments used here - https://github.com/confluentinc/confluent-kafka-python/blob/master/src/confluent_kafka/schema_registry/_async/schema_registry_client.py#L670

which does not match the semantics of the class it creates here
https://github.com/confluentinc/confluent-kafka-python/blame/master/src/confluent_kafka/schema_registry/common/schema_registry_client.py#L937

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReporting an unexpected or problematic behavior of the codebasecomponent:schema-registryAny schema registry related isues rather than kafka isolated onespriority:highMaintainer triage tag for indicating high impact or criticality issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions