-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux: ENOENT: no such file or directory, lstat '/snap/code' #65095
Comments
Just hit this same bug. Same OS & version as OP. '/snap/code' doesn't exist, but '/snap/vscode' does FWIW. |
Same issue with KDE Neon 5.14 and it started with vscode version 1.30.0 just like it happened with you. |
Facing this issue as well. My OS version is Ubuntu 16.04 and vscode version is 1.30.0. I have /snap/vscode folder but not /snap/code. |
I think this will be solved by #64392 . |
Same issue with Ubuntu 18.04 LTS. VScode 1.30.0 installed from the Snap is fetching from a wrong directory when searching for updates (it should be '/snap/vscode' and not '/snap/code'). |
I don't know the fix, but I made a 'code' and 'current' sub-folder. Maybe it'll stop complainin' for the time being. |
@flexiondotorg looks like there's an issue breaking v1.30 in https://snapcraft.io/vscode |
In the meantime you can install the deb package from the website, note that the snap package is currently still experimental. |
Same issue and environment here as with joaopauloufal. |
Alternatively you can just use |
For now, Waiting for fix. |
Very likely broken by #63716 |
@joaomoreno These are the environment variables loaded within vscode. People can verify them by running printenv in the console within vscode. SNAP_USER_DATA=/home/kd913/snap/vscode/72 These environment variables are set by snapd not vscode. These variables are listed here: In this case the environment variable SNAP is guaranteed to be a valid path. If these environment variables are invalid then the entire class should be restructured as they currently rely on the environment variables being set. People can alternatively try using the following command to run a shell within the vscode snap to verify the above to prove that these environment variables aren't being set or modified by vscode. snap run --shell vscode Key thing here is the the environment variable is loading /snap/vscode not /snap/code which people are having issues with here. None of the environment variables are set as /snap/code. In #63716 I removed a hardcoded path to /snap/code. The problem in this case is that my PR #64392 isn't merged. The isUpdateAvailable method within snapUpdateService is looking as this. Where product.applicationName is set as code. My pr changes this to use the environment variable instead. This function at present is what is causing this bug as /snap/code/current doesn't exist. Running this command: /snap/vscode/current/usr/share/code/resources/app$ cat product.json | grep 'application' The reason this is set like this is because at present the snapcraft version of vscode is built against the Linux Deb. It just names and mounts the Deb under the name vscode. Everyone here can look and run these commands themselves. Please, try PR 64392 before reverting my other one. I am 100% confident that this is the cause of this issue as that function is the only reference to /snap/code. |
@Kedstar99 The I've merged #64392 which fixes this issue and added a check for |
@Kedstar99 SNAP dos not guaranteed to be a valid path, if snap is under classic confinement. read here: https://github.com/snapcore/snapd/wiki/Environment-Variables#home I had open a bug for snapcrafters here: The $HOME directory is wrong. The same problem exist for Atom text editor. I don't think this is a problem about electron based apps. Because insomnia (http client) app is electron based and does not have the same problem. |
@jackTaw88 The code is using $SNAP which is always mounted in /snap/. This is especially true for classic confined snaps which won't install unless mounted in /snap. I don't know why you are saying that SNAP isn't always a valid path. It isn't a valid path basically if you mess up and try and move the snap manually which isn't a supported mechanism as far as i am aware. The SquashFS system will always mount the SNAP in /snap/<snap_name> for easy, predictable and deterministic behaviour. https://docs.snapcraft.io/the-snap-format/698 I don't know why you are talking about the $HOME directory as that variable isn't being used here. Even so, you are wrong in saying the $HOME directory is incorrect. As the snap is installed under classic confinement, it should have unrestricted access to the system. It is treated as equivalent to a install of a deb with no restrictions. A developer environment/IDE which can't open certain files, or open certain programs is pretty pointless. The documentation you linked even states this.
The SNAP environment variables listed above are listed for vscode under classic confinement. Also, using the environment variables is a lot safer than hardcoding paths. |
Issue Type: Bug
Today after the Code has been updated to 1.30 I've started to receive the message:
ENOENT: no such file or directory, lstat '/snap/code'
on every start of the VS Code.
On the previous version, which was 1.29.1, there wasn't that issue.
Ubuntu 18.04
Linux azan-dev 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Regards,
Yerzhan.
VS Code version: Code 1.30.0 (c6e592b, 2018-12-11T22:21:33.585Z)
OS version: Linux x64 4.15.0-42-generic
System Info
checker_imaging: disabled_off
flash_3d: unavailable_software
flash_stage3d: unavailable_software
flash_stage3d_baseline: unavailable_software
gpu_compositing: unavailable_software
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: unavailable_software
video_encode: unavailable_software
webgl: enabled_readback
webgl2: unavailable_off
Extensions (5)
The text was updated successfully, but these errors were encountered: