Skip to content

Invalid interpolation format for command section due to AIRFLOW_UID in docker-compose.yaml 3.0.x #52959

Closed

Description

@jjunier

Apache Airflow version

3.0.2

If "Other Airflow 2 version" selected, which one?

No response

What happened?

This issue was encountered while running docker-compose up airflow-init on an AWS EC2 instance using Ubuntu 24.04 with Docker Compose v1.29.2.

Starting from Airflow 3.0.x(3.0.0, 3.0.1, 3.0.2), the official docker-compose.yaml includes a command line using $(id -u) to export AIRFLOW_UID. However, docker-compose interprets $(...) as a variable interpolation expression, which leads to the following error:

ERROR: Invalid interpolation format for "command" option in service "airflow-init: ..."
Image

This breaks the execution of docker-compose up airflow-init, especially when using Docker Compose v2+.

What you think should happen instead?

The command line should be updated to escape the dollar sign, like this:

export AIRFLOW_UID=$$(id -u)

This ensures the expression is evaluated in the container shell instead of being interpreted by Docker Compose.

Alternatively, the documentation can recommend using an .env file to predefine AIRFLOW_UID.

How to reproduce

  1. Download the official docker-compose file:
curl -LfO 'https://airflow.apache.org/docs/apache-airflow/3.0.2/docker-compose.yaml'
  1. Run the initialization command:
docker-compose up airflow-init
  1. Observe the interpolation format error in the terminal.

Operating System

Ubuntu 24.04.2 LTS (AWS EC2)

Versions of Apache Airflow Providers

apache/airflow:3.0.2

Deployment

Docker-Compose

Deployment details

docker-compose

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Jul 7, 2025
  2. boring-cyborg commented on Jul 7, 2025

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  3. potiuk commented on Jul 7, 2025

    @potiuk
    Member

    Feel free to fix it

  4. added and removed
    needs-triage
    on Jul 7, 2025
  5. zk2k2 commented on Jul 7, 2025

    @zk2k2

    Hello can you please assign me this issue? I want to contribute, thanks!

  6. potiuk commented on Jul 7, 2025

    @potiuk
    Member

    Assigned

  7. jjunier commented on Jul 7, 2025

    @jjunier
    ContributorAuthor

    Is it okay if I take care of the problem I have? I want to become a contributor.

    Or maybe we can work together to solve it.

  8. potiuk commented on Jul 7, 2025

    @potiuk
    Member

    You can review each-other's code.

  9. zk2k2 commented on Jul 7, 2025

    @zk2k2

    Hi @givemechocopy sure you found the issue, all yours!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:coregood first issuekind:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions