Skip to content

Commit 57087f7

Browse files
committed
Do not point at runner logs for a run that never started
1 parent 14a24fc commit 57087f7

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

  • src/dstack/_internal/cli/services/configurators

‎src/dstack/_internal/cli/services/configurators/run.py‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@
5959
from dstack._internal.core.models.repos import RepoHeadWithCreds
6060
from dstack._internal.core.models.repos.base import Repo
6161
from dstack._internal.core.models.repos.remote import RemoteRepo, RemoteRepoCreds
62-
from dstack._internal.core.models.runs import JobStatus, JobSubmission, RunPlan, RunSpec, RunStatus
62+
from dstack._internal.core.models.runs import (
63+
JobStatus,
64+
JobSubmission,
65+
JobTerminationReason,
66+
RunPlan,
67+
RunSpec,
68+
RunStatus,
69+
)
6370
from dstack._internal.core.services.diff import diff_models
6471
from dstack._internal.core.services.repos import get_repo_creds_and_default_branch
6572
from dstack._internal.core.services.ssh.ports import PortUsedError
@@ -947,7 +954,11 @@ def print_finished_message(run: Run):
947954
# which rich would otherwise parse as markup or repaint.
948955
console.print(termination_reason_message, style="error", markup=False, highlight=False)
949956

950-
if termination_reason:
957+
if (
958+
termination_reason
959+
# A run that never started has no runner logs to read.
960+
and termination_reason != JobTerminationReason.FAILED_TO_START_DUE_TO_NO_CAPACITY.value
961+
):
951962
console.print(f"Check [code]dstack logs -d {run.name}[/code] for more details.")
952963

953964

0 commit comments

Comments
 (0)