nextflow-io / nextflow-io/nextflow

env.PATH not working when executor is AWS Batch

Open
#4,467 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lang/config stale triage/investigate
Dominant language
Groovy
Stars
3.5k
Forks
811
Avg merge
2d 11h
Merged PRs (30d)
61

Description

Bug report

Expected behavior and actual behavior

When I set then env config scope for the PATH variable, its value is passed properly when I use "local" executor (with and without docker). However, when I use AWS Batch as executor, the PATH variable never gets the provided value while other variables are properly passed.

Steps to reproduce the problem

It can be tested with a minimal task on a main.nf file and the following values on the nextflow.config file:

process.executor = 'awsbatch'
aws.batch.cliPath = '/home/ec2-user/miniconda/bin/aws'
env {
    MY_TEST_VAR='hello world'
    ANOTHER_TEST="goodbye, test"
    PATH = "/home/ec2-user/miniconda/bin:$PATH"
    AFTER_PATH="${aws.batch.cliPath}"
}
Program output

Here's the command.run file (I had to rename it to txt to attach it here). You will notice on the nxf_main function the following values:

    export PATH=$PWD/nextflow-bin:$PATH
    export MY_TEST_VAR="hello world"
    export ANOTHER_TEST="goodbye, test"
    export AFTER_PATH="/home/ec2-user/miniconda/bin/aws"

And when I run the env command on the task itself, I get the following values (some vars were removed):

NXF_TASK_WORKDIR=/tmp/nxf.wmcLzuFCXL
PWD=/tmp/nxf.wmcLzuFCXL
_=/usr/bin/env
HOME=/root
MY_TEST_VAR=hello world
ANOTHER_TEST=goodbye, test
PATH=//nextflow-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
AFTER_PATH=/home/ec2-user/miniconda/bin/aws
OLDPWD=/
Environment
  • Nextflow version: 23.10.0
  • Operating system: Amazon Linux 2023

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

Reproduce the issue with the minimal main.nf and nextflow.config examples, using the AWS Batch executor, and compare the generated command.run environment with local execution. Trace how the configured PATH is represented in the AWS Batch task, then verify that the configured prefix is preserved while other env values remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, groovy
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.