[XADISK-157] InsufficientPermissionOnFileException sometimes missing [READ_DIRECTORY] Created: 07/Dec/13  Updated: 07/Dec/13

Status: Open
Project: xadisk
Component/s: filesystem
Affects Version/s: 1.2.2
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: gunnar_zarncke Assignee: Nitin Verma
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Open JDK 1.6 and 1.7, Windows 7 and Linux (RedHat and Ubuntu)


I often get InsufficientPermissionOnFileException on files where the real permissions in the file-system do not show any missing permissions.
I ignore the error and consider the file non-readable with the following code:

try {
Session session = getSession();
File file = getFile();
return session.fileExists(file) && !session.fileExistsAndIsDirectory(file);
} catch (final Exception e) {
return false;

I am wondering what the causes may be for this issue.

I have seen this happen in the following circumstances:

  • Checking existence of a directory the parent directory of which doesn't exist either (in code which creates neccessary parent directories as needed).
  • Checking existence of hard-linked files (here the cause is less clear).

Stacktrace Fragment:

org.xadisk.filesystem.exceptions.InsufficientPermissionOnFileException: Permission of type [READ_DIRECTORY] is needed over the file/directory with path [/var/lib/preprocessor/configversions/20131206T185427.534Z/sequences] for the i/o operation to succeed.
at org.xadisk.filesystem.NativeSession.checkPermission(NativeSession.java:1157)
at org.xadisk.filesystem.NativeSession.fileExists(NativeSession.java:407)
at org.xadisk.filesystem.NativeSession.fileExists(NativeSession.java:391)

Comment by Nitin Verma [ 07/Dec/13 ]

Thanks Gunnar.

The case of parent directory missing you mentioned is a known issue: https://java.net/jira/browse/XADISK-120. Please let me know if you discover any detail about the hard-link cases.

Generated at Sun Aug 30 14:06:15 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.