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

SocketRemoteSiteListener NPE when calling NifiProperties.getRemoteInputHttpPort

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.2.0
    • Component/s: Core Framework
    • Labels:
      None

      Description

      When using the following properties:

      nifi.remote.input.host=node1.textbed.internal
      nifi.remote.input.secure=true
      nifi.remote.input.socket.port=54321
      nifi.remote.input.http.enabled=false
      nifi.remote.input.http.transaction.ttl=30 sec

      I hit

      2016-12-09 00:15:26,456 ERROR [Site-to-Site Worker Thread-145] o.a.nifi.remote.SocketRemoteSiteListener
      java.lang.NullPointerException: null
              at org.apache.nifi.remote.SocketRemoteSiteListener$1$1.run(SocketRemoteSiteListener.java:280) ~[nifi-site-to-site-1.1.0.jar:1.1.0]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
      

        Issue Links

          Activity

          Hide
          joewitt Joseph Witt added a comment -

          +1 merged to master.

          Show
          joewitt Joseph Witt added a comment - +1 merged to master.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/nifi/pull/1324

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/nifi/pull/1324
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ijokarumawak commented on the issue:

          https://github.com/apache/nifi/pull/1324

          @joewitt @trixpan Fixed merge conflict. Tested NIFI-3166(https://issues.apache.org/jira/browse/NIFI-3166) issue is addressed, disabling HTTP remote input worked without NPE.

          I also tested NIFI-3541(https://issues.apache.org/jira/browse/NIFI-3541) (which made a conflict with this PR) that added `Local Network Interface` property to RPG configuration to specify NIC to use. It seems working with RAW S2S but couple of HTTP S2S requests doesn't use the NIC properly. I will raise separate JIRA for that with more detail.

          This PR is ready for review for fixing solely NIFI-3166.

          Show
          githubbot ASF GitHub Bot added a comment - Github user ijokarumawak commented on the issue: https://github.com/apache/nifi/pull/1324 @joewitt @trixpan Fixed merge conflict. Tested NIFI-3166 ( https://issues.apache.org/jira/browse/NIFI-3166 ) issue is addressed, disabling HTTP remote input worked without NPE. I also tested NIFI-3541 ( https://issues.apache.org/jira/browse/NIFI-3541 ) (which made a conflict with this PR) that added `Local Network Interface` property to RPG configuration to specify NIC to use. It seems working with RAW S2S but couple of HTTP S2S requests doesn't use the NIC properly. I will raise separate JIRA for that with more detail. This PR is ready for review for fixing solely NIFI-3166 .
          Hide
          joewitt Joseph Witt added a comment -

          Koji Kawamura terribly sorry i realize you've tried to keep this up to date multiple times. Just put 1.2.0 on it and I promise i will review and merge if someone doesn't beat me to it.

          Show
          joewitt Joseph Witt added a comment - Koji Kawamura terribly sorry i realize you've tried to keep this up to date multiple times. Just put 1.2.0 on it and I promise i will review and merge if someone doesn't beat me to it.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user trixpan commented on the issue:

          https://github.com/apache/nifi/pull/1324

          @ijokarumawak merge conflict, mind rebasing?

          Show
          githubbot ASF GitHub Bot added a comment - Github user trixpan commented on the issue: https://github.com/apache/nifi/pull/1324 @ijokarumawak merge conflict, mind rebasing?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user joewitt commented on the issue:

          https://github.com/apache/nifi/pull/1324

          @ijokarumawak can you please review. Appears to have gotten a bit stale.

          [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project nifi-site-to-site: Compilation failure: Compilation failure:
          [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/socket/SocketFlowFileServerProtocol.java:[43,7] error: SocketFlowFileServerProtocol is not abstract and does not override abstract method sendPeerList(Peer,Optional<ClusterNodeInformation>,String,int,int,boolean) in ServerProtocol
          [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/socket/SocketFlowFileServerProtocol.java:[153,4] error: method does not override or implement a method from a supertype
          [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/SocketRemoteSiteListener.java:[344,24] error: method sendPeerList in interface ServerProtocol cannot be applied to given types;
          [ERROR] required: Peer,Optional<ClusterNodeInformation>,String,int,int,boolean
          [ERROR] found: Peer,Optional<ClusterNodeInformation>,NodeInformation
          [ERROR] reason: actual and formal argument lists differ in length
          [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/http/StandardHttpFlowFileServerProtocol.java:[46,7] error: StandardHttpFlowFileServerProtocol is not abstract and does not override abstract method sendPeerList(Peer,Optional<ClusterNodeInformation>,String,int,int,boolean) in ServerProtocol
          [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/http/StandardHttpFlowFileServerProtocol.java:[231,4] error: method does not override or implement a method from a supertype

          Show
          githubbot ASF GitHub Bot added a comment - Github user joewitt commented on the issue: https://github.com/apache/nifi/pull/1324 @ijokarumawak can you please review. Appears to have gotten a bit stale. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project nifi-site-to-site: Compilation failure: Compilation failure: [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/socket/SocketFlowFileServerProtocol.java: [43,7] error: SocketFlowFileServerProtocol is not abstract and does not override abstract method sendPeerList(Peer,Optional<ClusterNodeInformation>,String,int,int,boolean) in ServerProtocol [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/socket/SocketFlowFileServerProtocol.java: [153,4] error: method does not override or implement a method from a supertype [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/SocketRemoteSiteListener.java: [344,24] error: method sendPeerList in interface ServerProtocol cannot be applied to given types; [ERROR] required: Peer,Optional<ClusterNodeInformation>,String,int,int,boolean [ERROR] found: Peer,Optional<ClusterNodeInformation>,NodeInformation [ERROR] reason: actual and formal argument lists differ in length [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/http/StandardHttpFlowFileServerProtocol.java: [46,7] error: StandardHttpFlowFileServerProtocol is not abstract and does not override abstract method sendPeerList(Peer,Optional<ClusterNodeInformation>,String,int,int,boolean) in ServerProtocol [ERROR] /Users/jwitt/apachenifi/nifi.git/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/http/StandardHttpFlowFileServerProtocol.java: [231,4] error: method does not override or implement a method from a supertype
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user ijokarumawak opened a pull request:

          https://github.com/apache/nifi/pull/1324

          NIFI-3166: Fix SocketRemoteSiteListener NPE.

          Thank you for submitting a contribution to Apache NiFi.

          In order to streamline the review of the contribution we ask you
          to ensure the following steps have been taken:

              1. For all changes:
          • [x] Is there a JIRA ticket associated with this PR? Is it referenced
            in the commit message?
          • [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
          • [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
          • [x] Is your initial contribution a single, squashed commit?
              1. For code changes:
          • [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
          • [x] Have you written or updated unit tests to verify your changes?
              1. Note:
                Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
          • Refactored ServerProtocol.sendPeerList method signature to clarify the
            meaning of arguments, and avoid null pointer exception when converting null Integer to int.
          • Refactored SocketRemoteSiteListener handleRequest method to make it
            more unit test friendly.
          • Added more unit tests.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/ijokarumawak/nifi nifi-3166

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/nifi/pull/1324.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #1324


          commit 4288517886f6a54ac2e2c5311556aec7e33bc1fd
          Author: Koji Kawamura <ijokarumawak@apache.org>
          Date: 2016-12-13T05:33:16Z

          NIFI-3166: Fix SocketRemoteSiteListener NPE.

          • Refactored ServerProtocol.sendPeerList method signature to clarify the
            meaning of arguments, and avoid null pointer exception when converting null Integer to int.
          • Refactored SocketRemoteSiteListener handleRequest method to make it
            more unit test friendly.
          • Added more unit tests.

          Show
          githubbot ASF GitHub Bot added a comment - GitHub user ijokarumawak opened a pull request: https://github.com/apache/nifi/pull/1324 NIFI-3166 : Fix SocketRemoteSiteListener NPE. Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: For all changes: [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. [x] Has your PR been rebased against the latest commit within the target branch (typically master)? [x] Is your initial contribution a single, squashed commit? For code changes: [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? [x] Have you written or updated unit tests to verify your changes? Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. Refactored ServerProtocol.sendPeerList method signature to clarify the meaning of arguments, and avoid null pointer exception when converting null Integer to int. Refactored SocketRemoteSiteListener handleRequest method to make it more unit test friendly. Added more unit tests. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ijokarumawak/nifi nifi-3166 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/1324.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1324 commit 4288517886f6a54ac2e2c5311556aec7e33bc1fd Author: Koji Kawamura <ijokarumawak@apache.org> Date: 2016-12-13T05:33:16Z NIFI-3166 : Fix SocketRemoteSiteListener NPE. Refactored ServerProtocol.sendPeerList method signature to clarify the meaning of arguments, and avoid null pointer exception when converting null Integer to int. Refactored SocketRemoteSiteListener handleRequest method to make it more unit test friendly. Added more unit tests.
          Hide
          trixpan Andre F de Miranda added a comment -

          Mark,

          Thanks for the work around. It does work indeed.

          Show
          trixpan Andre F de Miranda added a comment - Mark, Thanks for the work around. It does work indeed.
          Hide
          markap14 Mark Payne added a comment -

          Andre F de Miranda - I ran into this a while back, and I could have sworn that it was addressed. Now, though, I cannot find the JIRA anywhere. Clearly this is something that we need to address, but in the meantime, a simple workaround is to enable http-based site-to-site. If HTTP-based site-to-site is enabled, then you should be able to use either HTTP-based or RAW.

          Show
          markap14 Mark Payne added a comment - Andre F de Miranda - I ran into this a while back, and I could have sworn that it was addressed. Now, though, I cannot find the JIRA anywhere. Clearly this is something that we need to address, but in the meantime, a simple workaround is to enable http-based site-to-site. If HTTP-based site-to-site is enabled, then you should be able to use either HTTP-based or RAW.

            People

            • Assignee:
              ijokarumawak Koji Kawamura
              Reporter:
              trixpan Andre F de Miranda
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development