Triggers not running

Our deployment triggers are not running server wide, and we see errors under Server logs. For more context, we imported a handful of projects from the default space to its own space, and that is when we think the problem started:

Error when running scheduled task: Octopus.Server.Schedules.RunOnAScheduleAdapter`1[Octopus.Server.Schedules.ProcessRecurringScheduledDeployments] System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

at System.ThrowHelper.ThrowKeyNotFoundException()

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

at Octopus.Server.Schedules.ProcessRecurringScheduledDeployments.<>c__DisplayClass7_0.b__6(ProjectTrigger t) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Schedules\ProcessRecurringScheduledDeployments.cs:line 125

at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()

at Octopus.Shared.Util.Humanize.ReadableJoin[T](IEnumerable`1 list, String junction)

at Octopus.Server.Schedules.ProcessRecurringScheduledDeployments.<>c__DisplayClass7_2.b__5(TaskRoutes taskRoutes) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Schedules\ProcessRecurringScheduledDeployments.cs:line 122

at Octopus.Core.Spaces.SpaceContextSwitcherExtensions.<>c__DisplayClass0_0`1.b__0(TDependency dependency) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\Spaces\SpaceContextSwitcherExtensions.cs:line 12

at Octopus.Server.Web.Infrastructure.Spaces.SpaceContextSwitcher.PerformInSpaceContext[TDependency,TReturn](SpacePartitionsDefinition definition, Func`2 action) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\Spaces\SpaceContextSwitcher.cs:line 28

at Octopus.Server.Schedules.ProcessRecurringScheduledDeployments.Trigger() in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Schedules\ProcessRecurringScheduledDeployments.cs:line 120

at Octopus.Server.Schedules.Scheduler.RunTask(IRunOnASchedule schedule) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Schedules\Scheduler.cs:line 243

Answer on the community slack channel, but replying here for discoverability.

Project Triggers for the Projects that were moved are still in the original space. Those triggers can be found by running the following query:

SELECT * FROM ProjectTrigger WHERE Id NOT IN
(SELECT t1.Id
  FROM [ProjectTrigger] t1
  INNER JOIN [Project] t2
  ON t1.SpaceId = t2.SpaceId AND t1.ProjectId = t2.Id)