tooltitude / support

Tooltitude Support
https://www.tooltitude.com
Other
21 stars 0 forks source link

When running vscode and go as snaps, the go not installed message is displayed #40

Closed pramod-shenkar closed 6 months ago

pramod-shenkar commented 7 months ago

I installed Go & vscode using snap. Also set gopath & path env var for go. Still getting following error Tooltitude failed to get Go environment with the 'go env --json' command If you experience this, and have Go installed, please report it to: https://github.com/tooltitude/support/issues

Execution error:

Error: Command failed: go env --json

Environment variables (note: you could override environment variables with the 'tooltitude.env' property): { "BAMF_DESKTOP_FILE_HINT": "/var/lib/snapd/desktop/applications/code_code.desktop", "CHROME_DESKTOP": "code-url-handler.desktop", "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/302850189/bus", "DEFAULTS_PATH": "/usr/share/gconf/ubuntu.default.path", "DESKTOP_SESSION": "ubuntu", "DISPLAY": ":0", "ELECTRON_NO_ATTACH_CONSOLE": "1", "GDK_BACKEND": "x11", "GDK_PIXBUF_MODULEDIR": "/snap/code/156/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders", "GDK_PIXBUF_MODULE_FILE": "/home/pramod.shenkar@org.com/snap/code/common/.cache/gdk-pixbuf-loaders.cache", "GDMSESSION": "ubuntu", "GIO_LAUNCHED_DESKTOP_FILE": "/var/lib/snapd/desktop/applications/code_code.desktop", "GIO_LAUNCHED_DESKTOP_FILE_PID": "45174", "GIO_MODULE_DIR": "/home/pramod.shenkar@org.com/snap/code/common/.cache/gio-modules", "GJS_DEBUG_OUTPUT": "stderr", "GJS_DEBUG_TOPICS": "JS ERROR;JS LOG", "GNOME_DESKTOP_SESSION_ID": "this-is-deprecated", "GNOME_SHELL_SESSION_MODE": "ubuntu", "GOPATH": "/home/pramod.shenkar@org.com/go", "GPG_AGENT_INFO": "/run/user/302850189/gnupg/S.gpg-agent:0:1", "GSETTINGS_SCHEMA_DIR": "/home/pramod.shenkar@org.com/snap/code/156/.local/share/glib-2.0/schemas", "GTK_EXE_PREFIX": "/snap/code/156/usr", "GTK_IM_MODULE_FILE": "/home/pramod.shenkar@org.com/snap/code/common/.cache/immodules/immodules.cache", "GTK_MODULES": "gail:atk-bridge", "GTK_PATH": "/snap/code/156/usr/lib/x86_64-linux-gnu/gtk-3.0", "HOME": "/home/pramod.shenkar@org.com", "IM_CONFIG_PHASE": "1", "INVOCATION_ID": "6df48ba28b4049e7a7e39111eddc4ad3", "JOURNAL_STREAM": "8:215026", "KRB5CCNAME": "FILE:/tmp/krb5cc_302850189_yuwgzL", "LANG": "en_IN", "LANGUAGE": "en_IN:en", "LESSCLOSE": "/usr/bin/lesspipe %s %s", "LESSOPEN": "| /usr/bin/lesspipe %s", "LOCPATH": "/snap/code/156/usr/lib/locale", "LOGNAME": "pramod.shenkar", "MANAGERPID": "4952", "MANDATORY_PATH": "/usr/share/gconf/ubuntu.mandatory.path", "ORIGINAL_XDG_CURRENT_DESKTOP": "ubuntu:GNOME", "PATH": "/home/pramod.shenkar@org.com/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/bin:/home/pramod.shenkar@org.com/go/bin", "PWD": "/home/pramod.shenkar@org.com", "QT_ACCESSIBILITY": "1", "QT_IM_MODULE": "ibus", "SESSION_MANAGER": "local/HYDNALUE24249:@/tmp/.ICE-unix/5590,unix/HYDNALUE24249:/tmp/.ICE-unix/5590", "SHELL": "/bin/bash", "SHLVL": "0", "SNAP": "/snap/code/156", "SNAP_ARCH": "amd64", "SNAP_COMMON": "/var/snap/code/common", "SNAP_CONTEXT": "eP6iX5nRp3yL5tNXu_Ft1DVqwnP8m9VdoilCNlTW7Qwt4GfiR0iu", "SNAP_COOKIE": "eP6iX5nRp3yL5tNXu_Ft1DVqwnP8m9VdoilCNlTW7Qwt4GfiR0iu", "SNAP_DATA": "/var/snap/code/156", "SNAP_EUID": "302850189", "SNAP_INSTANCE_NAME": "code", "SNAP_LAUNCHER_ARCH_TRIPLET": "x86_64-linux-gnu", "SNAP_LIBRARY_PATH": "/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void", "SNAP_NAME": "code", "SNAP_REAL_HOME": "/home/pramod.shenkar@org.com", "SNAP_REVISION": "156", "SNAP_UID": "302850189", "SNAP_USER_COMMON": "/home/pramod.shenkar@org.com/snap/code/common", "SNAP_USER_DATA": "/home/pramod.shenkar@org.com/snap/code/156", "SNAP_VERSION": "5c3e652f", "SSH_AGENT_PID": "5527", "SSH_AUTH_SOCK": "/run/user/302850189/keyring/ssh", "USER": "pramod.shenkar", "USERNAME": "pramod.shenkar", "VSCODE_AMD_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess", "VSCODE_CLI": "1", "VSCODE_CODE_CACHE_PATH": "/home/pramod.shenkar@org.com/.config/Code/CachedData/5c3e652f63e798a5ac2f31ffd0d863669328dc4c", "VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost", "VSCODE_CWD": "/home/pramod.shenkar@org.com", "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true", "VSCODE_IPC_HOOK": "/run/user/302850189/vscode-6694810f-1.88-main.sock", "VSCODE_NLS_CONFIG": "{\"locale\":\"en-gb\",\"osLocale\":\"en-in\",\"availableLanguages\":{},\"_languagePackSupport\":true}", "VSCODE_PID": "45220", "WINDOWPATH": "2", "XAUTHORITY": "/run/user/302850189/gdm/Xauthority", "XDG_CONFIG_DIRS": "/etc/xdg/xdg-ubuntu:/etc/xdg", "XDG_CONFIG_DIRS_VSCODE_SNAP_ORIG": "/etc/xdg/xdg-ubuntu:/etc/xdg", "XDG_CURRENT_DESKTOP": "Unity", "XDG_DATA_DIRS": "/home/pramod.shenkar@org.com/snap/code/156/.local/share:/home/pramod.shenkar@org.com/snap/code/156:/snap/code/156/usr/share:/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", "XDG_DATA_DIRS_VSCODE_SNAP_ORIG": "/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop", "XDG_MENU_PREFIX": "gnome-", "XDG_RUNTIME_DIR": "/run/user/302850189", "XDG_SESSION_CLASS": "user", "XDG_SESSION_DESKTOP": "ubuntu", "XDG_SESSIONTYPE": "x11", "XMODIFIERS": "@im=ibus", "": "/snap/code/156/usr/share/code/code", "ELECTRON_RUN_AS_NODE": "1", "GOMODCACHE": "/home/pramod.shenkar@org.com/go/pkg/mod", "GOPROXY": "https://proxy.golang.org,direct", "VSCODE_L10N_BUNDLE_LOCATION": "" }

