Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create Stack if the compose file has env_file: [stack.env] #11707

Open
2 tasks done
lgo opened this issue Apr 28, 2024 · 1 comment
Open
2 tasks done

Cannot create Stack if the compose file has env_file: [stack.env] #11707

lgo opened this issue Apr 28, 2024 · 1 comment
Labels

Comments

@lgo
Copy link

lgo commented Apr 28, 2024

Before you start please confirm the following.

Problem Description

While setting up some automations for Stack creation, I've run into a bug where a Stack cannot be created if it includes the stack.env file via something like:

    env_file: [stack.env]

This is completely fine if added after creation.

For context on what I'm doing: I'm moving existing Stacks to an automated create/update workflow backed by a repo of compose files. I started hitting this with basically all of them, either moved or new (based on my templating).

Expected Behavior

Stack be created successfully and the stack.env should refer to any Env variables included on creation.

Actual Behavior

Unable to create the Stack due to the error:

failed to deploy a stack: Failed to load /data/compose/{stack_id}/.../containers/stack.env: open /data/compose/{stack_id}/.../containers/stack.env: no such file or directory

Steps to Reproduce

  1. Attempt to create a standalone Stack with
services:
  test:
    image: alpine
    env_file: [stack.env]
  1. 💣

Portainer logs or screenshots

No response

Portainer version

2.19.5

Portainer Edition

Business Edition (BE/EE) with 5NF / 3NF license

Platform and Version

Docker 24.0.7

OS and Architecture

Debian, AMD64

Browser

No response

What command did you use to deploy Portainer?

No response

Additional Information

No response

@lgo lgo changed the title Cannot create a stack if the compose file has env_file: [stack.env] Cannot create Stack if the compose file has env_file: [stack.env] Apr 28, 2024
@abhinandval
Copy link

im also facing the same issue

name: pro-tools
services:
  cloudflared:
    container_name: cfd-pro-tools
    image: cloudflare/cloudflared:latest
    command: tunnel --no-autoupdate run --token ${CF_TUNNEL_TOKEN}
    env_file: stack.env

i have this stack config which is a git repo when im deploying im getting this error

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants