Hi Rob, Have you tried to use `pulsar-admin schemas` to retrieve the schema info? If so, can you provide the output?
Thanks, Sijie On Tue, Oct 27, 2020 at 3:59 PM Rob Shepherd <rgsheph...@gmail.com> wrote: > Hi, > > I'm wondering what the issue or circumstance is to have a pulsar consumer > failing with a null schema? > > See messages and stacktraces below. > > This system was restarted from an update of application code unrelated to > pulsar handling, and has two consumers. > > At first both consumers were failing but after a restart one is OK and the > other continues to fail. > > I will try restarting again, but i'd like to know how the connected > consumer can encounter a null schema? > > I can see the schemas using pulsar-admin, and they look exactly as they > should, and the producers are tied to the same. > > Any insights appreciated. > > with thanks > > consumerIngressV1 = > pulsarClient.newConsumer(AvroSchema.of(IngressMessageV1.class)) >> .subscriptionName(subscriptionName) >> .topic(topics) >> .subscribe(); >> >> > > 2020-10-27 22:48:12,322 [pool-3-thread-8] INFO >> o.a.p.client.impl.schema.AvroSchema - Load schema reader for version(0), >> schema is : , schemaInfo: { >> "name": "", >> "schema": "", >> "type": "NONE", >> "properties": {} >> } -- >> 2020-10-27 22:48:12,323 [pool-3-thread-8] ERROR >> io.pethau.pl.PipelineService - Exception: >> org.apache.pulsar.shade.org.apache.avro.SchemaParseException: Cannot parse >> <null> schema - {} - {} - {} -- >> org.apache.pulsar.shade.com.google.common.util.concurrent.UncheckedExecutionException: >> org.apache.pulsar.shade.org.apache.avro.SchemaParseException: Cannot parse >> <null> schema >> at >> org.apache.pulsar.shade.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2050) >> at >> org.apache.pulsar.shade.com.google.common.cache.LocalCache.get(LocalCache.java:3951) >> at >> org.apache.pulsar.shade.com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3973) >> at >> org.apache.pulsar.shade.com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4957) >> at >> org.apache.pulsar.client.impl.schema.StructSchema.decode(StructSchema.java:107) >> at >> org.apache.pulsar.client.impl.MessageImpl.getValue(MessageImpl.java:293) >> at >> io.pethau.pl.PipelineService.lambda$run$2(PipelineService.java:103) >> at >> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown >> Source) >> at java.base/java.util.concurrent.FutureTask.run(Unknown Source) >> at >> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) >> at >> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) >> at java.base/java.lang.Thread.run(Unknown Source) >> Caused by: org.apache.pulsar.shade.org.apache.avro.SchemaParseException: >> Cannot parse <null> schema >> at >> org.apache.pulsar.shade.org.apache.avro.Schema.parse(Schema.java:1597) >> at >> org.apache.pulsar.shade.org.apache.avro.Schema$Parser.parse(Schema.java:1396) >> at >> org.apache.pulsar.shade.org.apache.avro.Schema$Parser.parse(Schema.java:1384) >> at >> org.apache.pulsar.client.impl.schema.StructSchema.parseAvroSchema(StructSchema.java:182) >> at >> org.apache.pulsar.client.impl.schema.AvroSchema.loadReader(AvroSchema.java:99) >> at >> org.apache.pulsar.client.impl.schema.StructSchema$1.load(StructSchema.java:75) >> at >> org.apache.pulsar.client.impl.schema.StructSchema$1.load(StructSchema.java:72) >> at >> org.apache.pulsar.shade.com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527) >> at >> org.apache.pulsar.shade.com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2276) >> at >> org.apache.pulsar.shade.com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154) >> at >> org.apache.pulsar.shade.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044) >> ... 11 common frames omitted >> > > > Rob Shepherd BEng PhD > >