ERROR : Base home directory does not exist within the container

2,278 views
Skip to first unread message

moleps

unread,
Jun 27, 2017, 5:06:02 PM6/27/17
to singularity
I am trying to set up my docker image on a HPC at uni. We dont have root privileges and we load singularity using module load. Next, I used singularity pull from my docker hub and everything downloaded allright (i think) into an img.file.
However, I cannot for the world get this to work. 

singularity exec -H ~/rstu rstudio_tweak.img ls /


ERROR  : Base home directory does not exist within the container: /utx

ABORT  : Retval = 255



Any ideas? I cannot locate the .conf file for singularity. 


Best, /M


Tru Huynh

unread,
Jun 27, 2017, 5:25:16 PM6/27/17
to singu...@lbl.gov
On Tue, Jun 27, 2017 at 02:06:02PM -0700, moleps wrote:
> I am trying to set up my docker image on a HPC at uni. We dont have root
> privileges and we load singularity using module load.

game over: you need root privileges to install a running version of
singularity as there are root-suid executables...
[tru@elitebook840g3 ~]$ rpm -qlv singularity |grep rws
-rwsr-xr-x 1 root root 136640 Jun 26 19:14 /usr/libexec/singularity/bin/action-suid
-rwsr-xr-x 1 root root 78728 Jun 26 19:14 /usr/libexec/singularity/bin/create-suid
-rwsr-xr-x 1 root root 78736 Jun 26 19:14 /usr/libexec/singularity/bin/expand-suid
-rwsr-xr-x 1 root root 128360 Jun 26 19:14 /usr/libexec/singularity/bin/export-suid
-rwsr-xr-x 1 root root 128360 Jun 26 19:14 /usr/libexec/singularity/bin/import-suid
-rwsr-xr-x 1 root root 128352 Jun 26 19:14 /usr/libexec/singularity/bin/mount-suid

Ask your sysadmin to install singularity?

cheers

Tru

--
Dr Tru Huynh | http://www.pasteur.fr/research/bis
mailto:t...@pasteur.fr | tel/fax +33 1 45 68 87 37/19
Institut Pasteur, 25-28 rue du Docteur Roux, 75724 Paris CEDEX 15 France

David Godlove

unread,
Jun 27, 2017, 5:28:53 PM6/27/17
to singu...@lbl.gov
Sounds like their admin already installed Singularity for them, right? I would check to see if ~ is a symlink. If so you may need to bind mount the thing(s) it points to in order to get it working.
> --
> You received this message because you are subscribed to the Google Groups "singularity" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

vanessa s

unread,
Jun 27, 2017, 5:29:36 PM6/27/17
to singu...@lbl.gov
Is your home directory at /utx? If it's not finding that in the container, then it must be that overlayfs is disabled (so you can't make it at runtime). What you might want to specify it be bound somewhere else (eg, try the command and specify --home)

 -H/--home <spec>    A home directory specification.  spec can either be a
                        src path or src:dest pair.  src is the source path
                        of the home directory outside the container and dest


--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.



--
Vanessa Villamia Sochat
Stanford University '16

moleps

unread,
Jun 28, 2017, 5:39:29 AM6/28/17
to singu...@lbl.gov
But bind mount requires root access.

$ mount --bind ~ homep
mount: only root can do that

moleps

unread,
Jun 28, 2017, 5:52:03 AM6/28/17
to singu...@lbl.gov
My home directory is at /utx/user/molps. 

I tried 

$ singularity shell rstudio_tweak.img --home ~/
ERROR  : Base home directory does not exist within the container: /uio
ABORT  : Retval = 255

singularity shell rstudio_opp.img --home /utx/user/molps
ERROR  : Base home directory does not exist within the container: /uio
ABORT  : Retval = 255



To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

Gregory M. Kurtzer

unread,
Jul 1, 2017, 2:48:49 PM7/1/17
to singu...@lbl.gov
I'm not sure about the other errors, but the command syntax *requires* any shell options to be placed before the image name. So it should look like:

$ singularity shell --home ~/ rstudio_tweak.img

Option parsing is still not perfect in Singularity, but because we can't interfere with anything after the image name (as we assume it is a command or options themselves for a different program), we can't use the standard methods of doing this. It is on my TODO list. ;)

