glusterfs-java-filesystem
glusterfs-java-filesystem copied to clipboard
Having trouble in creating a file
Files.createFile(glusterPath) with or without a set of pre-permissions does not create a file, nor an exception is thrown. What would be the cause of it?
Check the logs on your glusterfs servers. There should be some indication there. Is the client connecting? Is the server giving an error?
Running example , /baz is not a file, it is a directory and show error:
sun.nio.fs.LinuxFileSystemProvider@12a3a380
com.sun.nio.zipfs.ZipFileSystemProvider@29453f44
com.peircean.glusterfs.GlusterFileSystemProvider@5cad8086
com.peircean.glusterfs.GlusterFileSystemProvider@5cad8086
mountPath/
TOTAL SPACE: 85886742528
USABLE SPACE: 73609973760
UNALLOCATED SPACE: 73609973760
gluster://10.0.3.33:logs
Is /foo/.bar hidden? true
Is /foo/bar hidden? false
glusterPath.getClass:=class com.peircean.glusterfs.GlusterPath
glusterPath:=/baz
glusterPath.getFileSystem().toString:=gluster://10.0.3.33:logs
java.nio.file.FileAlreadyExistsException: /baz
File exists, created at 2019-10-30T15:10:07Z
java.nio.file.FileAlreadyExistsException: /baz
at com.peircean.glusterfs.GlusterFileChannel.init(GlusterFileChannel.java:78)
at com.peircean.glusterfs.GlusterFileSystemProvider.newFileChannelHelper(GlusterFileSystemProvider.java:129)
at com.peircean.glusterfs.GlusterFileSystemProvider.newByteChannel(GlusterFileSystemProvider.java:119)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.createFile(Files.java:632)
at com.peircean.glusterfs.example.Example.main(Example.java:70)
Exception in thread "main" java.io.IOException: Unable to create or open file '/baz' on volume 'gluster://10.0.3.33:logs'
at com.peircean.glusterfs.GlusterFileChannel.init(GlusterFileChannel.java:86)
at com.peircean.glusterfs.GlusterFileSystemProvider.newFileChannelHelper(GlusterFileSystemProvider.java:129)
at com.peircean.glusterfs.GlusterFileSystemProvider.newByteChannel(GlusterFileSystemProvider.java:119)
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
at java.nio.file.Files.newOutputStream(Files.java:216)
at java.nio.file.Files.write(Files.java:3292)
at com.peircean.glusterfs.example.Example.main(Example.java:79)
[INFO] ---------------------------------------------------------------------
It is about permissions ... always try applygin 0777 Tx