Skip to content

Sporadic EPERM from post start process fusermount unmount in GH actions CI environment. #4245

Description

@adamnovak

Before you report an issue...

Version of Singularity

This is with singularity-ce 4.5.0 from https://github.com/sylabs/singularity/releases/download/v4.5.0/singularity-ce_4.5.0-noble_amd64.deb

Describe the bug

When cwltool runs its continuous integration tests (which can involve running several simultaneous Singularity containers against the same SIF files), then on some CI runs, many tests will fail due to apparently not having permission to unmount something.

I reported this as #4044 (comment)

To Reproduce

Steps to reproduce the behavior:

Run the cwltool project's Github Actions continuous integration tests a few times. Commit common-workflow-language/cwltool@b4c828c should work, but commit common-workflow-language/cwltool@c0aab3f will use Singularity 4.5.0.

The tests that fail for this reason are generally the various Python version unit or mypy tests, such as: https://github.com/common-workflow-language/cwltool/actions/runs/30581144108/job/91005564119?pr=2284#step:9:4314

The offending logs look like:

  INFO [job iwdr-entry.cwl] /tmp/250rr2cg$ singularity \
      --quiet \
      run \
      --contain \
      --ipc \
      --cleanenv \
      --no-eval \
      --userns \
      --home \
      /tmp/250rr2cg:/YrcoOu \
      --mount=type=bind,source=/tmp/tp1ggaz1,target=/tmp \
      --pwd \
      /YrcoOu \
      /home/runner/work/cwltool/cwltool/docker.io_s_debian:stable-slim.sif \
      cat \
      example.conf
  WARNING: path /overlay-lowerdir/tmp is already overridden by /tmp/tp1ggaz1, replacing with /var/lib/singularity/mnt/session/tmp
  /usr/local/bin/fusermount3: failed to unmount /tmp/rootfs-23770563/root: Operation not permitted
  FATAL:   While running host post start tasks: while unmounting fuse directory: /tmp/rootfs-23770563/root: exit status 1
  /usr/local/bin/fusermount3: failed to unmount /tmp/rootfs-23770563/root: Operation not permitted
  CONFIGVAR=hello
  ERROR:   Failed to clean up FUSE mount: while unmounting fuse directory: /tmp/rootfs-23770563/root: exit status 1
  ERROR:   While running host cleanup tasks: encountered errors during CleanupHost: [while unmounting fuse directory: /tmp/rootfs-23770563/root: exit status 1]
  ERROR:   Unprivileged host cleanup failed: host cleanup failed
  FATAL:   host post start process failed: host post start tasks failed

So, under some circumstances (possibly simultaneous execution of other similar commands), when we run that singularity command (with docker.io/debian:stable-slim pulled to that SIF file and file /tmp/250rr2cg/example.conf that exists), Singularity can fail like this at the cleanup stage.

Expected behavior

No test failures should be caused by an Operation not permitted during Singularity's unmount step. If Singularity FUSE-mounted the SIF, it really should be expected to be able to unmount it. If files are somehow still open through the mount when Singularity goes to clean it up and are blocking the unmount (maybe because another simultaneous Singularity run is using it?) then Singularity should wait for them to close before trying to do the unmount.

OS / Linux Distribution

I don't have an interactive shell, but this is happening on the Github Actions flavor of Ubuntu 24.04.

  Image: ubuntu-24.04
  Version: 20260726.254.1
  Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20260726.254/images/ubuntu/Ubuntu2404-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20260726.254

Installation Method

We install Singularity from the release .deb files:

          wget --no-verbose https://github.com/sylabs/singularity/releases/download/v4.5.0/singularity-ce_4.5.0-noble_amd64.deb
          sudo apt-get install -y ./singularity-ce_4.5.0-noble_amd64.deb environment-modules

Additional context

I reported this originally at #4044 (comment), but it turns out this issue is different because the underlying FUSE unmount failure is happening because of a different error code (Operation not permitted).

This bug doesn't occur 100% of the time; sometimes the relevant CI tests pass.

When it does occur, it seems to occur several times. Many tests in a single CI test job will fail with similar errors, varying in the temporary directory paths.

This smells a little bit like #2698, which failed at the same point for a different reason.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions