nextflow-io / nextflow-io/nextflow

Staging /dev causes apptainer/singularity processes to fail.

Open
#6,072 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

software/singularity stale
Dominant language
Groovy
Stars
3.5k
Forks
811
Avg merge
2d 11h
Merged PRs (30d)
61

Description

Bug report

Expected behavior and actual behavior

Run a process that takes a file parameter as one of the inputs, set the file to be /dev/null, and run it in an apptainer/singularity container.

Under local executor and Docker (all I can test), everything works fine.

Under apptainer, the process fails due to some weird issue with /dev being staged and bound within the process.

Steps to reproduce the problem

Check out https://github.com/alanhoyle/nf-null-singularity-staging and run bash ./run_me_test.sh on a machine that has Singularity available.

The test script runs 6 total nextflow workflows. With the local executor, it runs using a real file as input, and then with /dev/null as the input file. Then it does the same thing using Docker container, and then the same thing using apptainer.

Program output

(Copy and paste the output produced by the failing execution. Please highlight it as a code block. Whenever possible upload the .nextflow.log file.)

 N E X T F L O W   ~  version 25.04.1

Launching `./main.nf` [evil_hypatia] DSL2 - revision: de3f7f1720

executor >  local (1)
executor >  local (1)
[6b/53b117] print_input [  0%] 0 of 1 ✘
ERROR ~ Error executing process > 'print_input'

Caused by:
  Process `print_input` terminated with an error exit status (1)


Command executed:

  echo "Input file contents:"
  cat null
  echo "stage dir contents:" > output.txt
  ls -l >> output.txt
  echo "" >> output.txt

  echo "input file contents:" >> output.txt
  cat null >> output.txt

Command exit status:
  1

Command output:
  Input file contents:

Command error:
  Input file contents:
  cat: null: Permission denied

Work dir:
  /datastore/scratch/users/alanh/nextflow/6b/53b11745de73f15010e2b6e1b882cb

Container:
  /home/alanh/singularity/ubuntu-latest.img

Tip: when you have fixed the problem you can continue the execution adding the option `-resume` to the run command line

 -- Check '.nextflow.log' file for details
Environment
  • Nextflow version: 25.04.1
  • Java version: openjdk 23.0.2-internal 2025-01-21
  • Operating system: Linux
  • Bash version: GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)
Additional context

This seems to be an issue whenever -B /dev is added to an apptainer run or apptainer exec command to bind that dir into the container.

apptainer run docker://ubuntu:latest works fine, but apptainer run -B /dev docker://ubuntu:latest throws a ton of errors, even outside of the Nextflow context.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked nf-null-singularity-staging reproduction and run bash ./run_me_test.sh, comparing the local, Docker, and Apptainer cases. Inspect the .nextflow.log and the generated command involving -B /dev. Done means the /dev/null input workflow succeeds under Apptainer without the permission error.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, docker, linux
Domain
devops, hpc, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.