Hi everyone,
We are using the Bitbucket Server REST API to post build statuses to commits from our Jenkins pipelines:
Endpoint:
POST /rest/api/latest/projects/{projectKey}/repos/{repoSlug}/commits/{commitId}/builds
This has been working fine earlier, but recently we started getting 500 Internal Server Error consistently, even though there were no changes on the Jenkins side.
Verified:
- Authentication (Bearer token) is valid
- Request payload is correct (state, key, name, url)
- Commit exists and is accessible via GET /commits API
- Same issue occurs from Jenkins and manual API calls (PowerShell/Postman)
Example:
POST https://<bitbucket>/rest/api/latest/projects/C/repos/code/commits/<commitId>/builds
Body: state=INPROGRESS, key=TEST-123, name=TEST, url=https://test
Response:
500 Internal Server Error with message: “An error occurred while processing the request”
Additional notes:
- Issue is more frequent on feature branch / new commits
- Older commits sometimes still work
- Retry attempts do not resolve the issue
Questions:
- Are there known conditions where Bitbucket cannot attach build status to certain commits (e.g., indexing delay or commit reachability)?
- Has there been any recent change in this API behavior?
- Which server logs should we check to diagnose this?
Environment: Bitbucket Server (self-hosted), Jenkins pipelines.