Skip to content

[BUG] Stack creation from Git fails with external network not found, while local Compose and regular stack creation work #1278

Description

@iam-alamgir

Description

Description

I'm seeing inconsistent behavior when deploying the same Docker Compose configuration depending on how the stack is created.

Expected Behavior

Creating a stack from a Git repository should behave the same as creating a regular stack with the same Compose file and .env file. If the .env values are being loaded successfully, the external network reference should resolve the same way it does for local deployments and manually created stacks.

Actual Behavior

The deployment fails with:

Error: network "test_network" declared as external, but could not be found

Additional Details

  • The external network (test_network) does exist locally.
  • The Compose file is identical in all cases.
  • The .env file appears to be loaded correctly during Git-based stack creation.
  • The .env file is intentionally not committed to the Git repository and is only supplied during stack creation.

Steps to reproduce

  1. Create a Docker Compose file that references an external network (whose name is provided via .env).

  2. Create the required external network locally (eg. test_network).

  3. Verify that:

    • Running the Compose file locally succeeds.
    • Creating a regular stack in Dockhand using the same Compose file and supplying the .env file also succeeds.
  4. Commit and push only the Compose file to a Git repository. Do not commit the .env file.

  5. In Dockhand, create a new stack using the Git repository as the source.

  6. Upload/provide the same .env file during stack creation.

  7. Start the deployment.

Logs

2026-07-11T12:46:41.743Z [Stack:test-stack] Spawning docker compose process from /app/data/stacks/Direct Socket/test-stack: docker compose -p test-stack -f /app/data/stacks/Direct Socket/test-stack/compose.yml --env-file /app/data/stacks/Direct Socket/test-stack/.env.dockhand up -d --remove-orphans --force-recreate
2026-07-11T12:46:41.863Z [Stack:test-stack] ----------------------------------------
2026-07-11T12:46:41.863Z [Stack:test-stack] COMPOSE PROCESS COMPLETE
2026-07-11T12:46:41.863Z [Stack:test-stack] ----------------------------------------
2026-07-11T12:46:41.863Z [Stack:test-stack] Exit code: 1
2026-07-11T12:46:41.863Z [Stack:test-stack] Timed out: false
2026-07-11T12:46:41.863Z [Stack:test-stack] STDERR:
2026-07-11T12:46:41.863Z network "test_network" declared as external, but could not be found

2026-07-11T12:46:41.863Z [Stack:test-stack] ========================================
2026-07-11T12:46:41.863Z [Stack:test-stack] DEPLOY STACK RESULT
2026-07-11T12:46:41.863Z [Stack:test-stack] ========================================
2026-07-11T12:46:41.863Z [Stack:test-stack] Success: false
2026-07-11T12:46:41.863Z [Stack:test-stack] Error: network "test_network" declared as external, but could not be found

Browser logs

Dockhand version

v1.0.36

Hawser version (if used)

No response

Connection mode

socket

Please confirm the following

  • I have already searched for relevant existing issues and discussions before opening this report.
  • I have updated the title field above with a concise description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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