Hello!
I started getting the following error on the dashboard page and each project’s overview page, right after updating to 2018.7.8 from 2018.7.7:
Exception occurred while executing a reader for `
– Variable setup for when you want to run this query manually
– DECLARE @dataVersion timestamp
– SELECT @dataVersion = DataVersion FROM ServerTask WHERE Id =
– DROP TABLE #Latest– Get this first so we don’t miss any updates between calls
SELECT Max(DataVersion) FROM ServerTaskDECLARE @ProjectIds as TABLE (ProjectId nvarchar(400))
– Narrowing this criteria any further makes it hard to invalidate the cache
INSERT INTO @ProjectIds
SELECT DISTINCT ProjectId
FROM ServerTask
WHERE ProjectId is not null
AND DataVersion > @DataVersionDECLARE @cnt int
SELECT @cnt = count(*) FROM @ProjectIds
IF @cnt = 0
RETURNSELECT *
INTO #Latest
FROM (
SELECT
‘C’ AS CurrentOrPrevious,
d.Id as DeploymentId,
d.Created,
d.ProjectId,
d.EnvironmentId,
d.ReleaseId,
d.TaskId,
d.TenantId,
d.ChannelId,
t.[State],
t.HasPendingInterruptions,
t.HasWarningsOrErrors,
t.ErrorMessage,
t.QueueTime,
t.StartTime,
t.CompletedTime,
r.[Version],
ROW_NUMBER() OVER (PARTITION BY d.EnvironmentId, d.ProjectId, d.TenantId, d.ReleaseId ORDER BY Created DESC) as [Rank]
FROM Deployment d
INNER JOIN ServerTask t ON t.Id = d .TaskId
INNER JOIN [Release] r on r.Id = d.ReleaseId
WHERE NOT ((t.State = ‘Canceled’ OR t.State = ‘Cancelling’) AND t.StartTime IS NULL)
AND d.ProjectId in (SELECT ProjectId FROM @ProjectIds)
) s
WHERE s.Rank = 1SELECT *
FROM #Latest
UNION ALL
SELECT *
FROM (
SELECT
‘P’ AS CurrentOrPrevious,
d.Id as DeploymentId,
d.Created,
d.ProjectId,
d.EnvironmentId,
d.ReleaseId,
d.TaskId,
d.TenantId,
d.ChannelId,
t.[State],
t.HasPendingInterruptions,
t.HasWarningsOrErrors,
t.ErrorMessage,
t.QueueTime,
t.StartTime,
t.CompletedTime,
r.[Version],
ROW_NUMBER() OVER (PARTITION BY d.EnvironmentId, d.ProjectId, d.TenantId, d.ReleaseId ORDER BY Created DESC) as [Rank]
FROM [Deployment] d
INNER JOIN [ServerTask] t on t.Id = d.TaskId
INNER JOIN [Release] r on r.Id = d.ReleaseId
WHERE
d.Id NOT IN (SELECT DeploymentId FROM #Latest)
AND t.State = ‘Success’
AND d.ProjectId in (SELECT ProjectId FROM @ProjectIds)
) s
WHERE s.[Rank] = 1
`
SQL Error 137 - Must declare the scalar variable “@DataVersion”.
Other pages seem to work fine.