You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Dima Kovalyov (Jira)" <ji...@apache.org> on 2021/02/24 18:42:00 UTC

[jira] [Comment Edited] (NIFI-2128) NiFi service fails to start with FileAlreadyExistsException when configured to use a directory that is symlink

    [ https://issues.apache.org/jira/browse/NIFI-2128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17290192#comment-17290192 ] 

Dima Kovalyov edited comment on NIFI-2128 at 2/24/21, 6:41 PM:
---------------------------------------------------------------

I have the same issue, I think it was seen previously with "conf" directory here:
 https://issues.apache.org/jira/browse/NIFI-1746
 The patch that fixes it last time is:
 [https://github.com/apache/nifi/commit/5625686/]

I'm not sure where to apply it in this case though, but it looks like this bug will happen at every place where:
{code:java}
Files.createDirectories(flowXml.getParent());
{code}
exists and needs to be replaced with:
{code:java}
            // createDirectories would throw an exception if the directory exists but is a symbolic link
            if (Files.notExists(flowXml.getParent())) {
                Files.createDirectories(flowXml.getParent());
            }
{code}


was (Author: dima_k):
I have the same issue, I think it was seen previously with "conf" directory here:
https://issues.apache.org/jira/browse/NIFI-1746
The patch that fixes it last time is:
[https://github.com/apache/nifi/commit/5625686/]

I'm not sure where to apply it though, but it looks this bug will happen at every place where:
{code:java}
Files.createDirectories(flowXml.getParent());
{code}
exists and needs to be replaced with:
{code:java}
            // createDirectories would throw an exception if the directory exists but is a symbolic link
            if (Files.notExists(flowXml.getParent())) {
                Files.createDirectories(flowXml.getParent());
            }
{code}

> NiFi service fails to start with FileAlreadyExistsException when configured to use a directory that is symlink
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-2128
>                 URL: https://issues.apache.org/jira/browse/NIFI-2128
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 1.0.0
>            Reporter: Arpit Gupta
>            Priority: Major
>
> Configured content repository for NiFi to use a symlink. NiFi service startup failed with
> {code}
> 2016-06-22 17:55:08,267 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.util.ServiceConfigurationError: org.apache.nifi.controller.repository.ContentRepository: Provider org.apache.nifi.controller.repository.FileSystemRepository could not be instantiated
> java.util.ServiceConfigurationError: org.apache.nifi.controller.repository.ContentRepository: Provider org.apache.nifi.controller.repository.FileSystemRepository could not be instantiated
>         at java.util.ServiceLoader.fail(ServiceLoader.java:232) ~[na:1.8.0_60]
>         at java.util.ServiceLoader.access$100(ServiceLoader.java:185) ~[na:1.8.0_60]
>         at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) ~[na:1.8.0_60]
>         at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) ~[na:1.8.0_60]
>         at java.util.ServiceLoader$1.next(ServiceLoader.java:480) ~[na:1.8.0_60]
>         at org.apache.nifi.nar.ExtensionManager.loadExtensions(ExtensionManager.java:106) ~[nifi-nar-utils-0.6.0.2.0.0.0-187.jar:0.6.0.2.0.0.0-187]
>         at org.apache.nifi.nar.ExtensionManager.discoverExtensions(ExtensionManager.java:87) ~[nifi-nar-utils-0.6.0.2.0.0.0-187.jar:0.6.0.2.0.0.0-187]
>         at org.apache.nifi.NiFi.<init>(NiFi.java:120) ~[nifi-runtime-0.6.0.2.0.0.0-187.jar:0.6.0.2.0.0.0-187]
>         at org.apache.nifi.NiFi.main(NiFi.java:227) ~[nifi-runtime-0.6.0.2.0.0.0-187.jar:0.6.0.2.0.0.0-187]
> Caused by: java.nio.file.FileAlreadyExistsException: ./content_repository
>         at sun.nio.fs.UnixException.translateToIOException(UnixException.java:88) ~[na:1.8.0_60]
>         at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_60]
>         at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_60]
>         at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[na:1.8.0_60]
>         at java.nio.file.Files.createDirectory(Files.java:674) ~[na:1.8.0_60]
>         at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[na:1.8.0_60]
>         at java.nio.file.Files.createDirectories(Files.java:727) ~[na:1.8.0_60]
>         at org.apache.nifi.controller.repository.FileSystemRepository.<init>(FileSystemRepository.java:136) ~[nifi-framework-core-0.6.0.2.0.0.0-187.jar:0.6.0.2.0.0.0-187]
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_60]
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_60]
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_60]
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_60]
>         at java.lang.Class.newInstance(Class.java:442) ~[na:1.8.0_60]
>         at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) ~[na:1.8.0_60]
>         ... 6 common frames omitted
> 2016-06-22 17:55:08,269 INFO [Thread-1] org.apache.nifi.NiFi Initiating shutdown of Jetty web server...
> 2016-06-22 17:55:08,270 INFO [Thread-1] org.apache.nifi.NiFi Jetty web server shutdown completed (nicely or otherwise).
> {code}
> Tried both opendk8 and oracle jdk
> {code}
> /usr/jdk64/jdk1.8.0_60/bin/java -version
> java version "1.8.0_60"
> Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
> Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
> /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/java -version
> openjdk version "1.8.0_91"
> OpenJDK Runtime Environment (build 1.8.0_91-b14)
> OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)