Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D3C35200BC5 for ; Tue, 22 Nov 2016 18:29:10 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D25D0160B0C; Tue, 22 Nov 2016 17:29:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 26E92160AF1 for ; Tue, 22 Nov 2016 18:29:10 +0100 (CET) Received: (qmail 70137 invoked by uid 500); 22 Nov 2016 17:29:09 -0000 Mailing-List: contact dev-help@samza.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@samza.apache.org Delivered-To: mailing list dev@samza.apache.org Received: (qmail 70125 invoked by uid 99); 22 Nov 2016 17:29:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Nov 2016 17:29:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7E7A2CA18E for ; Tue, 22 Nov 2016 17:29:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.129 X-Spam-Level: ** X-Spam-Status: No, score=2.129 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id lqyEhnywttf6 for ; Tue, 22 Nov 2016 17:29:06 +0000 (UTC) Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com [209.85.213.54]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id C78E95FAE6 for ; Tue, 22 Nov 2016 17:29:05 +0000 (UTC) Received: by mail-vk0-f54.google.com with SMTP id w194so18508307vkw.2 for ; Tue, 22 Nov 2016 09:29:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=yK3SZAUhX6JvONjreE9tRvJn71OJZRuPaoZbvojhpi8=; b=M3CtIgR51P7fZnYObVnu635X3nNFYxyLD2owjMb8GejjzTD7pde4LzhOBtyiuoT2Dw da86LPlALWfS7CHDiG/ivK3JuEYJET0U2TGgS4QjDj50qYyiBZicmsUouLwS62prrAnu n0zpjfRZ1OyKo/KVpGstz8JBhOaG1/FuK2Fi8pnEGtw8yhGkMVHBoMXk6NnowOn0J7WH /pjb6mDQGPYldWthuUjh7w9VsNT8V+YtIXfrbJtRMFJKewKBIkbllljCsWigCzmWZkSc GmTAJi74Q0RPHCmEIPk6BEDzNPFRE3ZMcdIAPD3fJ+FmVah04QpctITMclxbutC/SvNs wjIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=yK3SZAUhX6JvONjreE9tRvJn71OJZRuPaoZbvojhpi8=; b=lSL98OJqZoHt8vydTnIU3aC2ERu3y7ZTR1uGpbd6VzGrcrVaL4v0+64D0C6HgpNKO0 kOXgGnbaP4LtRFcNH3vJV0nlKV3XgnwkrXmqN/tqMituvwZhDdquQnJZCK7yO963Iabj WgmeCcE9nP6Tq10i63ASE9Zi8K04eL+PqNnbImJiby6V0F476p6f9HFgLjla9u4VdbXD FnGqjPPLrNAJ6dmx3Kdwb+Rf4c9fa8JBDgS4agy2fsFlSE9gdJUAed8Ym3TWc+HiP5cH KnvN5En0ZD/Etk47ZQUeTg916n0q0kgbHP+i3y8eO6SGLBOTJMlBNV0JTGDukTEB+5aW dzPA== X-Gm-Message-State: AKaTC024IjCybcAVckFI2aX9Rd/yv/QZaiwMs62NRpvvnUm+CemIsJZictg3lJLfiDA0UzncHZBefrNkkbHU/w== X-Received: by 10.31.50.214 with SMTP id y205mr10323249vky.29.1479835738666; Tue, 22 Nov 2016 09:28:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.0.74 with HTTP; Tue, 22 Nov 2016 09:28:58 -0800 (PST) In-Reply-To: References: From: Jagadish Venkatraman Date: Tue, 22 Nov 2016 09:28:58 -0800 Message-ID: Subject: Re: Catching exceptions from serde To: dev@samza.apache.org Content-Type: multipart/alternative; boundary=001a1143f50e877e910541e71bef archived-at: Tue, 22 Nov 2016 17:29:11 -0000 --001a1143f50e877e910541e71bef Content-Type: text/plain; charset=UTF-8 Hi Raj, You have an invalid JSON message in your input. When Samza tries to de-serialize the input from your source, it encountered a De-serialization error. If you are okay with dropping messages when there are ser-de errors, please take a look at : task.drop.deserialization.errors task.drop.serialization.errors Also, you probably want to fix the problem at the source you're consuming from (on why it was generating invalid messages) https://samza.apache.org/learn/documentation/0.10/jobs/configuration-table.html Thanks, Jagdish On Tue, Nov 22, 2016 at 3:38 AM, Raj raj wrote: > Hi, > > I am using json serde to receive json strings from kafka and > automatically convert it to LinkedHashMap. I am using the following > code fragment to achieve this: > > LinkedHashMap rawEvent = (LinkedHashMap Object>) envelope.getMessage(); > > I am now getting an exception when samsa encounters a bad json string > from kafka. > > 16/11/22 11:33:14 ERROR container.SamzaContainer: Caught exception in > process loop. > org.apache.samza.system.SystemConsumersException: Cannot deserialize > an incoming message. > at org.apache.samza.system.SystemConsumers.update( > SystemConsumers.scala:303) > at org.apache.samza.system.SystemConsumers.tryUpdate( > SystemConsumers.scala:270) > . > . > . > . > Caused by: org.codehaus.jackson.JsonParseException: Invalid UTF-8 > middle byte 0x6e > at [Source: [B@7ce97ee5; line: 1, column: 811] > at org.codehaus.jackson.JsonParser._constructError( > JsonParser.java:1291) > at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError( > JsonParserMinimalBase.java:385) > at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidOther( > Utf8StreamParser.java:2244) > . > . > . > . > > Since the exceptions seems to be raised in scala code, how best to > catch such exceptions and deal with it? > > Thanks and Regards, > > Raj > -- Jagadish V, Graduate Student, Department of Computer Science, Stanford University --001a1143f50e877e910541e71bef--