WFLYUT0095: the path doesn't exist on file system

591 views
Skip to first unread message

Osman Balci

unread,
Feb 13, 2021, 11:30:38 AM2/13/21
to WildFly

On Amazon Linux 2 AMI:

$ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/

$ export PATH=$PATH:$JAVA_HOME/bin

$ cd /opt/wildfly/bin

$ ./jboss-cli.sh -c
Authenticating against security realm: ManagementRealm
Username: wildflyadmin
Password:

[standalone@localhost:9990 /] /subsystem=undertow/configuration=handler/file=PhotosDirHandler/:add(cache-buffer-size=1024,cache-buffers=1024,directory-listing=true,follow-symlink=true,path=/home/ec2-user/DocRoot/CloudStorage/PhotoStorage/)

{

    "outcome" => "failed",

    "failure-description" => "WFLYUT0095: the path ['/home/ec2-user/DocRoot/CloudStorage/PhotoStorage/'] doesn't exist on file system"

,

    "rolled-back" => true

}

 [standalone@localhost:9990 /]

 The path exists on Linux 2 file system:

$ ls /home/ec2-user/DocRoot/CloudStorage/PhotoStorage/
defaultUserPhoto.png

DocRoot is owned by ec2-user with read/write/delete permissions recursively so that WildFly can write into the directories.

$ ls -l
drwxrwxrwx 3 ec2-user ec2-user      26 Feb 12 19:51 DocRoot

Why does WildFly think that the path does not exist?

Osman Balci

unread,
Feb 18, 2021, 7:50:31 PM2/18/21
to WildFly
I will very much appreciate it if someone please help me resolve this WildFly error message. Thank you in advance.

Jean Francois Denise

unread,
Feb 19, 2021, 4:00:33 AM2/19/21
to wil...@googlegroups.com
Hi,
if your file exists and is accessible, I suspect that the problem is linked to upper cases in the path. WildFly calls Path.toRealPath[1] that is platform dependent. It could lower case the path that then doesn't exist (just guessing).
Could you try a path without upper cases as a workaround? You should log an issue.

[1]https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/handlers/FileHandler.java#L121
--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/5c03ec4c-109c-48a1-bbef-83a0b4d2186dn%40googlegroups.com.


Osman Balci

unread,
Feb 19, 2021, 10:43:43 AM2/19/21
to WildFly

