[BUG] Incorrect warning "The git reference could not be found..." when compose file is in a subdirectory
Author: andreapazzoCreated Sep 10, 2026Updated Sep 17, 2026
Labelskind/bugbug/need-confirmationbot/triage-complete
Before you start please confirm the following.
- Yes, I've searched similar issues on GitHub.
- Yes, I've checked whether this issue is covered in the Portainer documentation.
Problem Description
When creating/deploying a stack from a Git repository where the compose file is located inside a subdirectory rather than the repository root, Portainer displays a warning message stating:
"The git reference could not be found on the remote repository."Despite this warning, the repository clone succeeds, the compose file is correctly read from the subfolder, and the stack starts/deploys without any issues.
Expected Behavior
No warning should be displayed, as the Git reference and the compose path are both valid.
Actual Behavior
A false-positive warning "The git reference could not be found on the remote repository." is thrown, even though the stack builds and runs as intended.
Steps to Reproduce
Go to Stacks > Add stack.Select Repository as the build method.Provide the repository URL and reference (e.g., branch main).Set the Compose path to a file located in a subdirectory (e.g., subfolder/docker-compose.yml).Click Deploy the stack.Observe the warning banner appearing at the top/bottom of the UI while the stack actually deploys successfully.
Portainer logs or screenshots
Portainer version
2.45.0
Portainer Edition
Community Edition (CE)
Platform and Version
Docker
OS and Architecture
arm64
Browser
No response
What command did you use to deploy Portainer?
Additional Information
No response
Source: portainer/portainer