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.

Error Timeout trying to lock table with apicurio-registry-mem and Confluent serializer

See original GitHub issue

Hi, I’m using the docker container quay.io/apicurio/apicurio-registry-mem:2.2.5.Final in my integration tests with Confluent serializers. It sometimes, but not always, fails with a Timeout trying to lock table exception.

Complete stacktrace :

 org.apache.kafka.common.errors.SerializationException: Error registering Avro schema{"type":"record","name":"Trace","namespace":"com.decathlon.vct.vcstream.avro.trace","doc":"All terminal components (sender, listener, anomaly) will send this trace object to the tracing system with the exchange information","fields":[{"name":"component","type":[{"type":"string","avro.java.string":"String"}],"doc":"Component that initiated the Trace","default":"missing-component"},{"name":"type","type":{"type":"string","avro.java.string":"String"},"doc":"Data type of the message","default":"missing-trace-type"},{"name":"direction","type":{"type":"enum","name":"Direction","symbols":["INBOUND","OUTBOUND"]},"doc":"Inbound or Outbound"},{"name":"startTime","type":["null","long"],"default":null},{"name":"uuid","type":{"type":"string","avro.java.string":"String"},"doc":"UUID of the message","default":"missing-trace-uuid"},{"name":"dispatchCriteria","type":["null",{"type":"string","avro.java.string":"String"}],"doc":"Dispatch criteria of the message","default":null},{"name":"reason","type":["null",{"type":"string","avro.java.string":"String"}],"doc":"Deprecated - Remove it break FORWARD Compatibility","default":null},{"name":"duration","type":["null","long"],"default":null},{"name":"endTime","type":["null","long"],"default":null},{"name":"batchId","type":["null",{"type":"string","avro.java.string":"String"}],"doc":"Batch id of the message","default":null},{"name":"status","type":{"type":"enum","name":"TraceStatus","symbols":["OK","ERROR"]},"default":"ERROR"}],"version":5}
        at io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe.toKafkaException(AbstractKafkaSchemaSerDe.java:259)
        at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:168)
        at io.confluent.kafka.serializers.KafkaAvroSerializer.serialize(KafkaAvroSerializer.java:61)
        at org.apache.kafka.common.serialization.Serializer.serialize(Serializer.java:62)
        at io.smallrye.reactive.messaging.kafka.fault.SerializerWrapper.lambda$serialize$1(SerializerWrapper.java:56)
        at io.smallrye.reactive.messaging.kafka.fault.SerializerWrapper.wrapSerialize(SerializerWrapper.java:81)
        at io.smallrye.reactive.messaging.kafka.fault.SerializerWrapper.serialize(SerializerWrapper.java:56)
        at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:945)
        at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:905)
        at io.smallrye.reactive.messaging.kafka.impl.ReactiveKafkaProducer.lambda$send$5(ReactiveKafkaProducer.java:127)
        at io.smallrye.context.impl.wrappers.SlowContextualConsumer.accept(SlowContextualConsumer.java:21)
        at io.smallrye.mutiny.operators.uni.builders.UniCreateWithEmitter.subscribe(UniCreateWithEmitter.java:22)
        at io.smallrye.mutiny.operators.AbstractUni.subscribe(AbstractUni.java:36)
        at io.smallrye.mutiny.operators.uni.UniRunSubscribeOn.lambda$subscribe$0(UniRunSubscribeOn.java:27)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: io.apicurio.registry.storage.impl.sql.jdb.RuntimeSqlException: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table ; SQL statement:
INSERT INTO sequences (tenantId, name, value) VALUES (?, ?, ?) [50200-197]; error code: 0
        at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:301)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:371)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:548)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:536)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:494)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:274)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:381)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:354)
        at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:125)
        ... 15 more

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
carlesarnalcommented, Nov 14, 2022

Agreed, we’re not only creating a native version now, but also the h2 version has been significantly updated (from 1.4.x to 2.x) so worth trying. @loicmathieu do you mind trying on your side?

Thanks!

0reactions
EricWittmanncommented, Nov 11, 2022

One bit of news that is possibly unrelated. We have improved the in-memory version of registry that is used as part of dev mode. We are now creating a native version. This should improve startup time drastically, but I’m not sure if it will have any impact on this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Timeout error trying to lock table in h2 - Stack Overflow
Yes, you can change the lock timeout. The default is relatively low: 1 second (1000 ms). In many cases the problem is that...
Read more >
"Timeout trying to lock table" when creating new user #12609
Describe the bug Running docker container with default h2 database. I invited two users before I had SMTP settings correct; as a result...
Read more >
Troubleshooting Control Center | Confluent Documentation
If Control Center doesn't launch, try the suggestions below to troubleshoot: ... Check the Kafka broker logs and look for timeouts or other...
Read more >
Timeout trying to lock table - Google Groups
We are getting Timeout trying to lock table error in the h2 database. ... Table.validateConvertUpdateSequence(Table.java:679) org.h2.command.dml.Insert.
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