Skip to content

[Bug]: ~ in files resolves to /workflow if user is not set in either image or conf #2864

@un-def

Description

@un-def

Steps to reproduce

task.dstack.yml:

#user: root

commands:
  - ls -lah ~
  - ls -lah ~/.ssh
  - ls -lah /workflow

files:
 - ~/.ssh/id_rsa
 - file.txt:~/file.txt
  1. dstack apply --no-repo -f task.dstack.yml:
    total 44K
    drwx------ 1 root root 4.0K Jul  1 11:01 .
    drwxr-xr-x 1 root root 4.0K Jul  1 11:01 ..
    -rw-r--r-- 1 root root 3.1K Jul  1 11:01 .bashrc
    drwxr-xr-x 3 root root 4.0K Jul  1 11:01 .cache
    drwxr-xr-x 3 root root 4.0K Jun 18 02:54 .config
    drwxr-xr-x 3 root root 4.0K Jul  1 11:01 .dstack
    drwxr-xr-x 4 root root 4.0K Jun 18 02:54 .local
    -rw-r--r-- 1 root root  161 Jul  9  2019 .profile
    drwx------ 1 root root 4.0K Jun 18 02:54 .ssh
    total 20K
    drwx------ 1 root root 4.0K Jun 18 02:54 .
    drwx------ 1 root root 4.0K Jul  1 11:01 ..
    -rw------- 1 root root  781 Jul  1 11:01 authorized_keys
    total 20K
    drwxr-xr-x 4 root root 4.0K Jul  1 11:01 .
    drwxr-xr-x 1 root root 4.0K Jul  1 11:01 ..
    drwxr-xr-x 2 root root 4.0K Jul  1 11:01 .ssh
    drwxr-xr-x 4 root root 4.0K Jul  1 11:01 .venv
    -rw-r--r-- 1 root root    5 Jul  1 11:01 file.txt
    
  2. Uncomment user: root and apply the conf again:
    total 48K
    drwx------ 1 root root 4.0K Jul  1 10:59 .
    drwxr-xr-x 1 root root 4.0K Jul  1 10:59 ..
    -rw-r--r-- 1 root root 3.1K Jul  1 10:59 .bashrc
    drwxr-xr-x 3 root root 4.0K Jul  1 10:59 .cache
    drwxr-xr-x 3 root root 4.0K Jun 18 02:54 .config
    drwxr-xr-x 3 root root 4.0K Jul  1 10:59 .dstack
    drwxr-xr-x 4 root root 4.0K Jun 18 02:54 .local
    -rw-r--r-- 1 root root  161 Jul  9  2019 .profile
    drwx------ 1 root root 4.0K Jul  1 10:59 .ssh
    -rw-r--r-- 1 root root    5 Jul  1 10:59 file.txt
    total 24K
    drwx------ 1 root root 4.0K Jul  1 10:59 .
    drwx------ 1 root root 4.0K Jul  1 10:59 ..
    -rw------- 1 root root  781 Jul  1 10:59 authorized_keys
    -rw------- 1 root root 2.6K Jul  1 10:59 id_rsa
    total 12K
    drwxr-xr-x 3 root root 4.0K Jul  1 10:59 .
    drwxr-xr-x 1 root root 4.0K Jul  1 10:59 ..
    drwxr-xr-x 4 root root 4.0K Jul  1 10:59 .venv
    

Actual behaviour

No response

Expected behaviour

No response

dstack version

b2a28f5

Server logs

Additional information

No response

Metadata

Metadata

Assignees

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