HTTP 500 creating pipeline with variables using API
Summary
Trying to create a new pipeline with variables as described here: https://docs.gitlab.com/ee/api/pipelines.html#create-a-new-pipeline . This does lead to a {"message":"500 Internal Server Error"} error.
curl -X POST --header "PRIVATE-TOKEN: <token>" \
-F "ref=master" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
https://gitlab.com/api/v4/projects/8943659/pipeline
{"message":"500 Internal Server Error"}
The error disappears if I remove the variables section. The adopted syntax for triggering a pipeline works:
curl -X POST \
-F token=3210a60c0af9b6bbb3e8a97f030b99 \
-F "ref=master" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
https://gitlab.com/api/v4/projects/8943659/trigger/pipeline
{"id":33561054,"sha":"d5d44...}
Steps to reproduce
see above
Example Project
https://gitlab.com/weggerle_a/test_pipeline_trigger
What is the current bug behavior?
Internal Server Error
What is the expected correct behavior?
Pipeline should be created with the specified variables
Relevant logs and/or screenshots
See summary
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
This bug happens on GitLab.com
Results of GitLab application Check
This bug happens on GitLab.com
Possible fixes
Related
https://gitlab.com/gitlab-org/gitlab-ce/issues/49527 is very similar and might have the same cause. Difference here is that there a trigger is used with the wrong authentication method (private-token vs. token). In this bug a pipeline is created with the (hopefully) correct authentication method...