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

NiFi starting failure and key file already existing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.0, 1.3.0
    • None
    • Core Framework
    • None

    Description

      In some cases, if NiFi cannot start (in my case: debug port was already in use), the key file is still created and not deleted. Then it won't be possible to restart NiFi unless the key file is manually deleted.

      Logs from bootstrap:

      2017-07-04 13:57:40,460 INFO [main] o.a.n.b.NotificationServiceManager Successfully loaded the following 0 services: []
      2017-07-04 13:57:40,466 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STARTED
      2017-07-04 13:57:40,466 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STOPPED
      2017-07-04 13:57:40,466 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_DIED
      2017-07-04 13:57:40,508 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
      2017-07-04 13:57:40,509 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: /usr/hdf/current/nifi
      2017-07-04 13:57:40,510 INFO [main] org.apache.nifi.bootstrap.Command Command: /usr/jdk64/jdk1.8.0_112/bin/java -classpath /usr/hdf/current/nifi/conf:/usr/hdf/current/nifi/lib/nifi-runtime-1.2.0.3.0.0.0-453.jar:/usr/hdf/current/nifi/lib/javax.servlet-api-3.1.0.jar:/usr/hdf/current/nifi/lib/jcl-over-slf4j-1.7.25.jar:/usr/hdf/current/nifi/lib/jetty-schemas-3.1.jar:/usr/hdf/current/nifi/lib/jul-to-slf4j-1.7.25.jar:/usr/hdf/current/nifi/lib/log4j-over-slf4j-1.7.25.jar:/usr/hdf/current/nifi/lib/logback-classic-1.2.3.jar:/usr/hdf/current/nifi/lib/logback-core-1.2.3.jar:/usr/hdf/current/nifi/lib/nifi-api-1.2.0.3.0.0.0-453.jar:/usr/hdf/current/nifi/lib/nifi-nar-utils-1.2.0.3.0.0.0-453.jar:/usr/hdf/current/nifi/lib/nifi-properties-1.2.0.3.0.0.0-453.jar:/usr/hdf/current/nifi/lib/slf4j-api-1.7.25.jar:/usr/hdf/current/nifi/lib/nifi-framework-api-1.2.0.3.0.0.0-453.jar -Dorg.apache.jasper.compiler.disablejsr199=true -Djava.security.auth.login.config=/usr/hdf/current/nifi/conf/nifi_jaas.conf -Xmx512m -Xms512m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 -Dambari.application.id=nifi -Dambari.metrics.collector.url=http://pvillard-1:6188/ws/v1/timeline/metrics -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -XX:+UseG1GC -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dnifi.properties.file.path=/usr/hdf/current/nifi/conf/nifi.properties -Dnifi.bootstrap.listen.port=33910 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=/var/log/nifi org.apache.nifi.NiFi -K /usr/hdf/current/nifi/conf/sensitive.key
      2017-07-04 13:57:40,532 INFO [main] org.apache.nifi.bootstrap.Command Launched Apache NiFi with Process ID 30029
      2017-07-04 13:57:40,647 ERROR [NiFi logging handler] org.apache.nifi.StdErr ERROR: transport error 202: bind failed: Address already in use
      2017-07-04 13:57:40,648 ERROR [NiFi logging handler] org.apache.nifi.StdErr ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
      2017-07-04 13:57:40,648 ERROR [NiFi logging handler] org.apache.nifi.StdErr JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
      2017-07-04 13:57:41,536 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi never started. Will not restart NiFi
      2017-07-04 14:03:26,828 INFO [main] o.a.n.b.NotificationServiceManager Successfully loaded the following 0 services: []
      2017-07-04 14:03:26,834 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STARTED
      2017-07-04 14:03:26,835 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STOPPED
      2017-07-04 14:03:26,835 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_DIED
      2017-07-04 14:03:26,838 INFO [main] org.apache.nifi.bootstrap.Command Apache NiFi is not currently running
      2017-07-04 14:03:46,063 INFO [main] o.a.n.b.NotificationServiceManager Successfully loaded the following 0 services: []
      2017-07-04 14:03:46,070 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STARTED
      2017-07-04 14:03:46,070 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STOPPED
      2017-07-04 14:03:46,070 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_DIED
      2017-07-04 14:03:46,109 ERROR [main] org.apache.nifi.bootstrap.Command The sensitive.key file /usr/hdf/current/nifi/conf/sensitive.key already exists. That shouldn't have been. Aborting.
      2017-07-04 14:04:26,187 INFO [main] o.a.n.b.NotificationServiceManager Successfully loaded the following 0 services: []
      2017-07-04 14:04:26,193 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STARTED
      2017-07-04 14:04:26,193 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STOPPED
      2017-07-04 14:04:26,193 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_DIED
      2017-07-04 14:04:26,228 ERROR [main] org.apache.nifi.bootstrap.Command The sensitive.key file /usr/hdf/current/nifi/conf/sensitive.key already exists. That shouldn't have been. Aborting.
      

      I am not familiar with this part but I assume that we could add something around:

      RunNiFi.java
      Process process = builder.start();
      handleLogging(process);
      Long pid = OSUtils.getProcessId(process, cmdLogger);
      

      Attachments

        Issue Links

          Activity

            People

              alopresto Andy LoPresto
              pvillard Pierre Villard
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: