You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/04/19 19:01:46 UTC

[GitHub] [nifi] natural commented on issue #3436: NIFI-6019 Removes "Trusted Hostname" property from `InvokeHTTP` processor

natural commented on issue #3436: NIFI-6019 Removes "Trusted Hostname" property from `InvokeHTTP` processor
URL: https://github.com/apache/nifi/pull/3436#issuecomment-484987500
 
 
   In the process of writing the unit test, I found the processor would throw exceptions after the property was removed:
   
   ```2019-04-19 10:49:57,346 ERROR [Timer-Driven Process Thread-5] o.a.nifi.processors.standard.InvokeHTTP InvokeHTTP[id=32f7cf9e-016a-1000-f0e2-d2a3d2b2dbb5] Yielding processor due to exception encountered as a source processor: java.lang.IllegalArgumentException: Unexpected char 0x20 at 7 in header name: Trusted Hostname: {}
   java.lang.IllegalArgumentException: Unexpected char 0x20 at 7 in header name: Trusted Hostname
           at okhttp3.Headers$Builder.checkNameAndValue(Headers.java:313)
           at okhttp3.Headers$Builder.add(Headers.java:271)
           at okhttp3.Request$Builder.addHeader(Request.java:177)
           at org.apache.nifi.processors.standard.InvokeHTTP.setHeaderProperties(InvokeHTTP.java:1008)
           at org.apache.nifi.processors.standard.InvokeHTTP.configureRequest(InvokeHTTP.java:970)
           at org.apache.nifi.processors.standard.InvokeHTTP.onTrigger(InvokeHTTP.java:761)
           at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
           at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1162)
           at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:213)
           at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
           at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
           at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
           at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
           at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
           at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)
   ```
   The error seems clear enough:  the property is treated as a dynamic property after this change, and the processor tries to send it as a header.  The header name contains a space so the invocation goes boom.
   
   I verified this behavior explicitly via a fresh installation + flow creation + upgrade. 
   
   So, removing the property will cause new failures, which seems like breaking backward compatibility.  I'm not sure the best approach for resolving the issue, leaving this comment here and closing the PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services