pajoma / vscode-journal

Lightweight journal and simple notes support for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pajoma.vscode-journal
GNU General Public License v3.0
233 stars 40 forks source link

Error opening/creating journal files over remote connection #51

Open jannek opened 4 years ago

jannek commented 4 years ago

If a remote development method is used (ssh in this case), new journal file creation gives an error, but apparently succeeds as subsequent access to file location works fine.

Repro:

If file does not already exist, following error is logged:

[09:58:07.054] [ERROR] 
[09:58:07.059] [ERROR] Failed to process input. See Exception below.
Error: cannot open vscode-remote://ssh-remote%2Bhost/path/to/Journal/2019/10/24.md. Detail: Unable to read file (Error: File not found (vscode-remote://ssh-remote+host/path/to/Journal/2019/10/24.md))
    at n.then.e (file:///usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:4707:361)
    at process._tickCallback (internal/process/next_tick.js:68:7)
pajoma commented 4 years ago

I was able to reproduce the error in a wsl-remote session, I got (standard installation in win10):

[10:52:00.454] [ERROR] 
[10:52:00.456] [ERROR] Failed to process input. See Exception below.
Error: cannot open vscode-remote://wsl%2Bubuntu/c/Users/[my user]/.vscode/extensions/ms-vscode-remote.remote-wsl-0.39.9/C%3A/Users/[my user]/Synced/Notizen/Journal/2019/10/24.md. Detail: Unable to read file (Error: File not found (vscode-remote://wsl+ubuntu/c/Users/[my user]/.vscode/extensions/ms-vscode-remote.remote-wsl-0.39.9/C:/Users/[my user]/Documents/Synced/Notizen/Journal/2019/10/24.md))
    at n.then.e (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:4707:361)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Do you expect the journal file to be created in your local environment or on the remote server? The journal path from the settings is configured for your local environment only, it makes sense that the extension cannot find the path on the remote server.

jannek commented 4 years ago

In this case I expect the file to open on the remote server (my workspace is opened there), not sure how to properly configure this for general use case.

Did you notice that the file is created after all on remote, and can be opened without errors next time?

bcarusone commented 4 years ago

@jannek I am having the same issue. When I first try and open a new file, I get an error but after that if I try a second time it works without a problem. Hopefully this can be fixed because its a pain.

spideyclick commented 3 years ago

+1 I am also seeing the same issue. Here's what I see:

  1. I hit CTRL + Shift + J
  2. Error pops up
  3. After maybe 1 or 2 seconds, I see the file pop up in the file tree
  4. I hit CTRL + Shift + J again
  5. I get into my note for the day
  6. I close the big error message and move on with my day

It's livable, but annoying enough that I thought I would comment on the issue and see if I could help. Thanks!

lambdadade commented 2 months ago

Same here. It works somehow, but the error code and the additional step to reopen the created file is annoying. Would be nice to get some fix/workaround.