-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
io.confluent.connect.storage.errors.PartitionException: Error encoding partition #131
Comments
I don't think this is an issue with the repo. Can you please show your partitioner? Did you use the code in #73? |
You should also try debugging your own code and or write more unit tests |
@Cricket007 thank you for the link, I tried to debug and still throws the same error. here is the line of code that it complains about it:
` I am not sure should I change something in json or other things caused the problem. |
yes |
Are you able to run the unit tests? Can you fork that branch and run a build with your own test that produces the exception? |
Sorry I used the following code: |
Are you sure?
|
@Cricket007 I changed the package name and also changed the config based on the package. I have the following line |
@Cricket007 that's interesting. I did the mvn test and this is the outcome:
|
No tests ran... I was asking you to write one of your own with a sample of a record that you expect to get partitioned. |
How can I run such a test, is there any documentation avaiable? |
Tests are part of the repo...You have used Maven before, right? https://github.com/confluentinc/kafka-connect-storage-common/tree/master/core/src/test It's not clear what you've cloned or built if tests aren't running for you |
I followed the instruction to building the common storage
And, this is the new pom to perform a test.
|
But you don't need to do this. You can fork this repo, as is, then add your own partitioner and tests |
I added my custom partitioner and I get the error when I write to a topic and I see the following error:
org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception. at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:559) at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:315) at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:218) at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:186) at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170) at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: io.confluent.connect.storage.errors.PartitionException: Error encoding partition. at com.accelerator.kafka.connect.FieldAndTimeBasedPartitioner$PartitionFieldExtractor.extract(FieldAndTimeBasedPartitioner.java:153) at com.accelerator.kafka.connect.FieldAndTimeBasedPartitioner.encodePartition(FieldAndTimeBasedPartitioner.java:97) at io.confluent.connect.s3.TopicPartitionWriter.executeState(TopicPartitionWriter.java:205) at io.confluent.connect.s3.TopicPartitionWriter.write(TopicPartitionWriter.java:176) at io.confluent.connect.s3.S3SinkTask.put(S3SinkTask.java:195) at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:537) ... 10 more
Config of json file:
The text was updated successfully, but these errors were encountered: