murong00 opened a new issue #3966: UNAVAILABLE: io exception in a Sink which 
accepts pulsar messages as bytes
URL: https://github.com/apache/pulsar/issues/3966
 
 
   **Describe the bug**
   When trying to send a single string message to the topic occupied in a sink 
that treats the message as bytes, such as `RedisSink`, it occurs the following 
error:
   ```
   $ bin/pulsar-admin sink status --tenant public --namespace default --name 
redis-test-sink
   {
     "numInstances" : 1,
     "numRunning" : 0,
     "instances" : [ {
       "instanceId" : 0,
       "status" : {
         "running" : false,
         "error" : "UNAVAILABLE: io exception",
         "numRestarts" : 0,
         "numReadFromPulsar" : 0,
         "numSystemExceptions" : 0,
         "latestSystemExceptions" : [ ],
         "numSinkExceptions" : 0,
         "latestSinkExceptions" : [ ],
         "numWrittenToSink" : 0,
         "lastReceivedTime" : 0,
         "workerId" : "c-pulsar-cluster-test-fw-localhost-8080"
       }
     } ]
   }
   ```
   The functions log shows below:
   ```
   15:26:13.565 [public/default/redis-test-sink-0] ERROR 
org.apache.pulsar.functions.instance.JavaInstanceRunnable - 
[public/default/redis-test-sink:0] Uncaught exception in Java Instance
   org.apache.pulsar.client.api.SchemaSerializationException: 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.core.JsonParseException:
 Unrecognized token 'Hello': was expecting ('true', 'false' or 'null')
    at [Source: (byte[])"Hello Pulsar"; line: 1, column: 7]
           at 
org.apache.pulsar.client.impl.schema.JSONSchema.decode(JSONSchema.java:77) 
~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.client.impl.MessageImpl.getValue(MessageImpl.java:247) 
~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.source.PulsarRecord.getValue(PulsarRecord.java:74) 
~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.instance.JavaInstanceRunnable.readInput(JavaInstanceRunnable.java:451)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:236)
 [java-instance.jar:2.4.0-SNAPSHOT]
           at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
   Caused by: 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.core.JsonParseException:
 Unrecognized token 'Hello': was expecting ('true', 'false' or 'null')
    at [Source: (byte[])"Hello Pulsar"; line: 1, column: 7]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:703)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:3532)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2627)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:832)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:729)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4141)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4000)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.functions.runtime.shaded.com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3091)
 ~[java-instance.jar:2.4.0-SNAPSHOT]
           at 
org.apache.pulsar.client.impl.schema.JSONSchema.decode(JSONSchema.java:75) 
~[java-instance.jar:2.4.0-SNAPSHOT]
           ... 5 more
   15:26:13.574 [public/default/redis-test-sink-0] INFO  
org.apache.pulsar.functions.instance.JavaInstanceRunnable - Closing instance
   15:26:13.581 [pulsar-client-io-1-1] INFO  
org.apache.pulsar.client.impl.ConsumerImpl - [test_redis] 
[public/default/redis-test-sink] Closed consumer
   ```
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to