irods / irods_client_nfsrods

An nfs4j Virtual File System implementation supporting the iRODS Data Grid
BSD 3-Clause "New" or "Revised" License
8 stars 9 forks source link

write access, singularity (possible misconfiguration) #176

Closed DukeVimes closed 1 year ago

DukeVimes commented 1 year ago

I am running singularity 3.8 on redhat 7.9, irods version: 4.2.8 I created an equivalent singularity image:

BootStrap: docker
From: ubuntu:20.04

%files
  nfsrods.jar /
  start.sh /
  config/log4j.properties /nfsrods_config/log4j.properties

%environment
 export NFSRODS_CONFIG_HOME=/nfsrods_config

%post

  SSSD=false

 # The following environment variables are required to avoid errors
 # during the installation of openjdk-17-jdk.
  JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
  PATH="$JAVA_HOME/bin:$PATH"

  apt-get update && apt-get upgrade -y && \
  apt-get install -y apt-transport-https && \
  apt-get install -y openjdk-17-jdk libnss-sss

  chmod ugo+x /start.sh

  NFSRODS_CONFIG_HOME=/nfsrods_config

%runscript
  /start.sh

%startscript
  /start.sh

and run an instance via:

export SINGULARITY_BIND="${PWD}/config/exports:/nfsrods_config/exports:ro,\
${PWD}/config/server.json:/nfsrods_config/server.json:ro,\
/etc/passwd:/etc/passwd:ro,\
/var/lib/sss:/var/lib/sss"

sudo singularity instance start nfsrods.sif nfsrods_instance

I can happily mount the filesystem, and read files. However I am unable to create directories, or files.

I created a collection in irods, and made sure my irods-user is owner. in the nfs-mount i see:

drwx------ 1 vduke nfsnobody 0 Dec 7 16:59 test_nfsrods

I can create a subdirectory there, which sucessfully creates a collection owned by me. When I try copying a file into the test_nfsrods-directory I get:

cp: failed to close ‘./test_4.txt’: Remote I/O error

the nfsrods_instance.out is conrtains:

2022-12-07 17:42:47.787 DEBUG Thread-35 [IRODSVirtualFileSystem] - statPath - Returning cached stat information for [/zone/projects/test_nfsrods/test_4.txt] ...
2022-12-07 17:42:47.787 DEBUG Thread-35 [IRODSVirtualFileSystem] - vfs::checkAcl
2022-12-07 17:42:47.787 DEBUG Thread-35 [IRODSIdMapper] - resolveUser - _userID = 1109061
2022-12-07 17:42:47.787 DEBUG Thread-35 [IRODSVirtualFileSystem] - checkAcl - Returning cached access result for [/zone/projects/test_nfsrods/test_4.txt] ...
2022-12-07 17:42:47.787 DEBUG Thread-35 [IRODSVirtualFileSystem] - vfs::write
2022-12-07 17:42:47.787 DEBUG Thread-35 [IRODSVirtualFileSystem] - write - _inode path  = /zone/projects/test_nfsrods/test_4.txt
write - _data.length = 15
write - _offset      = 0
write - _count       = 15
2022-12-07 17:42:47.787 DEBUG Thread-35 [IRODSIdMapper] - resolveUser - _userID = 1109061
**2022-12-07 17:42:47.965 ERROR Thread-35 [IRODSVirtualFileSystem] - error code received from iRODS:-12000**
2022-12-07 17:42:47.965 ERROR Thread-35 [NFSServerV41] - Unhandled exception:
java.io.IOException: org.irods.jargon.core.exception.JargonException: error code received from iRODS:-12000
        at org.irods.nfsrods.vfs.IRODSVirtualFileSystem.write(IRODSVirtualFileSystem.java:1431) ~[nfsrods.jar:?]
        at org.dcache.nfs.vfs.PseudoFs.write(PseudoFs.java:291) ~[nfsrods.jar:?]
        at org.dcache.nfs.v4.OperationWRITE.process(OperationWRITE.java:82) ~[nfsrods.jar:?]
        at org.dcache.nfs.v4.AbstractOperationExecutor.execute(AbstractOperationExecutor.java:58) ~[nfsrods.jar:?]
        at org.dcache.nfs.v4.NFSServerV41.NFSPROC4_COMPOUND_4(NFSServerV41.java:188) ~[nfsrods.jar:?]
        at org.dcache.nfs.v4.xdr.nfs4_prot_NFS4_PROGRAM_ServerStub.dispatchOncRpcCall(nfs4_prot_NFS4_PROGRAM_ServerStub.java:48) ~[nfsrods.jar:?]

-12000 is SYS_UNMATCHED_API_NUM?

thats where I gave up.

Apart from my own user I see no other named user in the nfs-share, only "nfsnobody". Which led me to believe the sss-mapping or passwd doesnt work as expected. Indeed the /etc/passwd in the container co different from the /etc/passwd on the host-machine, however at least my own user is correct.

korydraughn commented 1 year ago

What version of iRODS is NFSRODS connecting to?

DukeVimes commented 1 year ago

irods version: 4.2.8

trel commented 1 year ago

Requirements: iRODS v4.2.9+

DukeVimes commented 1 year ago

hmm, that`s true. Sorry. I'll try with 4.3. next week, but seems my nonchalance regarding the requirements got me there...

edited: trel

trel commented 1 year ago

closing - thanks!