Replies: 2 comments
-
The line you're referencing is a good catch. However to get past this, I suggest you to also mention the |
Beta Was this translation helpful? Give feedback.
0 replies
-
yes, you need ID in the body. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Error Description
When trying to update an environement, I receive the above message but the data passed is correct, also checked with the data contained in the database.
The request is:
curl --location --request PUT 'http://localhost:3000/api/project/4/environment/5'
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer ********='
--data '{
"name": "Test",
"project_id": 4,
"password": "",
"json": "{ }",
"env": "{}"
}'
The answer is HTTP 400 Bad Request
{
"error": "Environment ID in body and URL must be the same"
}
Throubleshoot
Looking at the source code I noticed that in environment.go file, url: https://github.com/ansible-semaphore/semaphore/blob/develop/api/projects/environment.go, when the env is added to the db the function assign "ProjectID: &newEnv.ID", maybe the error is this. In inventory.go the row is "ProjectID: &inventory.ProjectID,"
Beta Was this translation helpful? Give feedback.
All reactions