Skip to content

[Bug]: CLI shows incorrect logs when attached to two runs with the same name #3852

@jvstme

Description

@jvstme

Steps to reproduce

  1. Prepare two projects, project-1 and project-2.
  2. Prepare two configurations with the same name:
    • test-1.dstack.yml:
      type: task
      name: test
      commands:
      - echo Hi from project 1
      - sleep infinity
    • test-2.dstack.yml:
      type: task
      name: test
      commands:
      - echo Hi from project 2
      - sleep infinity
  3. Run the first configuration in project-1.
    $ dstack apply -f test-1.dstack.yml --project project-1 -y
    test provisioning completed (running)
    Hi from project 1
  4. In a new terminal, run the second configuration in project-2.
    $ dstack apply -f test-2.dstack.yml --project project-2 -y

Actual behaviour

The second dstack apply shows the logs of the run from project-1 instead of project-2:

$ dstack apply -f test-2.dstack.yml --project project-2 -y
test provisioning completed (running)
Hi from project 1

Expected behaviour

Different options:

  • (preffered) The second dstack apply shows the logs of the run from project-2:
    $ dstack apply -f test-2.dstack.yml --project project-2 -y
    test provisioning completed (running)
    Hi from project 2
  • The second dstack apply exits with a message saying that it cannot attach to the run because another terminal is already attached to a different run with the same name.

dstack version

0.20.19

Server logs

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions