Skip to content

Commit b5f26c8

Browse files
authored
Fix project loading in _check_instance() (#2931)
1 parent 884fb52 commit b5f26c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dstack/_internal/server/background/tasks/process_instances.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,10 @@ async def _check_instance(session: AsyncSession, instance: InstanceModel) -> Non
738738
if job_provisioning_data.hostname is None:
739739
res = await session.execute(
740740
select(ProjectModel)
741-
.where(ProjectModel.id == instance.id)
741+
.where(ProjectModel.id == instance.project_id)
742742
.options(joinedload(ProjectModel.backends))
743743
)
744-
project = res.scalar_one()
744+
project = res.unique().scalar_one()
745745
await _wait_for_instance_provisioning_data(
746746
project=project,
747747
instance=instance,

0 commit comments

Comments
 (0)