Balci@dolphin ~ % ssh -i Documents/AWS/EC2ServerAccessKeyPair.pem ec2-...@54.92.194.218
ec2-...@54.92.194.218's password: 
Last login: Fri Feb 19 10:00:23 2021 from dolphin.cs.vt.edu

       __|  __|_  )

       _|  (     /   Amazon Linux 2 AMI

      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/

[ec2-user@ip-172-31-18-211 ~]$ ls /home/ec2-user/docroot/cloudstorage/photostorage/
defaultUserPhoto.png

[ec2-user@ip-172-31-18-211 ~]$ sudo chmod -R a+rw /home/ec2-user/docroot

[ec2-user@ip-172-31-18-211 ~]$ ls -l /home/ec2-user
total 3880
-rw-rw-rw- 1 ec2-user ec2-user    1821 Feb 12 12:57 CloudDriveDB.sql
-rw-rw-rw- 1 ec2-user ec2-user    7142 Feb  3 14:22 CountriesDB.sql
drwxrwxrwx 3 ec2-user ec2-user      26 Feb 19 10:08 docroot
drwxrwxrwx 3 root     root         149 Jun 16  2020 mysql-connector-java-8.0.21
-rw-rw-rw- 1 root     root     3956740 Jun 16  2020 mysql-connector-java-8.0.21.tar.gz

[ec2-user@ip-172-31-18-211 ~]$ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.7.10-4.amzn2.0.1.x86_64/
[ec2-user@ip-172-31-18-211 ~]$ export PATH=$PATH:$JAVA_HOME/bin
[ec2-user@ip-172-31-18-211 ~]$ cd /opt/wildfly/bin
[ec2-user@ip-172-31-18-211 bin]$ ./jboss-cli.sh -c

Authenticating against security realm: ManagementRealm

Username: wildflyadmin
Password: 

[standalone@localhost:9990 /] /subsystem=undertow/configuration=handler/file=PhotosDirHandler/:add(cache-buffer-size=1024,cache-buffers=1024,directory-listing=true,follow-symlink=true,path=/home/ec2-user/docroot/cloudstorage/photostorage/)

{
    "outcome" => "failed",

    "failure-description" => "WFLYUT0095: the path

    ['/home/ec2-user/docroot/cloudstorage/photostorage/'] doesn't exist on file system",
    "rolled-back" => true
}

[standalone@localhost:9990 /] 

I am getting the same error message after changing all of the file path directory names to lowercase. It does not seem to be a case sensitive issue.

It is quite common to store/retrieve files outside of the WAR deployment directory instead of using the database for storage and retrieval of those files. I am surprised that it does not work on Amazon Linux 2, which is like CentOS and RHEL. It worked very nicely on my iMac running macOS Catalina. What would cause it not to work on Amazon Linux 2? 

Any other potential solutions will be appreciated...

Tomaž Cerar

unread,
Feb 19, 2021, 3:56:12 PM2/19/21
to Osman Balci, WildFly
Check if the user under which WildFly is running can access that folder.
It could be a simple permissions issue.

--
tomaž

Osman Balci

unread,
Feb 19, 2021, 4:50:19 PM2/19/21
to WildFly
Thanks for your suggestion Tomaž

I changed the ownership of the DocRoot directory recursively to wildfly user and wildfly group.
$ sudo chown wildfly:wildfly -R DocRoot

drwxrwxrwx 4 wildfly wildfly 45 Feb 19 16:27 CloudStorage
drwxrwxrwx 2 wildfly wildfly  6 Feb 12 14:51 FileStorage
drwxrwxrwx 2 wildfly wildfly 34 Feb 12 14:52 PhotoStorage
-rw-rw-rw- 1 wildfly wildfly 2692 Feb 12 14:49 defaultUserPhoto.png

$ cd /opt/wildfly/bin
$ ./jboss-cli.sh -c
Authenticating against security realm: ManagementRealm
Username: wildflyadmin
Password: 
[standalone@localhost:9990 /] /subsystem=undertow/configuration=handler/file=PhotosDirHandler/:add(cache-buffer-size=1024,cache-buffers=1024,directory-listing=true,follow-symlink=true,path=/home/ec2-user/DocRoot/CloudStorage/PhotoStorage/)
{
    "outcome" => "failed",
    "failure-description" => "WFLYUT0095: the path ['/home/ec2-user/DocRoot/CloudStorage/PhotoStorage/'] doesn't exist on file system",
    "rolled-back" => true
}

No luck unfortunately!

Boris Unckel

unread,
Feb 20, 2021, 5:05:09 AM2/20/21
to WildFly
Hello Osman,

please check with
lsattr /home
The result should be like this:
--------------e----- /home

Kind regards
Boris

Jignesh Patel

unread,
Feb 20, 2021, 9:26:45 AM2/20/21
to WildFly

I am trying to use lettuce on wildfly 10 but then wildfly gives me following error.

How do I let wildfly know about using SSLParameters.  I am using Corretto JDK.

 

22:09:46,623 ERROR [com.icare.elasticacheclient] (Thread-104) [MSC service thread 1-1] Invocation of 'init' failed.: org.apache.felix.log.LogException: java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: javax/net/ssl/SSLParameters

                at io.lettuce.core.SslOptions$Builder.<init>(SslOptions.java:170)

                at io.lettuce.core.SslOptions$Builder.<init>(SslOptions.java:148)

                at io.lettuce.core.SslOptions.builder(SslOptions.java:133)

                at io.lettuce.core.SslOptions.create(SslOptions.java:142)

                at io.lettuce.core.ClientOptions.<clinit>(ClientOptions.java:57)

                at io.lettuce.core.AbstractRedisClient.<init>(AbstractRedisClient.java:88)

                at io.lettuce.core.cluster.RedisClusterClient.<init>(RedisClusterClient.java:175)

                at io.lettuce.core.cluster.RedisClusterClient.create(RedisClusterClient.java:243)

                at io.lettuce.core.cluster.RedisClusterClient.create(RedisClusterClient.java:230)

                at com.icare.elasticacheclnt.util.ConnectToRedisCluster.establishConnection(ConnectToRedisCluster.java:92)

                at com.icare.elasticacheclnt.util.ConnectToRedisCluster.createWrappedConnectionPool(ConnectToRedisCluster.java:104)

                at com.icare.elasticacheclnt.util.ConnectToRedisCluster.<init>(ConnectToRedisCluster.java:45)

                at com.icare.elasticacheclnt.service.impl.ElastiCacheClientImpl.init(ElastiCacheClientImpl.java:59)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_275]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_275]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_275]

                at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_275]

                at org.apache.felix.dm.impl.InvocationUtil.invokeMethod(InvocationUtil.java:131)

                at org.apache.felix.dm.impl.InvocationUtil.invokeCallbackMethod(InvocationUtil.java:86)

                at org.apache.felix.dm.impl.ComponentImpl.invokeCallbackMethod(ComponentImpl.java:540)

                at org.apache.felix.dm.impl.ComponentImpl.invoke(ComponentImpl.java:1493)

                at org.apache.felix.dm.impl.ComponentImpl.performTransition(ComponentImpl.java:984)

                at org.apache.felix.dm.impl.ComponentImpl.handleChange(ComponentImpl.java:926)

                at org.apache.felix.dm.impl.ComponentImpl.lambda$2(ComponentImpl.java:408)

                at org.apache.felix.dm.impl.SerialExecutor.runTask(SerialExecutor.java:138)

                at org.apache.felix.dm.impl.SerialExecutor.runTasks(SerialExecutor.java:120)

                at org.apache.felix.dm.impl.SerialExecutor.execute(SerialExecutor.java:86)

                at org.apache.felix.dm.impl.SerialExecutor.execute(SerialExecutor.java:105)

                at org.apache.felix.dm.impl.ComponentImpl.start(ComponentImpl.java:406)

                at org.apache.felix.dm.impl.ComponentScheduler.add(ComponentScheduler.java:69)

                at org.apache.felix.dm.DependencyManager.add(DependencyManager.java:175)

                at com.icare.common.service.BaseDependencyResolver.init(BaseDependencyResolver.java:52)

                at org.apache.felix.dm.DependencyActivatorBase.start(DependencyActivatorBase.java:75)

                at org.jboss.osgi.framework.internal.UserBundleState.startInternalNow(UserBundleState.java:598) [jbosgi-framework-core-5.0.1.Final.jar:5.0.1.Final]

                at org.jboss.osgi.framework.internal.UserBundleState.startInternal(UserBundleState.java:524) [jbosgi-framework-core-5.0.1.Final.jar:5.0.1.Final]

                at org.jboss.osgi.framework.internal.BundleManagerPlugin.startBundle(BundleManagerPlugin.java:576) [jbosgi-framework-core-5.0.1.Final.jar:5.0.1.Final]

                at org.jboss.as.osgi.deployment.BundleActivateProcessor$BundleActivateService.start(BundleActivateProcessor.java:129)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_275]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_275]

                at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_275]

Caused by: org.apache.felix.log.LogException: java.lang.NoClassDefFoundError: javax/net/ssl/SSLParameters

                ... 42 more

Caused by: java.lang.ClassNotFoundException: javax.net.ssl.SSLParameters from [Module "deployment.elasticacheclient-1.0.0.jar:main" from Service Module Loader]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198) [jboss-modules.jar:1.5.2.Final]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363) [jboss-modules.jar:1.5.2.Final]

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351) [jboss-modules.jar:1.5.2.Final]

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93) [jboss-modules.jar:1.5.2.Final]

                ... 42 mor

Osman Balci

unread,
Feb 20, 2021, 10:20:53 AM2/20/21
to WildFly
Thanks for your suggestion Boris.

https://aws.amazon.com/amazon-linux-2/
ec2-user@ip-172-31-18-211 ~]$ lsattr /home

---------------- /home/ec2-user

Interesting! What does this imply? How should I specify the path? Thanks!


Boris Unckel

unread,
Feb 20, 2021, 2:07:56 PM2/20/21
to WildFly
All dash - does not indicate a problem as far as I know. I have observed one case where lsattr reported "Operation not supported" or "IOCTL not matching for reading flag". The java.nio classes (or native implementation?) had issues with it. But I did not find out the real root cause. Directories with all dash or the single 'e' had no problem.

To answer your second question: please read the manpage of chattr. But I think it does not help in the current case.

Osman Balci

unread,
Feb 20, 2021, 2:14:48 PM2/20/21
to WildFly
I resolved the problem! After Boris' comment, I decided not to use the /home/ec2-user file path. I put the external storage directories under WildFly installation directory and then set the permissions and ownership as follows:

