redhat-developer / vscode-xml

Editing XML in Visual Studio Code made easy
Eclipse Public License 2.0
254 stars 78 forks source link

`Error: No unique release file found!` when activating extension on Nix host #990

Open StarLederer opened 4 months ago

StarLederer commented 4 months ago

Upon opening any XML file for the first time after launching VSCode the following shows up in the extension host output panel and the extension does not start

2024-04-23 12:00:00.000 [error] Error: No unique release file found!
    at /home/team-output/.vscode-server/extensions/redhat.vscode-xml-0.26.1-linux-x64/dist/extension.js:2:178677
    at callback (/home/team-output/.open-remote-ssh/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/node_modules/graceful-fs/polyfills.js:306:20)
    at FSReqCallback.oncomplete (node:fs:202:21)

I am runinng VSCode in a minimalist docker container with Nix and I did not expect the server to be able to install and run by itself so I configured the binary manually:

{
    "xml.server.binary.path": "/nix/store/19mj4fqvwvd941awdrm3rwn43rk8z414-lemminx-0.27.0/bin/lemminx",
    "xml.server.preferBinary": true
}

I hoped that would remove the need to read information about my system but unfortunately the error persisted.

fbricon commented 4 months ago

this is thrown by getos, failing to find a release file in the distro. vscode-xml doesn't use getos directly, but through its telemetry module.

Can you try setting "redhat.telemetry.enabled":"false" in your vscode settings, see if it helps?

StarLederer commented 4 months ago

Thank you, creating /etc/NIXOS (even though I am not really on NixOS) worked and the extension is showing signs of working correctly!

Regardless, I wonder what did the extension need to getos for? Telemetry is off by default and i assume it would only need it to download the correct language server binary. I don't mind having the release file in the container but I wonder if being able to bypass it could improve the experience for future users

fbricon commented 4 months ago

I don't know why getos is called if telemetry is disabled. It's possible that code is instantiated even if telemetry is disabled. We need to investigate.