Troubleshooting GitLab POST API: "An internal server error occurred"

Overview

When this article was written in late 2022, CircleCI's GitLab integration was newly launched and POST API support was not available for GitLab-connected projects. This resulted in {"message": "An internal server error occurred."} responses when attempting POST requests against the CircleCI API v2 for GitLab projects.

Current Status

The situation has partially improved since then, but some limitations remain depending on which endpoint and integration type you are using.

Legacy trigger endpoint (POST /api/v2/project/{project-slug}/pipeline): This endpoint does not support GitLab or GitHub App projects. Attempting to use it against a GitLab-connected project will still return an error. The CircleCI API docs note this endpoint is superseded by the newer pipeline run endpoint.

Newer trigger endpoint (POST /api/v2/project/circleci/{org-id}/{project-id}/pipeline/run): This endpoint was introduced in late 2024 and supports GitHub App and Bitbucket Data Center projects. As of this writing, GitLab is still explicitly not supported by this endpoint either.

Workaround

For GitLab projects that need API-triggered pipelines, the recommended approach is to use Custom Webhooks as a trigger mechanism, which can be called from any system including GitLab CI/CD pipelines or external scripts.

Additional Resources

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.