tooltitude-support commented 7 months ago

@pramod-shenkar Thank you very much for your feedback! I will take a look at it a bit later today.

tooltitude-support commented 7 months ago

@pramod-shenkar

Looking at the PATH variable everything looks fine:

"PATH": ...:/snap/bin:..., <- it go should be there

I am installing ubuntu with vscode and go as snaps to reproduce it.

tooltitude-support commented 7 months ago

@pramod-shenkar It reproduced (had to install clean ubuntu for this, though). Will investigate further. Thanks a lot for reporting it!

tooltitude-support commented 7 months ago

@pramod-shenkar If I login with ssh remote extension everything works well, so this problem have something todo with vscode installed via snap.

tooltitude-support commented 7 months ago

It looks like it's related to a limitation in snap: https://forum.snapcraft.io/t/node-snap-issues-with-exec-of-npm-node-yarn/23635

Will try to find a way to work this around.

tooltitude-support commented 7 months ago

It seems that vscode-go had a very similar issue: https://github.com/golang/vscode-go/issues/166

They used a workaround to make it work. I will think what could be done to make it work better. However, the best solution would be not to use snap for go and vscode.

tooltitude-support commented 7 months ago

@pramod-shenkar I found a pretty easy workaround. You could add the following to your configuration json:

    "tooltitude.env": {
        "PATH": "/snap/go/current/bin:${env:PATH}"
    }

I will still think how to make it work without this intervention and at the same time without changing the user provided configuration in a non trivial way.

tooltitude-support commented 7 months ago

@pramod-shenkar

Ok, so I wrote a detailed error message, which is easy to see when this error happens. We decided not to change the path automatically, i.e. adding an equivalent of the configuration setting above. There are many package managers, and they might have similar problems.

Please, let me know whether you are able to resolve this issue with the setting above.

pramod-shenkar commented 7 months ago

Thanks For replying. I applied provided solution & its working great Thanks for great support.

On Fri, Apr 12, 2024 at 6:06 AM Tooltitude Support @.***> wrote:

@pramod-shenkar https://github.com/pramod-shenkar

Ok, so I wrote a detailed error message, which is easy to see when this error happens. We decided not to change the path automatically, i.e. adding an equivalent of the configuration setting above. There are many package managers, and they might have similar problems.

Please, let me know whether you are able to resolve this issue with the setting above.

— Reply to this email directly, view it on GitHub https://github.com/tooltitude/support/issues/40#issuecomment-2050767451, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBJ2WWZJJCW5GWYMEGRSHETY44UBLAVCNFSM6AAAAABGBTKVNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQG43DONBVGE . You are receiving this because you were mentioned.Message ID: @.***>

tooltitude-support commented 6 months ago

I will keep this issue open until either we find a sustainable solution, or it will be resolved upstream.

pramod-shenkar commented 6 months ago

noted

On Mon, Apr 15, 2024 at 6:45 PM Tooltitude Support @.***> wrote:

I will keep this issue open until either we find a sustainable solution, or it will be resolved upstream.

— Reply to this email directly, view it on GitHub https://github.com/tooltitude/support/issues/40#issuecomment-2056828598, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBJ2WW5HTUPCKVVSPNBBYETY5PHGZAVCNFSM6AAAAABGBTKVNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJWHAZDQNJZHA . You are receiving this because you were mentioned.Message ID: @.***>

tooltitude-support commented 6 months ago

We added detection and automatic fix in the latest version.