Skip to content
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

Error: The editor could not be opened because the file was not found. #7023

Open
1 of 2 tasks
andreas-prouza opened this issue Oct 1, 2024 · 3 comments
Open
1 of 2 tasks
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer

Comments

@andreas-prouza
Copy link

andreas-prouza commented Oct 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Linux (Arch)
  • Remote OS: Linux (Arch)
  • Remote Architecture: x86_64
  • code-server --version: Coder v2.15.0+190cd1c

Steps to Reproduce

I published an extension which runs in vscode, theia and code oss.
Only when using it with coder, it has problems to open file link in webview or tree-view.

Steps to Reproduce:

  1. Open a workbench which contains "VS Code Desktop" or "code-server"
  2. Run "VS Code Desktop" or "code-server"
  3. Install my extension "OBI" (Object Builder for IBM i) v0.2.12
  4. Open OBI in the activity bar
  5. In your editor open a folder and in OBI click on the button "Initialize" (this creates a subdirectory .obi)
  6. In the primary sidebar of OBI click on the gear to open the settings webview
  7. In the settings there is a link to the setting-file Open project config file. Click on it

Expected

The file gets opened

Actual

Get an error

Logs

In local VS Code Desktop:

[error] Error: The editor could not be opened because the file was not found.
    at N.gc (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:2451:30725)
    at async N.setInput (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:2451:29589)
    at async o.S (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:2449:24889)
    at async o.L (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:2449:23416)
    at async o.openEditor (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:2449:22399)
    at async vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:2577:27047
    at async f.M (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:1491:76911)
    at async f.openCodeEditor (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:756:41490)
    at async h.open (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:673:49023)
    at async a.open (vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:673:50153)
    at async vscode-file://vscode-app/opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:2455:36948

In code-server:

The editor could not be opened due to an unexpected error: Unable to read file '/home/Andreas/projekte/ibm-i-build-obi/.obi/etc/app-config.toml' (Unavailable (FileSystemError): Error: No file system handle registered (/home))

Screenshot/Video

No response

Does this bug reproduce in native VS Code?

No, this works as expected in native VS Code

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

  • I am using a secure context.

Notes

The webview link looks like the following:
Open project config file

@andreas-prouza andreas-prouza added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Oct 1, 2024
@andreas-prouza
Copy link
Author

VS Code Desktop:

image

If I click on the Create File I see a permission error:

image

The path is valid. If I copy the path to the terminal (using echo) I am able to click on the path link to open the file.

I created the path outside the coder-workspace on my local machine.
Now it worked and I could create the file without permission error.
That means, the link tries to access the file path not in the coder workspace but on my machines file system!

The link to open a file looks the following:
📝 Open project config file

In the tree-view it's the same.

There I add for the tree entries the command attribute:

    this.command = {
      command: 'vscode.open',
      title: 'Open source member',
      arguments: [{
        scheme: 'file',
        path: '/home/Andreas/projekte/ibm-i-build-obi/src/prouzalib/qddssrc/file1.pf.file',
        authority: ''
      }]
    }

Usually this is also working fine.

@code-asher
Copy link
Member

Yeah, I think when it comes to VS Code web (code-server, Codespaces), you have to use the vscode-remote scheme so it knows that the file is on the remote and not a local file. I am not sure if there is a clean way to use vscode-remote in web and file in local though, that would be a better question for the VS Code folks.

@andreas-prouza
Copy link
Author

Many thanks for your answer. I guess I need to find a way to distinguish here.
But you helped me to get one step forward 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants