fnm icon indicating copy to clipboard operation
fnm copied to clipboard

error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/3628_1715158318789". Maybe there are some issues with permissions for the directory? No such file or directory (os error 2)

Open wngtk opened this issue 9 months ago • 5 comments

error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/3628_1715158318789". Maybe there are some issues with permissions for the directory? No such file or directory (os error 2)

I am using WSL2 Ubuntu, Fish shell and TMUX.

if status is-interactive
    # Commands to run in interactive sessions can go here
    if not set -q TMUX; and not set -q VSCODE_IPC_HOOK_CLI
        exec tmux
    end
    if command -v starship > /dev/null
        starship init fish | source
    end
end

image

wngtk avatar May 08 '24 08:05 wngtk

workaround:

sudo systemctl restart user@1000

wngtk avatar May 08 '24 14:05 wngtk

Happens to me aswell. WSL2-tmux

aenlemmea avatar Jul 05 '24 08:07 aenlemmea

Think this is due to missing userid folder and subfolders, fix is to create the missing folder heirachy and change ownership to user i.e.

sudo mkdir -p /run/user/<userid,default=1000>/fnm_multishells
sudo chown -R /run/user/<userid,default=1000>

b0dee avatar Aug 15 '24 09:08 b0dee

Think this is due to missing userid folder and subfolders, fix is to create the missing folder heirachy and change ownership to user i.e.

sudo mkdir -p /run/user/<userid,default=1000>/fnm_multishells
sudo chown -R /run/user/<userid,default=1000>

This works on my wsl2 ubuntu 24.04:

sudo mkdir -p /run/user/1000/fnm_multishells
sudo chown -R 1000 /run/user/1000/

lisez avatar Oct 01 '24 13:10 lisez

I have a workaround.

The root cause is that /run/user/1000 isn't created after fnm launches for some reason.

Therefore, I changed the folder that fnm uses. I found that fnm respects XDG_RUNTIME_DIR when creating the fnm_multishells folder.

https://github.com/Schniz/fnm/blob/186e4bbd9204d7658a4f9923955281687a01e8c3/src/directories.rs#L71-L77

https://github.com/Schniz/fnm/blob/186e4bbd9204d7658a4f9923955281687a01e8c3/src/directories.rs#L16-L18

The following is my solution:

eval "$(XDG_RUNTIME_DIR=/tmp/run/user/$(id -u) fnm env --use-on-cd --shell zsh)"

lisez avatar Oct 14 '24 15:10 lisez