I also believe it is solved. However for future errors around this, better error / log messages would be very beneficial. And an update to the documentation. Specifically the following things are off:
- the docs don't talk about
stack.env at all? link
- the in-app (from a deployed Portainer instance) docs are wrong IMHO. I have
git repos that I successfully deploy in Portainer, define environment variables in the UI and reference stack.env as an env_file, where no stack.env (empty or not) is inside the repo

- If your
docker-compose.yml sits in a sub-folder, it is unclear where the stack.env should be. In my understanding, it always has to be in the root of the repository, or this is where Portainer creates it. Hence if the stack file is in sub-dir/docker-compose.yml, the env_file must reference ../stack.env. Not described in the docs.
- We realized that a
touch stack.env or touch .env is helping fix issues and it seems to be a recurring theme. How do you know which stack & version to do this in? The folder structure that Portainer creates is <stack-number>/<unique-hash>/<repo-content>. No log message ever says which stack-number or unique-hash (changes with every deployment) it currently failed it. I find myself grep ing for the most recent known change 🤦
shall I create a separate issue for this? Also if I overlooked something, happy for links / suggestions 💡
Originally posted by @patzm in #12151 (comment)