From users-return-8290-archive-asf-public=cust-asf.ponee.io@nifi.apache.org Thu Mar 22 20:59:51 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 BA5DE180676 for ; Thu, 22 Mar 2018 20:59:50 +0100 (CET) Received: (qmail 75912 invoked by uid 500); 22 Mar 2018 19:59:49 -0000 Mailing-List: contact users-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@nifi.apache.org Delivered-To: mailing list users@nifi.apache.org Received: (qmail 75902 invoked by uid 99); 22 Mar 2018 19:59:49 -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, 22 Mar 2018 19:59:49 +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 F3BF418045C for ; Thu, 22 Mar 2018 19:59:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.899 X-Spam-Level: *** X-Spam-Status: No, score=3.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_BADIPHTTP=2, KAM_SHORT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 4RgMIVxVJt-l for ; Thu, 22 Mar 2018 19:59:46 +0000 (UTC) Received: from mail-yb0-f176.google.com (mail-yb0-f176.google.com [209.85.213.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id AAA2C5F4AE for ; Thu, 22 Mar 2018 19:59:45 +0000 (UTC) Received: by mail-yb0-f176.google.com with SMTP id i13-v6so3362272ybl.9 for ; Thu, 22 Mar 2018 12:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=k9wxomWtYy2C9KBZ3U1UzwNhP8ynZJgwV0FoybS9jrM=; b=pfqQQHUWyfAk4sm8b8KU/BOirCMprEGXK2ev7PLI940zoGDm192N2xCmDRFfa6wKfD xzOpK+vWrZgj11qfel7XYfRydLJfBesmh2vQLQw84kb2g+honcgCRxKkbgtOknsHQYvy yxod5vQfhI3BPtiCv0WH3fBeToDWvvlAYv70VWdo9hX0JnEmbBxiqCI/CqVYd2ekqWd2 TV+Ue63RJutjq2HPHqlpyQQavxAvmW8+jd0yrlVUqXNSEarOkXWWCy0ijuixgrk40GHI uLmixz2Re1//Vk+s7Rdp4XYLz9YRKTKtRk3k6LlMFibc0+Ei80rCUZUGNuVo7WQ0pTbL mZig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=k9wxomWtYy2C9KBZ3U1UzwNhP8ynZJgwV0FoybS9jrM=; b=rAUoJDAi2CAI7dz6IXYf3YdpU10G1L5NcSxHNzA8EQJmwjc2hxG0f1tJgyQ3gpwB/d 4c7no2Y/mhlcf1JYzdWoUmnskTBhJvlqVD/uDM9PIj4OXQDHSOwtJf/XWJr3Px0sngk6 8pN8Jy5d0slDoSYKTBm2OBrz19gT22Eblb6tz//p9yLGFUF+AQcSp0BhNpchHhFaFBwq Mxxw/pgZ5i5A//Muvnj4xt8Q0iVrAOW8wwRduiKjSr+A769AMzybYujVlvHhz1jkyVDd etCQTvlmgMyiMRZ/3RxbKESDJcGNUNkSfvsgMnEk6P45WJFqmduDFoqcOO6Iek+wSK2J ZKZA== X-Gm-Message-State: AElRT7FCTAFaSTty6+L6854WP2tt4Jb3fQUokOZktDY8Pn3xyf29W47V 56F1ZPGLH74QW9lirWeZl+/F1IQZ2sAHZZB9xgaOtA== X-Google-Smtp-Source: AG47ELtlMGTE3/HTgwSF4LwolaSdvi9we/MBhcBBJOYKJyyE8pcy0LPjzIgBXLeALGptCm2BTOXqiAQcVllkZ1ptf2E= X-Received: by 2002:a25:b10c:: with SMTP id g12-v6mr11087122ybj.331.1521748784222; Thu, 22 Mar 2018 12:59:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef47:0:0:0:0:0 with HTTP; Thu, 22 Mar 2018 12:59:43 -0700 (PDT) In-Reply-To: References: From: Matt Gilman Date: Thu, 22 Mar 2018 15:59:43 -0400 Message-ID: Subject: Re: Problem enabling/disabling NiFi controller services from behind proxy To: users@nifi.apache.org Content-Type: multipart/alternative; boundary="000000000000b897e4056805bf90" --000000000000b897e4056805bf90 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Tim, Sorry for the inconvenience but this was a bug that was introduced in Apache NiFi 1.5.0. This was addressed in this JIRA [1] and will be included in Apache NiFi 1.6.0 which is currently under vote. Matt [1] https://issues.apache.org/jira/browse/NIFI-4894 On Thu, Mar 22, 2018 at 3:13 PM, Tim Dean wrote: > Hello, > > I am working with NiFi 1.5.0 and I have created a customer service > controller for my project. I am able to add my controller service to my > NiFi flow configuration, but I am unable to enable that controller servic= e > without first encountering error messages that I need to dismiss. After > that the controller services do appear to be enabled, but then I can=E2= =80=99t > disable them. > > This problem does not occur when I connect directly to my NiFi applicatio= n > from the browser. But it does not work when NiFi is deployed behind an > Nginx reverse proxy that is how we deploy things in production. I have > configured Nginx to set headers as described at https://community. > hortonworks.com/articles/113240/running-apache-nifi-behind-a-proxy-2.html= . > Specifically, my Nginx configuration looks like this: > > location /workflow/ { > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-ProxyScheme $scheme; > proxy_set_header X-ProxyHost $host; > proxy_set_header X-ProxyPort $server_port; > proxy_set_header X-ProxyContextPath "/workflow/"; > proxy_pass http://127.0.0.1:8080/; > } > > > This appears to work for most operations: I can configure my processors, > start and stop them, etc. But when I try to click the button to enable my > service controller, the proxy settings set up in my Nginx configuration > above don=E2=80=99t seem to be honored. > > As an example, here the HTTP request I see in developer tools for startin= g > a processor looks like this: > > PUT http://vi-codex.eng.local/workflow/nifi-api/processors/ > 5d8deeca-015e-1000-be6e-151bd1c4b56a > > > But when I click on the button to enable my controller service, the HTTP > request looks like this: > > GET http://vi-codex.eng.local/nifi-api/flow/bulletin-board? > sourceId=3D4e9f82cf-0162-1000-ee16-fb9ce9599ac6 > > > As you can see, the =E2=80=9C/workflow=E2=80=9D context path I set via Ng= inx is being used > for the first (and every other) request, but not when I try to enable or > disable a service controller. For enabling and disabling, I get an error > because it attempts to access =E2=80=9Cnifi-api=E2=80=9D without properly= prefixing it with > the correct context path. > > Have I done something wrong in my configuration that is causing this? Or > is this a bug in NiFi 1.5? > > Thanks > > -Tim > --000000000000b897e4056805bf90 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Tim,

Sorry for the inconvenience but= this was a bug that was introduced in Apache NiFi 1.5.0. This was addresse= d in this JIRA [1] and will be included in Apache NiFi 1.6.0 which is curre= ntly under vote.

Matt


On Thu, Mar 22, 2018 at 3:13 PM, Tim D= ean <tim.dean@gmail.com> wrote:
Hel= lo,

I am working with NiFi 1.5.0 and I have created a cu= stomer service controller for my project. I am able to add my controller se= rvice to my NiFi flow configuration, but I am unable to enable that control= ler service without first encountering error messages that I need to dismis= s. After that the controller services do appear to be enabled, but then I c= an=E2=80=99t disable them.

This problem does not o= ccur when I connect directly to my NiFi application from the browser. But i= t does not work when NiFi is deployed behind an Nginx reverse proxy that is= how we deploy things in production. I have configured Nginx to set headers= as described at=C2=A0https:= //community.hortonworks.com/articles/113240/running-apache-nifi-<= wbr>behind-a-proxy-2.html. Specifically, my Nginx configuration looks l= ike this:

location /workflow/ {=
=C2=A0 =C2=A0=C2=A0proxy_set_header Host = $host;
=C2=A0 =C2=A0=C2=A0proxy_set= _header X-Real-IP $remote_addr;
=C2= =A0 =C2=A0=C2=A0proxy_set_header X-ProxyScheme $scheme;
=C2=A0 =C2=A0=C2=A0proxy_set_header X-ProxyHost $host;=
=C2=A0 =C2=A0=C2=A0proxy_set_heade= r X-ProxyPort $server_port;
=C2=A0 = =C2=A0=C2=A0proxy_set_header X-ProxyContextPath=C2=A0"/workflow/&= quot;;
=C2=A0 =C2=A0=C2=A0proxy_pas= s http://127.0.0.1:808= 0/;
}
=

This appears to work for most operations: I can configu= re my processors, start and stop them, etc. But when I try to click the but= ton to enable my service controller, the proxy settings set up in my Nginx = configuration above don=E2=80=99t seem to be honored.

<= div>As an example, here the HTTP request I see in developer tools for start= ing a processor looks like this:


But when I click on the button to enable my controller service, th= e HTTP request looks like this:


As you can see, the =E2=80=9C/workflow=E2=80= =9D context path I set via Nginx is being used for the first (and every oth= er) request, but not when I try to enable or disable a service controller. = For enabling and disabling, I get an error because it attempts to access = =E2=80=9Cnifi-api=E2=80=9D without properly prefixing it with the correct c= ontext path.

Have I done something wrong in my con= figuration that is causing this? Or is this a bug in NiFi 1.5?
Thanks

-Tim

--000000000000b897e4056805bf90--