Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

While passing schema.version from NIFI to hortonworks schema registry: schemaMetadataKey can not be null

Highlighted

While passing schema.version from NIFI to hortonworks schema registry: schemaMetadataKey can not be null

New Contributor

I've integrated Hortonworks Schema Registry with Apache NIFI and things are working fine while reading and writing data with schema registry. When I try to access the older version of schema using schema.version attribute and my compatibility of schema is Forward. I'm getting error:

org.apache.nifi.processor.exception.ProcessException: Failed to retrieve schema with name 'demo_users' and version '1'

at org.apache.nifi.processors.standard.AbstractRecordProcessor$1.process(AbstractRecordProcessor.java:145)

at org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2908)

at org.apache.nifi.processors.standard.AbstractRecordProcessor.onTrigger(AbstractRecordProcessor.java:122)

at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)

at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1165)

at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:203)

at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: org.apache.nifi.schema.access.SchemaNotFoundException: Failed to retrieve schema with name 'demo_users' and version '1'

at org.apache.nifi.schemaregistry.hortonworks.HortonworksSchemaRegistry.handleException(HortonworksSchemaRegistry.java:377)

at org.apache.nifi.schemaregistry.hortonworks.HortonworksSchemaRegistry.retrieveSchemaByName(HortonworksSchemaRegistry.java:274)

at org.apache.nifi.schemaregistry.hortonworks.HortonworksSchemaRegistry.retrieveSchema(HortonworksSchemaRegistry.java:349)

at sun.reflect.GeneratedMethodAccessor496.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:84)

at com.sun.proxy.$Proxy167.retrieveSchema(Unknown Source)

at org.apache.nifi.schema.access.SchemaNamePropertyStrategy.getSchema(SchemaNamePropertyStrategy.java:81)

at org.apache.nifi.serialization.SchemaRegistryService.getSchema(SchemaRegistryService.java:125)

at org.apache.nifi.json.JsonTreeReader.createRecordReader(JsonTreeReader.java:73)

at sun.reflect.GeneratedMethodAccessor498.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:84)

at com.sun.proxy.$Proxy171.createRecordReader(Unknown Source)

at org.apache.nifi.processors.standard.AbstractRecordProcessor$1.process(AbstractRecordProcessor.java:126)

... 13 common frames omitted

Caused by: java.lang.RuntimeException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException: schemaMetadataKey can not be null

at com.hortonworks.registries.schemaregistry.client.SchemaRegistryClient.getSchemaVersionInfo(SchemaRegistryClient.java:637)

at org.apache.nifi.schemaregistry.hortonworks.HortonworksSchemaRegistry.getSchemaVersionInfo(HortonworksSchemaRegistry.java:219)

at org.apache.nifi.schemaregistry.hortonworks.HortonworksSchemaRegistry.retrieveSchemaByName(HortonworksSchemaRegistry.java:262)

... 28 common frames omitted

Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException: schemaMetadataKey can not be null

at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2052)

at com.google.common.cache.LocalCache.get(LocalCache.java:3943)

at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3967)

at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4952)

at com.hortonworks.registries.schemaregistry.cache.SchemaVersionInfoCache.getSchema(SchemaVersionInfoCache.java:103)

at com.hortonworks.registries.schemaregistry.client.SchemaRegistryClient.getSchemaVersionInfo(SchemaRegistryClient.java:633)

... 30 common frames omitted

Caused by: java.lang.NullPointerException: schemaMetadataKey can not be null

at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:900)

at com.hortonworks.registries.schemaregistry.SchemaVersionKey.<init>(SchemaVersionKey.java:47)

at com.hortonworks.registries.schemaregistry.cache.SchemaVersionInfoCache.updateCacheInvalidationEntries(SchemaVersionInfoCache.java:85)

at com.hortonworks.registries.schemaregistry.cache.SchemaVersionInfoCache.access$300(SchemaVersionInfoCache.java:42)

at com.hortonworks.registries.schemaregistry.cache.SchemaVersionInfoCache$1.load(SchemaVersionInfoCache.java:76)

at com.hortonworks.registries.schemaregistry.cache.SchemaVersionInfoCache$1.load(SchemaVersionInfoCache.java:63)

at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)

at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2273)

at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2156)

at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2046)

... 35 common frames omitted