From jira-return-10931-archive-asf-public=cust-asf.ponee.io@kafka.apache.org Mon Mar 19 17:07:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 82DFD180647 for ; Mon, 19 Mar 2018 17:07:05 +0100 (CET) Received: (qmail 10970 invoked by uid 500); 19 Mar 2018 16:07:04 -0000 Mailing-List: contact jira-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@kafka.apache.org Delivered-To: mailing list jira@kafka.apache.org Received: (qmail 10904 invoked by uid 99); 19 Mar 2018 16:07:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2018 16:07:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 212AD180282 for ; Mon, 19 Mar 2018 16:07:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id d3PHsy9m7atT for ; Mon, 19 Mar 2018 16:07:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id DDC245F343 for ; Mon, 19 Mar 2018 16:07:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D573FE0D48 for ; Mon, 19 Mar 2018 16:07:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 45193214B0 for ; Mon, 19 Mar 2018 16:07:00 +0000 (UTC) Date: Mon, 19 Mar 2018 16:07:00 +0000 (UTC) From: "Randall Hauch (JIRA)" To: jira@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KAFKA-6685) Connect deserialization log message should distinguish key from value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KAFKA-6685?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1640= 5043#comment-16405043 ]=20 Randall Hauch commented on KAFKA-6685: -------------------------------------- The stack trace often looks something like: {noformat} [2018-03-19 11:57:37,419] ERROR WorkerSinkTask{id=3Delasticsearch-0} Task t= hrew an uncaught and unrecoverable exception (org.apache.kafka.connect.runt= ime.WorkerTask:172) org.apache.kafka.connect.errors.DataException: MYTOPIC =09at io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.j= ava:95) =09at org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(Worke= rSinkTask.java:467) =09at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.j= ava:301) =09at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkT= ask.java:205) =09at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTas= k.java:173) =09at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170= ) =09at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214) =09at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51= 1) =09at java.util.concurrent.FutureTask.run(FutureTask.java:266) =09at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.= java:1142) =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor= .java:617) =09at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.kafka.common.errors.SerializationException: Error ret= rieving Avro schema for id 1 Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestCli= entException: Subject not found.; error code: 40401 =09at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpReq= uest(RestService.java:202) =09at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest= (RestService.java:229) =09at io.confluent.kafka.schemaregistry.client.rest.RestService.lookUpSubje= ctVersion(RestService.java:296) =09at io.confluent.kafka.schemaregistry.client.rest.RestService.lookUpSubje= ctVersion(RestService.java:284) =09at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.g= etVersionFromRegistry(CachedSchemaRegistryClient.java:125) =09at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.g= etVersion(CachedSchemaRegistryClient.java:236) =09at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserial= ize(AbstractKafkaAvroDeserializer.java:152) =09at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserial= izeWithSchemaAndVersion(AbstractKafkaAvroDeserializer.java:194) =09at io.confluent.connect.avro.AvroConverter$Deserializer.deserialize(Avro= Converter.java:120) =09at io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.j= ava:83) =09at org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(Worke= rSinkTask.java:467) =09at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.j= ava:301) =09at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkT= ask.java:205) =09at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTas= k.java:173) =09at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170= ) =09at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214) =09at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51= 1) =09at java.util.concurrent.FutureTask.run(FutureTask.java:266) =09at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.= java:1142) =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor= .java:617) =09at java.lang.Thread.run(Thread.java:745) {noformat} We should consider wrapping each of [these lines|https://github.com/apache/= kafka/blob/e7ef719a5bc0d1276f0e9482d59b25406fda276b/connect/runtime/src/mai= n/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java#L467-L468]: {code:java} SchemaAndValue keyAndSchema =3D keyConverter.toConnectData(msg.= topic(), msg.key()); SchemaAndValue valueAndSchema =3D valueConverter.toConnectData(= msg.topic(), msg.value()); {code} in a try block and then reporting a more useful error message for each cond= ition. > Connect deserialization log message should distinguish key from value > --------------------------------------------------------------------- > > Key: KAFKA-6685 > URL: https://issues.apache.org/jira/browse/KAFKA-6685 > Project: Kafka > Issue Type: Improvement > Components: KafkaConnect > Reporter: Yeva Byzek > Priority: Minor > > Connect was configured for Avro key and value but data had String key and= Avro value. The resulting error message was misleading because it didn't d= istinguish key from value, and so I was chasing problems with the value ins= tead of the key. > tl;dr Connect should at least tell you whether the problem is with deseri= alizing the key or value of a record > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)