Good luck!

On Wed, Jun 28, 2017 at 2:51 AM, moleps <mol...@gmail.com> wrote:
My home directory is at /utx/user/molps. 

I tried 

$ singularity shell rstudio_tweak.img --home ~/
ERROR  : Base home directory does not exist within the container: /uio
ABORT  : Retval = 255

singularity shell rstudio_opp.img --home /utx/user/molps
ERROR  : Base home directory does not exist within the container: /uio
ABORT  : Retval = 255


On 27. jun. 2017, at 23.29, vanessa s <vso...@gmail.com> wrote:

Is your home directory at /utx? If it's not finding that in the container, then it must be that overlayfs is disabled (so you can't make it at runtime). What you might want to specify it be bound somewhere else (eg, try the command and specify --home)

 -H/--home <spec>    A home directory specification.  spec can either be a
                        src path or src:dest pair.  src is the source path
                        of the home directory outside the container and dest

On Tue, Jun 27, 2017 at 5:06 PM, moleps <mol...@gmail.com> wrote:
I am trying to set up my docker image on a HPC at uni. We dont have root privileges and we load singularity using module load. Next, I used singularity pull from my docker hub and everything downloaded allright (i think) into an img.file.
However, I cannot for the world get this to work. 

singularity exec -H ~/rstu rstudio_tweak.img ls /


ERROR  : Base home directory does not exist within the container: /utx

ABORT  : Retval = 255



Any ideas? I cannot locate the .conf file for singularity. 


Best, /M



--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.



--
Vanessa Villamia Sochat
Stanford University '16

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.



--
Gregory M. Kurtzer
CEO, SingularityWare, LLC.
Senior Architect, RStor
Computational Science Advisor, Lawrence Berkeley National Laboratory

Steve

unread,
Feb 5, 2018, 8:45:18 PM2/5/18
to singularity
Is there a solution to this? Our HPC just got Singularity installed, but I cannot even run basic demo containers because of this error. For example:

$ singularity pull shub://vsoch/singularity-images

$ ll vsoch-singularity-images-master-latest.simg
-rwxr-x--- 1 kellys04 molecpathlab 45M Feb  5 20:41 vsoch-singularity-images-master-latest.simg

$ singularity shell --home $HOME shub://vsoch/singularity-images
Progress |===================================| 100.0%
ERROR  : Base home directory does not exist within the container: /ifs
ABORT  : Retval = 255

Not sure I understand why the home directory matters either. Its a container, everything is supposed to be isolated from the host system, so why does it matter where the host system user's home directory is? And why would this prevent the container from running?
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.



--

v

unread,
Feb 5, 2018, 8:53:01 PM2/5/18
to singu...@lbl.gov
Can you try a shell with 

1) $HOME set to a location somewhere in /tmp to avoid mounting the /ifs, or 
2) --containall to see if skipping mounts helps?

To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

Steve

unread,
Feb 6, 2018, 12:59:00 PM2/6/18
to singularity
Ok, this seems to have worked:

$ new_home=/tmp/12345678
$ mkdir -p "$new_home"
$ singularity shell --home "$new_home" shub://vsoch/singularity-images
$ singularity shell --home "$new_home" shub://vsoch/singularity-images
Progress |===================================| 100.0%
Singularity: Invoking an interactive shell within container...


bash: command_prompt_date_string: command not found
Singularity vsoch-singularity-images-master-latest.simg:~> whoami
kellys04

bash: command_prompt_date_string: command not found
Singularity vsoch-singularity-images-master-latest.simg:~> pwd
/tmp/12345678

Singularity vsoch-singularity-images-master-latest.simg:~> cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

So, the container is definitely loaded. For comparison, the host system:

