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

stack deployment failure when using relative path #11953

Closed
2 tasks done
skaneprime opened this issue Jun 19, 2024 · 2 comments
Closed
2 tasks done

stack deployment failure when using relative path #11953

skaneprime opened this issue Jun 19, 2024 · 2 comments
Labels

Comments

@skaneprime
Copy link

skaneprime commented Jun 19, 2024

Before you start please confirm the following.

Problem Description

Hey there! I'm facing these error when trying to update stack via webhook. But when I'm manually redeploying it stack will deploy without error.

{"level":"info","repository":"https://github.com/qrvers/burn_tobacco/","composePath":["docker-compose.yml"],"destination":"/mnt/portainer-compose-unpacker","env":[],"skipTLSVerify":true,"time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:31","message":"Deploying Compose stack from Git repository"}
{"level":"info","directory":"/mnt/portainer-compose-unpacker","time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:57","message":"Checking the file system..."}
{"level":"info","directory":"/mnt/portainer-compose-unpacker/stacks/burntobacco-dev","time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:83","message":"Creating target destination directory on disk"}
{"level":"info","repository":"https://github.com/qrvers/burn_tobacco/","path":"/mnt/portainer-compose-unpacker/stacks/burntobacco-dev","url":"https://github.com/qrvers/burn_tobacco/","depth":1,"time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:98","message":"Cloning git repository"}
stack deployment failure
{"level":"error","error":"authentication required","time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:104","message":"Failed to clone Git repository"}

What may gone wrong? My fine grained personal access token is valid for authentication yet still facing this error

This started happening when I created a stack that uses relative path at /mnt
When redeploying by hand it works like a clock but once I make POST request to webhook url https://portainer.XXXX/api/stacks/webhooks/XXXX it gives me this error

{
    "message": "Failed to update the stack",
    "details": "failed to deploy a docker compose stack 31: an error occurred while running unpacker container with exit code 255: authentication required"
}

I am also using an additional (self-hosted) registry but it doesn't require authentication

Expected Behavior

For the stack to deploy

Actual Behavior

compose-unpackerer throws error stack deployment failure with following logs

{"level":"info","directory":"/mnt/portainer-compose-unpacker","time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:57","message":"Checking the file system..."}
{"level":"info","directory":"/mnt/portainer-compose-unpacker/stacks/burntobacco-dev","time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:83","message":"Creating target destination directory on disk"}
{"level":"info","repository":"https://github.com/qrvers/burn_tobacco/","path":"/mnt/portainer-compose-unpacker/stacks/burntobacco-dev","url":"https://github.com/qrvers/burn_tobacco/","depth":1,"time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:98","message":"Cloning git repository"}
stack deployment failure
{"level":"error","error":"authentication required","time":1718806524,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:104","message":"Failed to clone Git repository"}

Steps to Reproduce

1 Create custom registry and push at least one image
2 make a docker-compose use that image
3 create stack that has relative path at /mnt so it looks like /mnt/portainer-compose-unpacker/stacks//
4. send POST to https://portainer./api/stacks/webhooks/XXXX

Portainer logs or screenshots

image

Portainer version

2.19.5

Portainer Edition

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

Platform and Version

Docker version 26.1.3, build b72abbb

OS and Architecture

Ubuntu 22.04, AMD64

Browser

Opera GX LVL 5 (core: 109.0.5097.142)

What command did you use to deploy Portainer?

docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest

Additional Information

No response

@skaneprime
Copy link
Author

When manually redeploying (Via Portainer UI clicking redeploy) logs of unpacker are

{"level":"info","repository":"https://github.com/qrvers/burn_tobacco/","composePath":["docker-compose.yml"],"destination":"/mnt/portainer-compose-unpacker","env":[],"skipTLSVerify":true,"time":1718807685,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:31","message":"Deploying Compose stack from Git repository"}
{"level":"info","user":"skaneprime","time":1718807685,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:42","message":"Using Git authentication"}
{"level":"info","directory":"/mnt/portainer-compose-unpacker","time":1718807685,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:57","message":"Checking the file system..."}
{"level":"info","directory":"/mnt/portainer-compose-unpacker/stacks/burntobacco-dev","time":1718807685,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:83","message":"Creating target destination directory on disk"}
{"level":"info","repository":"https://github.com/qrvers/burn_tobacco/","path":"/mnt/portainer-compose-unpacker/stacks/burntobacco-dev","url":"https://github.com/qrvers/burn_tobacco/","depth":1,"time":1718807685,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:98","message":"Cloning git repository"}
{"level":"info","composeFilePaths":["/mnt/portainer-compose-unpacker/stacks/burntobacco-dev/docker-compose.yml"],"workingDirectory":"/mnt/portainer-compose-unpacker/stacks/burntobacco-dev","projectName":"burntobacco-dev","time":1718807689,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:126","message":"Deploying Compose stack"}
{"level":"info","time":1718807714,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:144","message":"Compose stack deployment complete"}

@skaneprime
Copy link
Author

2.20.3 STS resolves issue

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

1 participant