Nextflow 24.10.4 adds unsupported --mkdir flag to mamba create command

Hello all. Sorry for the probably very dumb question and thanks in advance for your patience and your time!
I’m developing a Nextflow pipeline and encountering an issue with installation of the environment using mamba instead of conda.

My environment:

  • Nextflow: 24.10.4
  • Mamba: 2.0.7
  • Conda: 25.1.1

The Issue: When running my pipeline with Mamba enabled, the workflow fails with:

Failed to create Conda environment
command: mamba create --strict-channel-priority --mkdir --yes --quiet --prefix /home/ubuntu/hpc-home/PHORAGER_conda_cache/env-0778f084eefb971403fa5d40651c28a7 -c conda-forge -c bioconda -c defaults bioconda::phold=0.2.0
status : 109
message:
  The following argument was not expected: --mkdir
  Run with --help for more information.

Nextflow appears to be automatically adding the --mkdir flag to mamba create commands, but this flag is not supported in current Mamba versions.

Workarounds tried:

  • The pipeline works when I downgrade Mamba to an older version that supports the flag
  • The pipeline works when using Conda instead of Mamba (useMamba = false)

Configuration: My conda config in nextflow.config:

conda {
    enabled = true
    useMamba = params.use_mamba
    cacheDir = params.conda_cache_dir
    createTimeout = params.conda_install_timeout
    channels = ['conda-forge', 'bioconda', 'defaults']
    createOptions = '--strict-channel-priority'
}

Questions:

  1. Is there a way to prevent Nextflow from adding the --mkdir flag to mamba commands? I must be doing something wrong, but I am unsure how to go about it.
  2. Are there any configuration options I can add to fix this without downgrading mamba or reverting to Conda?

Thank you for your assistance!

Hi @Ponsero_Alise,

Great catch, thanks! This is something that needs to fixed within Nextflow, I don’t think that there’s anything that you can do to solve this (that I can think of).

Please can you make an issue about it on the Nextflow repo?

If you can specify the different mamba version ranges where stuff breaks / works again, that would be helpful :folded_hands:

Thanks!

Phil

Thank you so much for the clarification, I’m opening a GitHub issue now!
I’ll try to pinpoint the mamba version breaking point more precisely and report it in the issue.

Thanks @Ponsero_Alise ! I don’t see the issue yet, could you link it here please to make sure that I don’t miss it?