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

NiFi doesn't start if bootstrap.conf contains a tmp dir which doesn't exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.6.0
    • None
    • Extensions
    • None

    Description

      If a "java.io.tmpdir" argument is added to bootstrap.conf, and that directory does not exist, the PutHiveStreaming processor cannot be instantiated due to a SnappyError FAILED_TO_LOAD_NATIVE_LIBRARY.  A possible solution to this would be to add a check in RunNiFi.java[1]

       

      final String tmpDirProperty = "-Djava.io.tmpdir=";
      final List<String> javaAdditionalArgs = new ArrayList<>();
      
      for (final Map.Entry<String, String> entry : props.entrySet()) {
           final String key = entry.getKey();
           final String value = entry.getValue();
      
           if (key.startsWith("java.arg")) {
      
                javaAdditionalArgs.add(value);
      
                if(value.startsWith(tmpDirProperty) 
                     && value.length() > tmpDirProperty.length()){
      
                     String tmpDir = value.subString(tmpDirProperty.length());
                     Files.createDirectories(Paths.get(tmpDir));
                }
           }
      }

       

      [1] https://github.com/apache/nifi/blob/rel/nifi-1.6.0/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java#L964-L972

      Attachments

        Activity

          People

            Unassigned Unassigned
            devriesb Brandon Rhys DeVries
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: