Upgraded OD Server to 2021.2.7727 running into an error when using the deployments endpoint. Trying to get the latest deployment id for a specific environment with the following
I’m getting the following error, subtracted 100’s of @taskid parameters
Exception occurred while executing a reader for SELECT *\r\nFROM [dbo].[Deployment]\r\nWHERE ((([SpaceId] = ‘Spaces-1’)))\r\nAND ([ProjectId] IN (@projectid1))\r\nAND ([EnvironmentId] IN (@environmentid1))\r\nAND ([TaskId] IN (@taskid1, @taskid2, … \r\nORDER BY [Created] DESC\r\nSQL Error 8003 - The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
This has been working perfectly fine until we upgraded. Any idea what is wrong?
Yes - omitting TaskState filter and I do not get the error. Do you know which version of OD introduced the error and is it possible to roll OD back? This error is blocking the a production deployment, and I need to find a workaround until fixed.
Unfortunately I can’t determine which version of Octopus Server this issue was introduced in. I have asked the relevant team if they can advise and will update you once I hear back from them.
One possible workaround might be to remove the taskState filter from the API call which should allow the query to complete correctly. You could then filter the results by taskState in your script/application after they have been returned.
I hope this is helpful. I’ll let you know once I hear back from the relevant team.