Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

error: Initializing container: Child ["mount" "--bind" "/host/home/<user>" "/home/<user>"] #3

Open

Description

@juhp

In Fedora 29 and also Silverblue 30 when I initially run coretoolbox, I see:

$ git clone https://github.com/cgwalters/coretoolbox
$ cd coretoolbox
$ cargo build
$ ./target/debug/coretoolbox 
Trying to pull docker://registry.fedoraproject.org/f30/fedora-toolbox:30...Getting image source signatures
Copying blob 934966bfd3bd done
Copying blob cd73137bf7d1 done
Copying config dbfb7129d3 done
Writing manifest to image destination
Storing signatures
dbfb7129d38b39508dab2878f108ff50759087100bfd9b08d0539e7a3de7cce3
coreos-toolbox
mount: /home/petersen: wrong fs type, bad option, bad superblock on /host/home/petersen, missing codepage or helper program, or other error.
error: Initializing container: Child ["mount" "--bind" "/host/home/petersen" "/home/petersen"] exited: exit code: 32
Error: exit status 1

Second run of coretoolbox gives:

$ ./target/debug/coretoolbox 
12b97d1dd6bd74d7550a0b89a3b9398512dab200701d54fb95e9d9caa83a709e
error: Initializing container: Opening statefile: No such file or directory (os error 2)
Error: exit status 1

Activity

  1. juhp commented on May 3, 2019

    @juhp
    Author

    (I don't have a home partition if that makes a difference.)

  2. cgwalters commented on May 9, 2019

    @cgwalters
    Owner

    Hmm, probably the bug is around how we're passing --volume for podman. Will look.

  3. juhp commented on May 29, 2019

    @juhp
    Author

    I don't see that any more with the latest code.

  4. reopened this on Jun 12, 2019
  5. juhp commented on Jun 12, 2019

    @juhp
    Author

    So actually this issue seems to be the real problem I hit.

    Using --rbind seems to fix/workaround the problem for me.

    diff --git a/src/coretoolbox.rs b/src/coretoolbox.rs
    index 943d275..aa43e81 100644
    --- a/src/coretoolbox.rs
    +++ b/src/coretoolbox.rs
    @@ -374,7 +374,7 @@ mod entrypoint {
             nix::unistd::chown(state.home.as_str(), Some(uid), Some(gid))?;
             let host_home = format!("/host{}", state.home);
             Command::new("mount")
    -            .args(&["--bind", host_home.as_str(), state.home.as_str()])
    +            .args(&["--rbind", host_home.as_str(), state.home.as_str()])
                 .run()?;
             Ok(())
         }
    
  6. changed the title [-]"mount --bind /host/home/USER /home/USER" failed[/-] [+]error: Initializing container: Child ["mount" "--bind" "/host/home/<user>" "/home/<user>"][/+] on Jun 12, 2019
  7. cgwalters commented on Jun 12, 2019

    @cgwalters
    Owner

    Using --rbind seems to fix/workaround the problem for me.

    Thanks! Indeed as a general rule we should use rbind. Mind doing a PR so you get credit?

  8. cgwalters commented on Jun 12, 2019

    @cgwalters
    Owner

    Although, I think what we're doing here with /home and /var/home on the host/container is still messy. We probably need to ensure the container matches up with whether the homedir is /home or /var/home on the host.

  9. cgwalters commented on Jun 12, 2019

    @cgwalters
    Owner

    (But that can be fixed separately)

  10. added a commit that references this issue on Jun 12, 2019
    ea5c2b2
  11. martymichal commented on Nov 1, 2019

    @martymichal

    Hi, just tried to run coretoolbox and I'm hitting an issue very similar to this one. Here's what I've got:

    omichal@harry-work debug ±(master) $ ./coretoolbox create -I fedora-toolbox:30
    omichal@harry-work debug ±(master) $ ./coretoolbox run
    mount: /var/home/omichal: special device /host/home/omichal does not exist.
    error: Initializing container (static): Child ["mount" "--rbind" "/host/home/omichal" "/home/omichal"] exited: exit code: 32
    Error: non zero exit code: 1: OCI runtime error
    omichal@harry-work debug ±(master) $ ./coretoolbox run
    error: Initializing container (static): Not a directory (os error 20)
    Error: non zero exit code: 1: OCI runtime error
    omichal@harry-work debug ±(master) $
    
  12. debarshiray commented on Jan 7, 2020

    @debarshiray

    I'm hitting an issue very similar to this one. Here's what I've got:

    omichal@harry-work debug ±(master) $ ./coretoolbox create -I fedora-toolbox:30
    omichal@harry-work debug ±(master) $ ./coretoolbox run
    mount: /var/home/omichal: special device /host/home/omichal does not exist.
    error: Initializing container (static): Child ["mount" "--rbind" "/host/home/omichal" "/home/omichal"] exited: exit code: 32
    Error: non zero exit code: 1: OCI runtime error
    omichal@harry-work debug ±(master) $ ./coretoolbox run
    error: Initializing container (static): Not a directory (os error 20)
    Error: non zero exit code: 1: OCI runtime error
    omichal@harry-work debug ±(master) $
    

    Yes, I am getting the same with podman-1.7.0-0.4.rc2.fc31.x86_64

  13. cgwalters commented on Feb 7, 2020

    @cgwalters
    Owner

    Can you paste the output of:

    echo $HOME
    ls -al $HOME
    findmnt $HOME
    
  14. Siosm commented on Feb 26, 2020

    @Siosm

    I am hitting the same issue on a Fedora Workstation 31 with podman-1.8.0-2.fc31.x86_64:

    $ coretoolbox run
    mount: /home/tim: special device /host/home/tim does not exist.
    error: Initializing container (static): Child ["mount" "--rbind" "/host/home/tim" "/home/tim"] exited: exit code: 32
    Error: non zero exit code: 1: OCI runtime error
    $ echo $HOME
    /home/tim
    $ ls -alhd $HOME
    drwx------. 28 tim tim 4.0K Feb 24 12:31 /home/tim
    $ findmnt $HOME
    <no output here>
    $ findmnt /home
    TARGET SOURCE         FSTYPE OPTIONS
    /home  /dev/nvme0n1p4 ext4   rw,relatime,seclabel
    

    I have not yet investigated further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions