Skip to content

singularity-tools.buildImage: permission denied #78743

@tbenst

Description

@tbenst

Describe the bug
I have programs.singularity.enable = true; but cannot build Singularity images.

buildSingularityBash.nix:

let
  pkgs = import <nixpkgs> {};
in
pkgs.singularity-tools.buildImage {
  name = "simpleBash"; 
  diskSize = 1024*25;
  contents = with pkgs; [ bash ]; 
  runScript = "/usr/bin/env bash";
}

To Reproduce

> nix-build buildSingularityBash.nix
these derivations will be built:
  /nix/store/x275z9b151gh5y2yxyn0q7l80w3afxqy-singularity-layer-simpleBash.drv
  /nix/store/jmhgycqan7iarpzyshcbg2y7g46qaz5h-runtime-deps.drv
  /nix/store/dis65ddv8fryzmkdjcwv4vlrki2v9id8-singularity-image-simpleBash.img.drv
these paths will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/548xy12y4pw1jbz6by6sz3scnz3f8qhw-singularity-3.2.1
copying path '/nix/store/548xy12y4pw1jbz6by6sz3scnz3f8qhw-singularity-3.2.1' from 'https://cache.nixos.org'...
building '/nix/store/x275z9b151gh5y2yxyn0q7l80w3afxqy-singularity-layer-simpleBash.drv'...
cp: cannot remove '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/bin/sh': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/bin/bash': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/basename': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/dirname': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/finfo': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/head': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/id': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/ln': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/logname': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/mkdir': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/mypid': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/pathchk': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/print': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/printenv': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/push': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/realpath': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/rmdir': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/setpgid': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/sleep': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/strftime': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/sync': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/tee': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/truefalse': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/tty': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/uname': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/unlink': Permission denied
cp: cannot create regular file '/nix/store/2pzfpx099da2lxf4kj8jay5jd7k4jl4j-singularity-layer-simpleBash/x7hj5hp24flxbx6jnnws5rnjs31g0ybw-bash-4.4-p23/lib/bash/whoami': Permission denied
builder for '/nix/store/x275z9b151gh5y2yxyn0q7l80w3afxqy-singularity-layer-simpleBash.drv' failed with exit code 1
cannot build derivation '/nix/store/jmhgycqan7iarpzyshcbg2y7g46qaz5h-runtime-deps.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/dis65ddv8fryzmkdjcwv4vlrki2v9id8-singularity-image-simpleBash.img.drv': 1 dependencies couldn't be built
error: build of '/nix/store/dis65ddv8fryzmkdjcwv4vlrki2v9id8-singularity-image-simpleBash.img.drv' failed

Running nix-build as sudo gives same error.

Maintainer information:
@jbedo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions