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

PUT api/stacks/:stack_id fails for git Stack when attempting to update Env #11705

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

PUT api/stacks/:stack_id fails for git Stack when attempting to update Env #11705

lgo opened this issue Apr 28, 2024 · 2 comments
Labels

Comments

@lgo
Copy link

lgo commented Apr 28, 2024

Before you start please confirm the following.

Problem Description

I've setup some automations to attempt to update Env for containers from a repository, and I'm getting the error when trying. This is with PUT /api/stacks/:stack_id

Specifically, I'm sending over a pretty minimal request:

{
  "Env": [...]
}

I did see the UI uses POST /api/stacks/:stack_id/git with a full payload to update it, so I can try mucking with that in the interim.

Expected Behavior

The Stack is able to update the env variables.

Actual Behavior

The API request fails with {"message":"Invalid request payload","details":"Invalid stack file content"}

Steps to Reproduce

(See above)

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
Copy link
Author

lgo commented Apr 28, 2024

Hmm, seems like PUT /api/stacks/:stack_id/git/redeploy is more appropriate for this and does appear to accept partial arguments (e.g. just Env). While I was originally trying to setup a webook trigger, where a subsequent action would propogate Env values, using the git redeploy API and disabling the webhook seems like a better route.

Running into the error was certainly a bit annoying as I hadn't figured out the alternative APIs 😅

@lgo lgo closed this as completed Apr 28, 2024
@lgo
Copy link
Author

lgo commented Apr 28, 2024

(didn't mean to close, as this is probably still useful to triage a better error message / fix)

@lgo lgo reopened this Apr 28, 2024
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