$ sudo chmod -R a+rw DocRoot
$ sudo chown -R wildfly:wildfly DocRoot

It worked nicely as follows!

[ec2-user@ip-172-31-18-211 bin]$ ./jboss-cli.sh -c
Authenticating against security realm: ManagementRealm
Username: wildflyadmin
Password: 
[standalone@localhost:9990 /] /subsystem=undertow/configuration=handler/file=PhotosDirHandler/:add(cache-buffer-size=1024,cache-buffers=1024,directory-listing=true,follow-symlink=true,path=/opt/wildfly/DocRoot/CloudStorage/PhotoStorage/)
{"outcome" => "success"}

[standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/location=\/photos/:add(handler=PhotosDirHandler)
{"outcome" => "success"}

[standalone@localhost:9990 /] /subsystem=undertow/configuration=handler/file=FilesDirHandler/:add(cache-buffer-size=1024,cache-buffers=1024,directory-listing=true,follow-symlink=true,path=/opt/wildfly/DocRoot/CloudStorage/FileStorage/)
{"outcome" => "success"}

[standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/location=\/files/:add(handler=FilesDirHandler)
{"outcome" => "success"}

[standalone@localhost:9990 /] :reload
{
    "outcome" => "success",
    "result" => undefined
}

After I deployed the app to my Amazon AWS EC2 instance running Linux 2, I got the network error: ERR_CONNECTION_REFUSED. I realized that web browsers do not like 'localhost' in URL when run remotely. Therefore, I had to specify the IP address as follows:

public static final String FILES_URI = "http://54.92.194.218:8080/files/";
public static final String PHOTOS_URI = "http://54.92.194.218:8080/photos/";

My tutorial app CloudDrive now runs very nicely at http://54.92.194.218:8080/CloudDrive-Balci/ 

Thanks to everyone for their help!

Prof. Osman Balci

Boris Unckel

unread,
Feb 20, 2021, 2:24:50 PM2/20/21
to WildFly
Interesting. Could you please post the result of lsattr /opt/wildfly/DocRoot/CloudStorage/PhotoStorage/ ? And java -version ?
One thing; A tutorial should not teach people to grant rights with chmod a+rw. Please take the time to remove all rights from others and specify for owner/group only. The copy'n'paste junkies will never read the second part of the tutorial "how to harden a server" after they brought the sample to work ;-)

Osman Balci

unread,
Feb 20, 2021, 2:44:30 PM2/20/21
to WildFly

https://aws.amazon.com/amazon-linux-2/

[ec2-user@ip-172-31-18-211 ~]$ lsattr /opt/wildfly/DocRoot/CloudStorage/PhotoStorage/ 

---------------- /opt/wildfly/DocRoot/CloudStorage/PhotoStorage/defaultUserPhoto.png

---------------- /opt/wildfly/DocRoot/CloudStorage/PhotoStorage/2.jpeg

---------------- /opt/wildfly/DocRoot/CloudStorage/PhotoStorage/2_thumbnail.jpeg

[ec2-user@ip-172-31-18-211 ~]$ lsattr /opt/wildfly/DocRoot/CloudStorage/FileStorage/

---------------- /opt/wildfly/DocRoot/CloudStorage/FileStorage/2_Notes.txt

---------------- /opt/wildfly/DocRoot/CloudStorage/FileStorage/2_Sample WebM File.webm

---------------- /opt/wildfly/DocRoot/CloudStorage/FileStorage/2_Sample MP4 File.mp4

---------------- /opt/wildfly/DocRoot/CloudStorage/FileStorage/2_Catching Fire.png

---------------- /opt/wildfly/DocRoot/CloudStorage/FileStorage/2_CSD Platforms.pdf

---------------- /opt/wildfly/DocRoot/CloudStorage/FileStorage/2_Sample OGG File.ogg

[ec2-user@ip-172-31-18-211 ~]$ 

[ec2-user@ip-172-31-18-211 ~]$ java -version

openjdk version "11.0.7" 2020-04-14 LTS

OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)

OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)

[ec2-user@ip-172-31-18-211 ~]$ 

-------------

I agree with you about the a+rw security issues and I will correct it in my tutorials later. I have been very busy trying to convert all my tutorial apps from NetBeans / GlassFish to IntelliJ IDEA Ultimate / WildFly. 

I can testify that WildFly is at least ten times better than GlassFish!

Reply all
Reply to author
Forward
0 new messages