Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-6201

Suppress stacktrace on connection refused when NiFi Registry is not running

    XMLWordPrintableJSON

    Details

      Description

      When NiFi is running and the flow has a Registry Client configured to connect to the NiFi Registry, but the Registry instance is not running or is not avzailable, long stacktraces are output in the nifi-app.log. While these events are important, the long stacktraces are unnecessary as the cause is clear – "Connection refused". These exceptions should be caught and logged properly.

      Sufficient:

      2019-04-09 19:51:04,100 ERROR [Timer-Driven Process Thread-4] o.a.nifi.groups.StandardProcessGroup Failed to synchronize StandardProcessGroup[identifier=9b59e11e-0169-1000-cb5a-8291e22101f8] with Flow Registry because could not retrieve version 2 of flow with identifier 39ba9057-eaee-4ded-bc61-ce6d4d47d164 in bucket aa2f984d-fca4-4b0b-a5a2-c21b3910d1b6
      java.net.ConnectException: Connection refused (Connection refused)
      

      Unnecessary (current state):

      2019-04-09 19:53:04,121 ERROR [Timer-Driven Process Thread-8] o.a.nifi.groups.StandardProcessGroup Failed to synchronize StandardProcessGroup[identifier=9b59e11e-0169-1000-cb5a-8291e22101f8] with Flow Registry because could not retrieve version 2 of flow with identifier 39ba9057-eaee-4ded-bc61-ce6d4d47d164 in bucket aa2f984d-fca4-4b0b-a5a2-c21b3910d1b6
      java.net.ConnectException: Connection refused (Connection refused)
      	at java.net.PlainSocketImpl.socketConnect(Native Method)
      	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
      	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      	at java.net.Socket.connect(Socket.java:589)
      	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
      	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
      	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
      	at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
      	at sun.net.www.http.HttpClient.New(HttpClient.java:339)
      	at sun.net.www.http.HttpClient.New(HttpClient.java:357)
      	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
      	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
      	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
      	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
      	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
      	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
      	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
      	at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:390)
      	at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:282)
      	at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:278)
      	at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:767)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:229)
      	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414)
      	at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:765)
      	at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:428)
      	at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:324)
      	at org.apache.nifi.registry.client.impl.JerseyFlowSnapshotClient.lambda$get$1(JerseyFlowSnapshotClient.java:104)
      	at org.apache.nifi.registry.client.impl.AbstractJerseyClient.executeAction(AbstractJerseyClient.java:71)
      	at org.apache.nifi.registry.client.impl.JerseyFlowSnapshotClient.get(JerseyFlowSnapshotClient.java:97)
      	at org.apache.nifi.registry.flow.RestBasedFlowRegistry.getFlowContents(RestBasedFlowRegistry.java:206)
      	at org.apache.nifi.registry.flow.RestBasedFlowRegistry.getFlowContents(RestBasedFlowRegistry.java:220)
      	at org.apache.nifi.groups.StandardProcessGroup.synchronizeWithFlowRegistry(StandardProcessGroup.java:3258)
      	at org.apache.nifi.controller.FlowController$5.run(FlowController.java:820)
      	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)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alopresto Andy LoPresto
                Reporter:
                alopresto Andy LoPresto
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m