Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15538

Starting node via CLI can lead to NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha3
    • None

    Description

      Trying to start a new node via CLI without specifying metastorage raft group may lead to the following exception:

      Exception in thread "main" class org.apache.ignite.lang.IgniteException: Unable to start node=[new1].
      	at org.apache.ignite.internal.app.IgniteImpl.start(IgniteImpl.java:293)
      	at org.apache.ignite.internal.app.IgnitionImpl.doStart(IgnitionImpl.java:141)
      	at org.apache.ignite.internal.app.IgnitionImpl.start(IgnitionImpl.java:72)
      	at org.apache.ignite.app.IgniteCliRunner.main(IgniteCliRunner.java:59)
      Caused by: java.lang.NullPointerException
      	at org.apache.ignite.raft.jraft.rpc.impl.RaftGroupServiceImpl.sendWithRetry(RaftGroupServiceImpl.java:456)
      	at org.apache.ignite.raft.jraft.rpc.impl.RaftGroupServiceImpl.refreshLeader(RaftGroupServiceImpl.java:202)
      	at org.apache.ignite.raft.jraft.rpc.impl.RaftGroupServiceImpl.start(RaftGroupServiceImpl.java:158)
      	at org.apache.ignite.internal.raft.Loza.prepareRaftGroup(Loza.java:99)
      	at org.apache.ignite.internal.metastorage.MetaStorageManager.start(MetaStorageManager.java:167)
      	at org.apache.ignite.internal.app.IgniteImpl.doStartComponent(IgniteImpl.java:384)
      	at org.apache.ignite.internal.app.IgniteImpl.start(IgniteImpl.java:278)
      

      The root cause is the fact we a trying to start RaftGroupServiceImpl with an empty list of peers, which leads to this NullPointerException when refsreshLeader request is issued. This behavior is fixed by IGNITE-15027 (well, it is a work-around until IGNITE-14414 is implemented).

       

      Also, trying to start a new node without a configuration file (which is optional) results in NullPointerException:

      Exception in thread "main" java.lang.NullPointerException
              at org.apache.ignite.app.IgniteCliRunner.main(IgniteCliRunner.java:59)
      

      The reason for this exception is the following code:

      IgniteCliRunner
          public static void main(String[] args) throws IOException {
              ...
              ignition.start(parsedArgs.nodeName, parsedArgs.config.toAbsolutePath(), Path.of("work"));
          }
      

      where parsedArgs.config can be null just because the configuration file is optional. so, the fix is trivial.

      Attachments

        Issue Links

          Activity

            People

              slava.koptilin Vyacheslav Koptilin
              kgusakov Kirill Gusakov
              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 - 0.5h
                  0.5h