Skip to content

bug: .env file isn't parsed when working_dir is an environment variable #2135

@Sky-Zeng

Description

@Sky-Zeng

Describe the bug

  1. content in dagu/base.yaml:
    env:
    - QUANT_SIGNAL_DIR: "/work/quant-signal"

  2. content in dags/health-check.yaml:
    working_dir: ${QUANT_SIGNAL_DIR}
    steps:
    - command: printenv QUANT_SIGNAL_DIR PYTHON_BIN

  3. content in /work/quant-signal/.env:
    PYTHON_BIN=/usr/local/bin/python

When I run the DAG pipeline, it's supposed to print "/work/quant-signal" and "/usr/local/bin/python". And It works when using dagu_2.6.7_linux_arm64.tar.gz. However, when using dagu_2.6.7_linux_amd64.tar.gz, it only prints "/work/quant-signal", which means it didn't parse the .env file in the working_dir.

To Reproduce

Steps to reproduce the behavior:

  1. Use dagu_2.6.7_linux_amd64.tar.gz
  2. setup DIR environment variable in base.yaml
  3. setup .env file in DIR folder
  4. setup working_dir and printenv in dags/workflow.yaml
  5. Run the workflow
  6. See error of printenv

Environment

  • Dagu version: dagu_2.6.7_linux_amd64
  • OS: Debian 12.5
  • Installation method: download binary

Screenshots

Image Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions