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 75905200C48 for ; Fri, 17 Mar 2017 00:39:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 743D8160B78; Thu, 16 Mar 2017 23:39:48 +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 C7691160B8B for ; Fri, 17 Mar 2017 00:39:47 +0100 (CET) Received: (qmail 65533 invoked by uid 500); 16 Mar 2017 23:39:47 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 65512 invoked by uid 99); 16 Mar 2017 23:39:46 -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; Thu, 16 Mar 2017 23:39:46 +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 93DE318F16A for ; Thu, 16 Mar 2017 23:39:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.651 X-Spam-Level: X-Spam-Status: No, score=0.651 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] 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 eUt5FjPDPUDL for ; Thu, 16 Mar 2017 23:39:44 +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 165215FC7B for ; Thu, 16 Mar 2017 23:39:44 +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 60B7DE0A2F for ; Thu, 16 Mar 2017 23:39:42 +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 BA078254BE for ; Thu, 16 Mar 2017 23:39:41 +0000 (UTC) Date: Thu, 16 Mar 2017 23:39:41 +0000 (UTC) From: "Jeremiah Lowin (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (AIRFLOW-990) DockerOperator fails when logging unicode string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 16 Mar 2017 23:39:48 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jeremiah Lowin resolved AIRFLOW-990. ------------------------------------ Resolution: Fixed Fix Version/s: 1.9.0 Issue resolved by pull request #2155 [https://github.com/apache/incubator-airflow/pull/2155] > DockerOperator fails when logging unicode string > ------------------------------------------------ > > Key: AIRFLOW-990 > URL: https://issues.apache.org/jira/browse/AIRFLOW-990 > Project: Apache Airflow > Issue Type: Bug > Components: docker > Affects Versions: Airflow 1.7.1 > Environment: Python 2.7 > Reporter: Vitor Baptista > Assignee: Vitor Baptista > Fix For: 1.9.0 > > > On line https://github.com/apache/incubator-airflow/blob/1.7.1.3/airflow/operators/docker_operator.py#L164, we're calling: > {code:title=airflow/operators/docker_operator.py} > for line in self.cli.logs(container=self.container['Id'], stream=True): > logging.info("{}".format(line.strip())) > {code} > If `self.cli.logs()` return a string with a unicode character, this raises the UnicodeDecodeError: > {noformat} > Traceback (most recent call last): > File "/usr/lib/python2.7/logging/__init__.py", line 861, in emit > msg = self.format(record) > File "/usr/lib/python2.7/logging/__init__.py", line 734, in format > return fmt.format(record) > File "/usr/lib/python2.7/logging/__init__.py", line 476, in format > raise e > UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 0: ordinal not in range(128) > Logged from file docker_operator.py, line 165 > {noformat} > A possible fix is to change that line to: > {code:title=airflow/operators/docker_operator.py} > for line in self.cli.logs(container=self.container['Id'], stream=True): > logging.info(line.decode('utf-8').strip()) > {code}. > This error doesn't happen on Python3. I haven't tested, but reading the code it seems the same error exists on `master` as well. -- This message was sent by Atlassian JIRA (v6.3.15#6346)