Skip to content

Bug: 'locking .env: context canceled' on first azd up in fresh environment #7976

Description

@jongio

Description

On the first run of azd up in a fresh environment (e.g., new devcontainer), the following error occurs:

\
ERROR: loading environment: saving local environment, locking .env: context canceled
\\

The error does not reproduce on subsequent runs — something gets cached that prevents it. Deleting .azure/ does not reproduce the issue.

Screenshots

image

Context

  • Reported by @john0isaac in PR #7776 comment
  • Likely pre-existing (env locking code unchanged in exegraph PR)
  • Suggests a race condition between environment creation and .env file locking on first run

Repro Steps

  1. Install azd in a fresh environment (devcontainer)
  2. Run azd up for the first time
  3. Observe the context canceled error on .env locking

/cc @john0isaac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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