An error occurs by invoking singularity build with qrsh

Sometimes an error like the following occurs by invoking singularity build with qrsh.

 

INFO:   Starting build...
FATAL:   While performing build: conveyor failed to get: error getting username and password: error reading JSON file"/run/user/0/containers/auth.json": open /run/user/0/containers/auth.json:permission denied

 

As a workaround, do the following after qrsh:

 

unset XDG_RUNTIME_DIR

 

and then do singularity build

 

2020/12/03 update:

Unsetting XDG_RUNTIME_DIR is now done by the job scheduler, therefore the above is no longer required.