[2018-02-06 12:51:23]
kellys04@phoenix2:~$ cat /etc/*-release
CentOS release 6.8 (Final)
Cluster Manager v7.3
master
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
CentOS release 6.8 (Final)
CentOS release 6.8 (Final)

I will try to pull down a container with some demo programs to try out.

But I am really confused at the carry-over of aspects from the host system into the container. Why are the 'home' directory and username the same as on the host? What other things are getting carried over into the container? When I worked with Singularity on my Mac within the Vagrant VM, I never noticed any of these aspects.

Steve

unread,
Feb 6, 2018, 1:04:19 PM2/6/18
to singularity
Also upon further review, my post there highlights more confusing parts. For example, Singularity there keeps giving the message:


bash: command_prompt_date_string: command not found

in this case, `command_prompt_date_string` is a function from my .bashrc;

export PROMPT_COMMAND="echo; command_prompt_date_string"

This means that when Singularity is starting the container, my host user's `PROMPT_COMMAND` environment variable is being passed into the container? But the .bashrc file in my host user profile's home directory that defined it isnt?

Dave Dykstra

unread,
Feb 6, 2018, 6:42:51 PM2/6/18
to singu...@lbl.gov
Steve,

You are on CentOS 6 so you do not have overlayfs available to make
arbitrary directories on top of your image. Your $HOME probably has a
base path that is not in the image, I have that problem too as my home
directory begins with '/cloud'. I get around it with
--home $HOME:/srv
to map my home directory to a path that does exist in the image.

My suggested new feature in
https://github.com/singularityware/singularity/issues/1207
would avoid the need for having directories in the image to bind mount
onto.

Dave
> > On Mon, Feb 5, 2018 at 5:45 PM, Steve <skbi...@gmail.com <javascript:>>
> >> email to singularity...@lbl.gov <javascript:>.

victor sv

unread,
Feb 7, 2018, 3:17:09 AM2/7/18
to singu...@lbl.gov
Hi all,

we have a similar issue on RH6 during the migration of a storage system.

The $HOME root path changed from `/home` to `/newhome` and we solved it running singularity containers with the following flags by default:

$ singularity run -H $HOME:/home/$USER ...

At least, it work for us.

Hope it helps!
Víctor.

> To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.


--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

Steve

unread,
Mar 13, 2018, 10:31:27 AM3/13/18
to singularity, mol...@gmail.com
Following up on this, the data we need to process with the Singularity container is at locations like:

/ifs/data/runs/analysis1/sample1
/ifs/data/runs/analysis1/sample2
/ifs/data/runs/analysis2/sample1
/ifs/data/runs/analysis2/sample2
...
...
etc.

Does this mean that, in order to access the data from inside the Singularity container, the container needs to be re-built every time with the full corresponding path? Or is creating a container with the '/ifs/' base directory enough? How do you handle dynamically-created temporary directories e.g. in Nextflow?

v

unread,
Mar 13, 2018, 10:52:55 AM3/13/18
to singu...@lbl.gov, mol...@gmail.com
You definitely wouldn't want to create and rebuild each time - you want to bind the data from the host to the container. If you have overlayfs on your cluster then the bind could be made on the fly, and if not you would need to at least have the root for it already created. It looks like it's not happy about your custom home, so I would try to set --home to be somewhere else, and possibly bind your custom home to it. Something like --bind /utx:/home --home /home and then for the bind that doesn't exist, if it still gets angry, you can either create it or bind somewhere else that does exist!

--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.



--

John Hearns

unread,
Mar 13, 2018, 10:55:51 AM3/13/18
to singu...@lbl.gov
Steve says:
"Not sure I understand why the home directory matters either. Its a container, everything is supposed to be isolated from the host system, so why does it matter where the host system user's home directory is? And why would this prevent the container from running?"

Have a look at Dave Dykstras reply below.
Many HPC codes require the presence of something which looks like a HOME directory.  I mean this even apart from the 'normal' issues for finding your .bashrc (.cshrc) etc.
I say 'looks like' as it doesnt have to be your 'real' home directory, but it has to be there.

I am very willing to stand corrected, but it is one of the standard diagnostics to look for when a job does not run.


To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

Steve

unread,
Mar 14, 2018, 11:45:16 AM3/14/18
to singularity, mol...@gmail.com
We dont have OverlayFS but using '--bind' with a pre-made root directory of the same name within the container (e.g. '/ifs') and '--home' with a temporary directory seems to have solved it. Any other combination seems to result in the $PWD getting broken and the host path becoming inaccessible when programs try to run in the container.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.
Reply all
Reply to author
Forward
0 new messages