Re: Operation not permitted errors [EXTERNAL]

2024-02-07 Thread Christopher Schultz

Shawn,

On 2/7/24 10:48, Beard, Shawn wrote:
It is on a Linux server, The file system mentions is actually a CIFS 
mount from a windows server. Its not creating a directory, only that 
file. Odd thing is that I can manually create a file in that directory 
as the user Tomcat is running as using touch.


Weird.

I wonder if deep down the UNIX-specific "copy" capabilities of 
commons-io/sun-io are becoming confused with the CIFS-mounted filesystem.


That's really not support to happen, though.

Can you write a simple Java-based program that simulates what's going on 
to determine if it's a general Java issue or the specific Tomcat-hosted 
environment that won't work?


-chris


-Original Message-
From: Christopher Schultz 
Sent: Tuesday, February 6, 2024 4:18 PM
To: users@tomcat.apache.org
Subject: Re: Operation not permitted errors [EXTERNAL]

** CAUTION: External message


Shawn,

On 2/6/24 13:52, Beard, Shawn wrote:
 > An application we have running in Tomcat 9 using Java 8 is throwing
 > this error when trying to create a file:
 >
 > java.nio.file.FileSystemException
 > /path/to/filesystem/202311WEB/040389461310_08_37_246.jpg: Operation
 > not permitted at
 > sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
 > at
 > sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
 > at
 > sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
 > at sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:283) at
 > sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:581) at
 > sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253
 > ) at java.nio.file.Files.copy(Files.java:1274) at
 > org.apache.commons.io.FileUtils.copyFile(FileUtils.java:850) at
 > org.apache.commons.io.FileUtils.copyFile(FileUtils.java:756) at
 > com.genexus.specific.java.FileUtils.copyFile(FileUtils.java:45) at
 > com.genexus.util.GXFileInfo.copy(GXFileInfo.java:88) at
 > com.genexus.util.GXFile.copy(GXFile.java:298) at
 > com.binet17.webservices.awsingresodenunciabs_img_impl.privateExecute(a
 > wsingresodenunciabs_img_impl.java:477
 >
 > We have tried opening up permissions on the files and directories,
 > adding users to the owner group, entries in the catalina.policy and
 > nothing seems to work. Any ideas?

This could be due to a lot of things, and it's unlikely to be related to 
Tomcat itself.


Based upon your file path and stack trace, I suspect you are using a 
UNIX-like operating system. That means it's not likely to be a locking 
issue like you can have on Windows. Those are a real pain to catch in 
the act. I would check a few things:


1. What is the euid and egid of the Tomcat process? Does it jive with 
the file permissions for /path/to/filesystem/2023blah.jpg? Remember 
that in order for a process to be able to write to a directory, it needs 
to have execute permissions from / all the way down to the last 
directory in the path.


2. Double-check the UMASK that the process is using. If you are creating 
directories, you'll need to make sure those directories have permissions 
which are appropriate for writing files in there afterward.


3. Remember that the problem could be either the source file or the 
destination file. From your path, I can't tell if the "operation not 
permitted" is on the source or destination.


-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents 
contain private, privileged and confidential information belonging to 
the sender. The information therein is solely for the use of the 
addressee. If your receipt of this transmission has occurred as the 
result of an error, please immediately notify us so we can arrange for 
the return of the documents. In such circumstances, you are advised that 
you may not disclose, copy, distribute or take any other action in 
reliance on the information transmitted.


*Please know that our company will never ask that you transfer money 
without verbal confirmation. If you receive an e-mail from our company 
or any third party purporting to represent our company requesting money 
be transferred, please report it to me immediately. Our company will 
only transfer money after receiving verbal confirmation.*


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Operation not permitted errors [EXTERNAL]

2024-02-07 Thread Tim Funk
Crazy wild guess looking at the stack trace ...
> sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
> at sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:283) at

A snoop of sun.nio.fs.UnixCopyFile shows its calling the system call
utimes() or futimes()  (probably utimes) - And the CIFS mount
doesn't support that.

A quick test would be to write a "1 liner" java program that uses
java.nio.file.Files.copy with paths in that CIFS  mount

-Tim

On Wed, Feb 7, 2024 at 10:49 AM Beard, Shawn 
wrote:

> It is on a Linux server, The file system mentions is actually a CIFS mount
> from a windows server. Its not creating a directory, only that file. Odd
> thing is that I can manually create a file in that directory as the user
> Tomcat is running as using touch.
>
> 
>
>
>
> On 2/6/24 13:52, Beard, Shawn wrote:
> > An application we have running in Tomcat 9 using Java 8 is throwing
> > this error when trying to create a file:
> >
> > java.nio.file.FileSystemException
> > /path/to/filesystem/202311WEB/040389461310_08_37_246.jpg: Operation
> > not permitted at
> > sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
> > at
> > sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
> > at
> > sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
> > at sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:283) at
> > sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:581) at
> > sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253
> > ) at java.nio.file.Files.copy(Files.java:1274) at
> > org.apache.commons.io.FileUtils.copyFile(FileUtils.java:850) at
> > org.apache.commons.io.FileUtils.copyFile(FileUtils.java:756) at
>
>


RE: Operation not permitted errors [EXTERNAL]

2024-02-07 Thread Beard, Shawn
It is on a Linux server, The file system mentions is actually a CIFS mount from 
a windows server. Its not creating a directory, only that file. Odd thing is 
that I can manually create a file in that directory as the user Tomcat is 
running as using touch.


Shawn   Beard• Team Lead Middleware
Middleware Engineering
[cid:image919906.png@69DD10BD.86A7ACEB]
3840 109th Street   ,   Urbandale   ,   IA  50322
Phone: +1-515-564-2528
Email:  sbe...@wrberkley.com
Website: https://berkleytechnologyservices.com/

Right Team. Right Technology. Simple and Secure.


-Original Message-
From: Christopher Schultz 
Sent: Tuesday, February 6, 2024 4:18 PM
To: users@tomcat.apache.org
Subject: Re: Operation not permitted errors [EXTERNAL]

** CAUTION: External message


Shawn,

On 2/6/24 13:52, Beard, Shawn wrote:
> An application we have running in Tomcat 9 using Java 8 is throwing
> this error when trying to create a file:
>
> java.nio.file.FileSystemException
> /path/to/filesystem/202311WEB/040389461310_08_37_246.jpg: Operation
> not permitted at
> sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
> at
> sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
> at
> sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
> at sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:283) at
> sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:581) at
> sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253
> ) at java.nio.file.Files.copy(Files.java:1274) at
> org.apache.commons.io.FileUtils.copyFile(FileUtils.java:850) at
> org.apache.commons.io.FileUtils.copyFile(FileUtils.java:756) at
> com.genexus.specific.java.FileUtils.copyFile(FileUtils.java:45) at
> com.genexus.util.GXFileInfo.copy(GXFileInfo.java:88) at
> com.genexus.util.GXFile.copy(GXFile.java:298) at
> com.binet17.webservices.awsingresodenunciabs_img_impl.privateExecute(a
> wsingresodenunciabs_img_impl.java:477
>
> We have tried opening up permissions on the files and directories,
> adding users to the owner group, entries in the catalina.policy and
> nothing seems to work. Any ideas?

This could be due to a lot of things, and it's unlikely to be related to Tomcat 
itself.

Based upon your file path and stack trace, I suspect you are using a UNIX-like 
operating system. That means it's not likely to be a locking issue like you can 
have on Windows. Those are a real pain to catch in the act. I would check a few 
things:

1. What is the euid and egid of the Tomcat process? Does it jive with the file 
permissions for /path/to/filesystem/2023blah.jpg? Remember that in order 
for a process to be able to write to a directory, it needs to have execute 
permissions from / all the way down to the last directory in the path.

2. Double-check the UMASK that the process is using. If you are creating 
directories, you'll need to make sure those directories have permissions which 
are appropriate for writing files in there afterward.

3. Remember that the problem could be either the source file or the destination 
file. From your path, I can't tell if the "operation not permitted" is on the 
source or destination.

-chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.

Please know that our company will never ask that you transfer money without 
verbal confirmation. If you receive an e-mail from our company or any third 
party purporting to represent our company requesting money be transferred, 
please report it to me immediately. Our company will only transfer money after 
receiving verbal confirmation.


Re: Tomcat not syncing existing sessions on restart

2024-02-07 Thread Manak Bisht
I think I have narrowed down the problem. For Tomcat 9 (v9.0.85), using
0.0.0.0 for the local member and receiver works fine. However, the same
does not work in Tomcat 8.5 (v8.5.98).

Sincerely,
Manak Bisht


On Fri, Feb 2, 2024 at 9:41 PM Mark Thomas  wrote:

> On 31/01/2024 13:33, Manak Bisht wrote:
> > I tried tweaking all the settings that I could think of but I am unable
> to
> > sync sessions on restart even on a stock Tomcat 8.5.98 installation using
> > your provided war. I am unable to identify whether this is actually a bug
> > or something wrong with my configuration (this is far more likely). Could
> > you please share your server.xml? Did you make any other changes?
> >
> > Sincerely,
> > Manak Bisht
>
> Here is the cluster configuration from the first node my test environment:
>
>   className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
>  channelSendOptions="6"
>  >
>
>className="org.apache.catalina.ha.session.DeltaManager"
>expireSessionsOnShutdown="false"
>notifyListenersOnReplication="true"
>/>
>
>className="org.apache.catalina.tribes.group.GroupChannel">
>
>  
> className="org.apache.catalina.tribes.membership.StaticMembershipService"
>  >
>
>className="org.apache.catalina.tribes.membership.StaticMember"
>port="4000"
>host="192.168.23.32"
>uniqueId="{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}"
>/>
>
>className="org.apache.catalina.tribes.membership.StaticMember"
>port="4000"
>host="192.168.23.33"
>uniqueId="{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2}"
>/>
>  
>
>className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>  address="192.168.23.32"
>  port="4000"
>  autoBind="0"
>  selectorTimeout="5000"
>  maxThreads="6"
>  />
>
>  
> className="org.apache.catalina.tribes.transport.ReplicationTransmitter"
>  >
>
>
> className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"
>/>
>
>  
>
>  
>
> className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"
>  performReadTest="true"
>  />
>  
>
> className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"
>  />
>
>
>className="org.apache.catalina.ha.deploy.FarmWarDeployer"
>tempDir="cluster-temp"
>deployDir="webapps"
>watchDir="cluster-watch"
>watchEnabled="true"
>/>
>
>className="org.apache.catalina.ha.tcp.ReplicationValve"
>filter=""
>/>
>
>className="org.apache.catalina.ha.session.JvmRouteBinderValve"
>/>
>
>   className="org.apache.catalina.ha.session.ClusterSessionListener"
> />
>
> 
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>