-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
8.9.4, 9.6.5
-
None
-
1
-
Severity 3 - Minor
-
Issue Summary
If you create a pull request from a fork with between 523 and 1000 commits you will encounter an error on Microsoft SQL Server due to too may query parameters when visiting the Builds tab on the pull request
Steps to Reproduce
- Create a repository
- Fork the repo
- Create 524 commits and push it to the fork (do not exceed 1000 commits or it will trigger a separate code path)
- Create a pull request between the fork and the repository
- Visit the pull request Builds tab
Expected Results
Builds tab loads
Actual Results
We receive the following error:
2025-08-25 01:49:12,805 ERROR [http-nio-7990-exec-1 url: /rest/ui/latest/projects/PRO1/repos/repo1/pull-requests/1/builds; user: admin] admin @189NNNDx109x611x0 16n7whk 10.229.154.198,10.229.152.194 "GET /rest/ui/latest/projects/PRO1/repos/repo1/pull-requests/1/builds HTTP/1.1" c.a.s.i.r.e.DefaultUnhandledExceptionMapperHelper Unhandled exception while processing REST request: "GET /rest/ui/latest/projects/PRO1/repos/repo1/pull-requests/1/builds HTTP/1.1" org.hibernate.exception.SQLGrammarException: could not extract ResultSet at com.atlassian.stash.internal.hibernate.HibernatePageUtils.pageCriteria(HibernatePageUtils.java:78) at com.atlassian.stash.internal.AbstractHibernateDao.pageCriteria(AbstractHibernateDao.java:236) at com.atlassian.bitbucket.internal.build.status.dao.HibernateBuildStatusDao.findAll(HibernateBuildStatusDao.java:206) ... at com.atlassian.bitbucket.internal.rest.build.status.BuildStatusPullRequestSearchResource.search(BuildStatusPullRequestSearchResource.java:56) ... Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:265) ... at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57) ... 84 common frames omitted
Workaround
Currently, there is no known workaround for this behavior. A workaround will be added here when available