dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.75k stars 259 forks source link

Unable to install on machine with WSL2 symlinks #2394

Open neyaki opened 2 years ago

neyaki commented 2 years ago

Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

Describe the bug

Click install from the extensions pane in VSCode (or link from vscode website), it install, but ends with an error;

{"errno":-4092,"code":"EACCES","syscall":"stat","path":"c:\\tools\\scripts"}

The location above is a symlink in use within the WSL2 embedded system, and the path shown C:\tools is part of the active Workspace in VScode at time of installation.

Steps to recreate issue

When the path with the symlink is not in the active workspace, Dendron installs fine. I will not be able to use Dendron whilst working on the other Workspace.

Desktop (please complete the following information)

jonathanyeung commented 2 years ago

Hi @neyaki, thanks for reporting the issue.

Unfortunately I don't have access to a WSL env to easily test this out, but can you elaborate on

When the path with the symlink is not in the active workspace, Dendron installs fine. I will not be able to use Dendron whilst working on the other Workspace.

Is this unique to Dendron? Do installing other vs code extensions have the same issue?

neyaki commented 2 years ago

Is this unique to Dendron? Do installing other vs code extensions have the same issue?

Hi @jonathanyeung I have not had any issues with other extensions at all.

duckpuppy commented 2 years ago

I see this same error on macOS using Nix Flakes with direnv in the workspace. A broken symlink will be created in a .direnv subdirectory (it's an artifact of the direnv and nix flake usage, not fixable) that causes this same error. My guess is that any broken symlink in the workspace will cause this.

Dendron actually works fine as long as VSCode is not launched from a workspace with a broken symlink.

duckpuppy commented 2 years ago

My error is slightly different, but still along the same lines - it's trying to access a path and it can't:

{"errno":-2,"code":"ENOENT","syscall":"stat","path":"/Users/paikens/src/work/detect-build-system-action/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa","vslsStack":[]}

Maybe whatever workspace scanning Dendron is trying to do on startup could ignore unreadable paths? The other weird thing is that reference to vslsStack - I thought vsls referred to Live Share, but removing the Dendron extension from VSCode stops this error from happening.

CyberFoxar commented 9 months ago

I second this issue. I've had dendron fail at init when trying to stat broken symlinks (of which nix is particularly found of).

I am also of the opinion the Dendron should ignore unreadable paths and files when trying to discover a suitable vault.