You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/02/13 11:42:14 UTC
[GitHub] [pulsar] abhilashmandaliya opened a new issue #6321: [ERROR] Failed
at fetching schema info for EMPTY
abhilashmandaliya opened a new issue #6321: [ERROR] Failed at fetching schema info for EMPTY
URL: https://github.com/apache/pulsar/issues/6321
#### The issue
I am building one sink connector on a topic named test-topic with a JSON schema. While checking the schema status via pulsar-admin, it shows the schema but at runtime, it throws an exception.
#### Expected behaviour
Should not throw an exception
#### Actual behavior
Throwing a Serialization exception
#### Steps to reproduce
- Start a pulsar standalone
- Create a file called test-schema.json like follow
```
{
"type": "JSON",
"schema": "{\"name\":\"MyClass\",\"type\":\"record\",\"namespace\":\"com.acme.avro\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"}]}",
"properties": {}
}
```
- Upload a schema using pulsar-admin
- `pulsar-admin schemas upload --filename /usr/local/pulsar/conf/test-schema.json test-topic`
- Verify using pulsar-admin as follow
- `pulsar-admin schemas get test-topic`
which should result into:
```
{
"version": 0,
"schemaInfo": {
"name": "test-topic",
"schema": {
"name": "MyClass",
"type": "record",
"namespace": "com.acme.avro",
"fields": [
{
"name": "name",
"type": "string"
}
]
},
"type": "JSON",
"properties": {}
}
}
```
- Now produce one message using pulsar-client
- `pulsar-client produce -m '{"name":"abc"}' test-topic`
And now in the log, you will see the following exception:
- My log path: `/tmp/functions/public/default/aerospike-test-sink/aerospike-test-sink-0.log`
```
11:36:37.056 [public/default/aerospike-test-sink-0] ERROR org.apache.pulsar.functions.instance.JavaInstanceRunnable - [public/default/aerospike-test-sink:0] Uncaught exception in Java Instance
com.google.common.util.concurrent.UncheckedExecutionException: org.apache.commons.lang3.SerializationException: Failed at fetching schema info for EMPTY
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2050) ~[java-instance.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3951) ~[java-instance.jar:?]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3973) ~[java-instance.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4957) ~[java-instance.jar:?]
at org.apache.pulsar.client.impl.schema.StructSchema.decode(StructSchema.java:98) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at org.apache.pulsar.client.impl.schema.AutoConsumeSchema.decode(AutoConsumeSchema.java:96) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at org.apache.pulsar.client.impl.schema.AutoConsumeSchema.decode(AutoConsumeSchema.java:39) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at org.apache.pulsar.client.impl.MessageImpl.getValue(MessageImpl.java:275) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at org.apache.pulsar.functions.source.PulsarRecord.getValue(PulsarRecord.java:74) ~[org.apache.pulsar-pulsar-functions-instance-2.5.0.jar:2.5.0]
at org.apache.pulsar.functions.instance.JavaInstanceRunnable.readInput(JavaInstanceRunnable.java:472) ~[org.apache.pulsar-pulsar-functions-instance-2.5.0.jar:?]
at org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:246) [org.apache.pulsar-pulsar-functions-instance-2.5.0.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Caused by: org.apache.commons.lang3.SerializationException: Failed at fetching schema info for EMPTY
at org.apache.pulsar.client.impl.schema.StructSchema.getSchemaInfoByVersion(StructSchema.java:182) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at org.apache.pulsar.client.impl.schema.generic.GenericJsonSchema.loadReader(GenericJsonSchema.java:52) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at org.apache.pulsar.client.impl.schema.StructSchema$1.load(StructSchema.java:72) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at org.apache.pulsar.client.impl.schema.StructSchema$1.load(StructSchema.java:69) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527) ~[java-instance.jar:?]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2276) ~[java-instance.jar:?]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154) ~[java-instance.jar:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044) ~[java-instance.jar:?]
... 11 more
Caused by: org.apache.pulsar.client.api.PulsarClientException: Disconnected from server at localhost/127.0.0.1:6650
at org.apache.pulsar.client.impl.ClientCnx.channelInactive(ClientCnx.java:231) ~[org.apache.pulsar-pulsar-client-original-2.5.0.jar:2.5.0]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:391) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:356) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1417) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:913) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[io.netty-netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510) ~[io.netty-netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518) ~[io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050) ~[io.netty-netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty-netty-common-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.43.Final.jar:4.1.43.Final]
... 1 more
```
#### System configuration
**Pulsar version**: 2.5.0
**Java Version**:
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-8u232-b09-0ubuntu1~16.04.1-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [pulsar] abhilashmandaliya commented on issue #6321: [ERROR] Failed
at fetching schema info for EMPTY
Posted by GitBox <gi...@apache.org>.
abhilashmandaliya commented on issue #6321: [ERROR] Failed at fetching schema info for EMPTY
URL: https://github.com/apache/pulsar/issues/6321#issuecomment-586157395
yes. that worked. I produced via Java client. thanks @sijie
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [pulsar] sijie commented on issue #6321: [ERROR] Failed at fetching
schema info for EMPTY
Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6321: [ERROR] Failed at fetching schema info for EMPTY
URL: https://github.com/apache/pulsar/issues/6321#issuecomment-585887501
```
pulsar-client produce -m '{"name":"abc"}' test-topic
```
`pulsar-client` doesn't support producing JSON messages to the topic. It actually produced a `bytes` message so that jdbc connector doesn't know how to deserialize it. The error message should be improved to clarify that.
If you want to produce a json message, you might consider writing a producer program to produce json messages or help improve `pulsar-client`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [pulsar] abhilashmandaliya closed issue #6321: [ERROR] Failed at
fetching schema info for EMPTY
Posted by GitBox <gi...@apache.org>.
abhilashmandaliya closed issue #6321: [ERROR] Failed at fetching schema info for EMPTY
URL: https://github.com/apache/pulsar/issues/6321
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services