SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

1.25.0 - new error when opening ssh:// URIs - "Error handling uri: " build.gradle, .devcontainer.json #341

Closed luckman212 closed 2 years ago

luckman212 commented 2 years ago

Since I updated to today's new 1.25 build, I am getting an error when opening ssh:// URIs with VSCode.

See screenshot. This is macOS 12.4, VSCode 1.67.2

code --folder-uri ssh://r1.xxxxxxx/

CleanShot 2022-06-02 at 03 35 36

SchoofsKelvin commented 2 years ago

Looks like some extensions (or built-in VS Code code) is attempting to directly read build.gradle and .devcontainer/devcontainer.json etc without using stat to check if it exists and is readable.

You can add a -FS_NOTIFY_ERRORS flag (globally or per config, see #270) to disable these notifications. I might just disable this by default for both stat and readFile/readDirectory operations in the next version and/or add these two paths to the ignore list. I'll see what's best and doesn't break other things (most importantly, the feature where it informs you if saving something failed, i.e. #282)

luckman212 commented 2 years ago

@SchoofsKelvin Thanks for looking. I'm wary of disabling notifications for write failures. Sounds like just the kind of thing that would bite me on a flaky/VPN connection.

...add these two paths to the ignore list...

This sounds like the way to go... Is that something I can do myself in a config file somewhere?

edit: I tried various local/global settings using stuff like

 "files.exclude": {
    "**/.devcontainer/devcontainer.json": true,
    "**/build.gradle": true
  },
  "files.watcherExclude": {
    "**/.devcontainer/devcontainer.json": true,
    "**/build.gradle": true
  }

but none of that worked. The only thing that suppresses it for me is "sshfs.flags": ["-FS_NOTIFY_ERRORS"]. Head in the sand! ⏳

SchoofsKelvin commented 2 years ago

It should be fixed now. Could you try installing the artifact from this build? If you don't specify any flags, it should only show notifications about "write" operations failing, i.e. writeFile, createDirectory, delete and rename.

While I've also added those two files to the ignored list, it only affects how verbose it gets logged in the SSH FS output channel. Shouldn't matter much to you, but I've added them regardless.

luckman212 commented 2 years ago

Thanks @SchoofsKelvin - yep that's working for me! 🚀

ElmarHarbecke commented 1 year ago

Hello here. Run into the same issue trying to connect to a server. I have installed the extension on a new machine as one and only extension. But the same issue as in connection with other extensions. The artifact from above is not longer available, so, I could not try to solve it. Also, trying to add the files/directories to an exclude list via user config did not solve the problem. Any help is welcome - thanks in advance. Elmar

SP-SuperPoney commented 1 year ago

Same here can you provide a fix ? the linked build is no longer available.

sebastian-li commented 1 year ago

Same for me here. ran into the same error message and the build link is not working

rnapoli commented 1 year ago

Same here. It happens every time I open my VSCode. The remote-machine is in my own local network, and ssh sessions work with other software.

Error handling uri: ssh://remote-machine/build.gradle ssh://remote-machine/build.gradle

My environment:

Windows 10 (up to date) VSCode Version: 1.72.0 (up to date) Commit: 64bbfbf67ada9953918d72e1df2f4d8e537d340e Date: 2022-10-04T23:20:39.912Z Electron: 19.0.17 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.19043 Sandboxed: No

matDOTviguier commented 1 year ago

Same here. W11 & VSCODE latest stable

elvirgit commented 1 year ago

I have the same problem. Any solution here? Thanks

dassels commented 1 year ago

Me as well, perhaps it will be in the next update...

Fischmuetze commented 1 year ago

same here ... :(

Cleanerrr commented 1 year ago

Any solution for this error???

luckman212 commented 1 year ago

@ElmarHarbecke @SP-SuperPoney @sebastian-li @rnapoli @matDOTviguier @elvirgit @dassels @Fischmuetze @Cleanerrr

Until @SchoofsKelvin has more time to look at this, I posted a patch here that you can try. Hope it works for you.

https://github.com/luckman212/vscode-sshfs-patch

SP-SuperPoney commented 1 year ago

@ElmarHarbecke @SP-SuperPoney @sebastian-li @rnapoli @matDOTviguier @elvirgit @dassels @Fischmuetze @Cleanerrr

Until @SchoofsKelvin has more time to look at this, I posted a patch here that you can try. Hope it works for you.

https://github.com/luckman212/vscode-sshfs-patch

Worked fine on my setup !

I had to change the bash script because I'm using VSCode on Windows and the ~/ folder was pointing to /home/<username> and my VSCode extention folder is locatedf at /mnt/c/Users/<username>/.vscode/

So I've manually changed:

cp -iv ./{,f1d0.}extension.js \
~/.vscode/extensions/kelvin.vscode-sshfs-1.25.0/dist/

to

cp -iv ./{,f1d0.}extension.js \
/mnt/c/Users/<username>/.vscode/extensions/kelvin.vscode-sshfs-1.25.0/dist/

et voilà !

dassels commented 1 year ago

Worked on mine as well! And thanks for the tip @SP-SuperPoney I'm also running on Windows and needed to update the script.

rustyx commented 1 year ago

Why is this ticket closed? It's not resolved (or the issue is back). Kindly re-open, @SchoofsKelvin

rushikpatel08 commented 1 year ago

Having Same Issue if you can explain the solution in brief step by step and provide perfect location of file that need to be change with change data

SchoofsKelvin commented 1 year ago

I've published a new version of the extension (v1.26.0) which includes this fix.