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

GTK+ module libcanberra-gtk-module.so cannot be loaded #179086

Open
Petros626 opened this issue Apr 4, 2023 · 19 comments · Fixed by #185834
Open

GTK+ module libcanberra-gtk-module.so cannot be loaded #179086

Petros626 opened this issue Apr 4, 2023 · 19 comments · Fixed by #185834
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member help wanted Issues identified as good community contribution opportunities linux Issues with VS Code on Linux snap Issues related to the snap package verification-found Issue verification failed

Comments

@Petros626
Copy link

Hello guys,

I'm using OpenCV in VSCode (Ubuntu Software installation) and everything worked fine, until I updated my libraries (sudo apt-get update/upgrade/full-upgrade) I guess. But now VSCode or rather OpenCV can't find the GTK library.

I've tested this succesfully:
GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0 ./test --> works

But when I specify the version gtk-3.0:
GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-3.0 ./test --> fails

Normally the loaded version without using GTK_PATH is gtk-3.0 and then it shows me this error:
image

I verified that the in /usr/lib/x86_64-linux-gnu/gtk-3.0/modules is:

image

Would appreciate to solve this warning and to understand why the .so cannot be loaded.

Thanks in advance

UPDATE: the example code can be executed without warnings in the normal gnome terminal, but VSCode seems to habe problems to find the specific libraries, so it's definitely VSCode.

@joaomoreno joaomoreno assigned deepak1556 and unassigned joaomoreno Apr 5, 2023
@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label snap Issues related to the snap package confirmed Issue has been confirmed by VS Code Team member linux Issues with VS Code on Linux labels Apr 5, 2023
@deepak1556 deepak1556 added this to the April 2023 milestone Apr 5, 2023
@deepak1556 deepak1556 modified the milestones: April 2023, May 2023 Apr 26, 2023
@deepak1556 deepak1556 modified the milestones: May 2023, June 2023 May 29, 2023
@AmeyaVS
Copy link

AmeyaVS commented May 31, 2023

Any timeline for getting a fix for this issue and #179274 ?
Currently VSCode is unusable on fresh Linux Installs when trying to configure GitHub extensions as it fails to launch the system browser.

@Petros626
Copy link
Author

Yeah this could be a solution, but in my case I reinstalled VSCode with the deb package and not with Ubuntu Software. Seems snap occurs the problem.

@deepak1556 deepak1556 reopened this Jun 15, 2023
@deepak1556
Copy link
Collaborator

I will keep this issue open to address the problem with snap packages.

@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jun 22, 2023
@deepak1556 deepak1556 added the author-verification-requested Issues potentially verifiable by issue author label Jun 23, 2023
@vscodenpa
Copy link

This bug has been fixed in the latest release of VS Code Insiders!

@Petros626, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version a572746 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@connor4312 connor4312 added the verification-steps-needed Steps to verify are needed for verification label Jun 28, 2023
@deepak1556
Copy link
Collaborator

This requires author verification.

@Petros626 can you help confirm if this issue is resolved in latest insiders of snap ?

snap install code-insiders --classic

@Petros626
Copy link
Author

This requires author verification.

@Petros626 can you help confirm if this issue is resolved in latest insiders of snap ?

snap install code-insiders --classic

Hey I'm not able to access the pc I've used for this work. How else could we verify it?

@deepak1556 deepak1556 removed the author-verification-requested Issues potentially verifiable by issue author label Jun 30, 2023
@deepak1556
Copy link
Collaborator

No worries, I have removed author verification. We might not be able to verify the OpenCV setup but following steps would work as well from #179274 (comment)

Steps for verification:

@deepak1556 deepak1556 removed the verification-steps-needed Steps to verify are needed for verification label Jun 30, 2023
@rzhao271 rzhao271 added the verified Verification succeeded label Jun 30, 2023
@rzhao271
Copy link
Contributor

With the verification steps above, I get a single message Gtk-Message: <timestamp>: Failed to load module "canberra-gtk-module", but that's it.

@Petros626
Copy link
Author

No worries, I have removed author verification. We might not be able to verify the OpenCV setup but following steps would work as well from #179274 (comment)

Steps for verification:

Okay glad to hear that.

@AmeyaVS
Copy link

AmeyaVS commented Jul 11, 2023

Is this integrated in stable release?

@rzhao271
Copy link
Contributor

@AmeyaVS the change is in the latest Stable release. Let us know if you're still seeing the issue.

@AmeyaVS
Copy link

AmeyaVS commented Jul 11, 2023

I am still observing this issue on my system here's the details from the VSCode versions:

Version: 1.80.0
Commit: 660393deaaa6d1996740ff4880f1bad43768c814
Date: 2023-07-04T13:39:48.236Z
Electron: 22.3.14
ElectronBuildId: 21893604
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.3.11-200.fc38.x86_64 snap

I still need to unset the GTK_PATH environment variable to launch any GTK+ Application as captured here: #179274.

@deepak1556
Copy link
Collaborator

@AmeyaVS are you seeing the error with same steps from #179274 (comment) ? Can you share the output of the following steps,

  1. Launch VSCode
  2. Delete any terminal related settings to unset GTK_PATH
  3. Open integrated terminal
  4. Run printenv

@AmeyaVS
Copy link

AmeyaVS commented Jul 12, 2023

@AmeyaVS are you seeing the error with same steps from #179274 (comment) ? Can you share the output of the following steps,

The failure still exists, also I am unable to configure GitHub Account credentials on my VSCode as Firefox fails to launch from VSCode due to the same reasons.

1. Launch VSCode

2. Delete any terminal related settings to unset `GTK_PATH`

I don't have it unset in any VSCode settings. This is a new installation.

3. Open integrated terminal

4. Run `printenv`

Here's the grepped GTK/VSCODE Environment variables captured on my system in the integrated terminal:

XDG_CONFIG_DIRS_VSCODE_SNAP_ORIG=
GDK_BACKEND_VSCODE_SNAP_ORIG=
GIO_MODULE_DIR_VSCODE_SNAP_ORIG=
GTK_EXE_PREFIX=/snap/code/133/usr
VSCODE_GIT_ASKPASS_NODE=/var/lib/snapd/snap/code/133/usr/share/code/code
VSCODE_GIT_ASKPASS_EXTRA_ARGS=--ms-enable-electron-run-as-node
GSETTINGS_SCHEMA_DIR_VSCODE_SNAP_ORIG=
GTK_IM_MODULE_FILE_VSCODE_SNAP_ORIG=
GTK_PATH=/snap/code/133/usr/lib/x86_64-linux-gnu/gtk-3.0
GTK_PATH_VSCODE_SNAP_ORIG=
VSCODE_GIT_IPC_HANDLE=/run/user/1000/vscode-git-419a178ba9.sock
GTK_EXE_PREFIX_VSCODE_SNAP_ORIG=
XDG_DATA_DIRS_VSCODE_SNAP_ORIG=/home/ameyavs/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
VSCODE_GIT_ASKPASS_MAIN=/var/lib/snapd/snap/code/133/usr/share/code/resources/app/extensions/git/dist/askpass-main.js
GTK_IM_MODULE_FILE=/home/ameyavs/snap/code/common/.cache/immodules/immodules.cache
LOCPATH_VSCODE_SNAP_ORIG=

I don't have any of the GTK* Evironment Variables in my default system terminal.
It seems the issue is not resolved.

@deepak1556 deepak1556 reopened this Jul 12, 2023
@deepak1556 deepak1556 modified the milestones: June 2023, July 2023 Jul 12, 2023
@vscodenpa vscodenpa removed the insiders-released Patch has been released in VS Code Insiders label Jul 12, 2023
@deepak1556 deepak1556 added verification-found Issue verification failed and removed verified Verification succeeded labels Jul 12, 2023
@deepak1556 deepak1556 removed this from the July 2023 milestone Jul 25, 2023
@AmeyaVS
Copy link

AmeyaVS commented Jul 25, 2023

Is there a timeline for this issue to be fixed?

@AmeyaVS
Copy link

AmeyaVS commented Aug 11, 2023

Any updates?

@deepak1556
Copy link
Collaborator

The terminal agents are inheriting the environment from the snap shell which gets adjusted with our custom GTK env variables, so this is no longer trivial to solve. It might take a while before I get to address this issue. I recommend using external terminal with snap or if you need integrated terminal then please switch to the debian package.

@Ryanf55
Copy link

Ryanf55 commented Nov 21, 2023

This affects all Linux ArduPilot users of MAVProxy in VSCode.

Manually calling unset GTK_PATH can fix it in each terminal session.

We use Linux for development because of the difficulty of using hardware debuggers in WSL.

@AmeyaVS
Copy link

AmeyaVS commented Mar 9, 2024

I would like to add it seems now a new environment variable GIO_MODULE_DIR is causing other gtk based applications running from Snap installed VSCode Built-in Terminal is breaking them, and the symptoms are similar to issue #179274.

Is there any timeline for getting any fixes for the snap package?

@Tyriar Tyriar removed the terminal General terminal issues that don't fall under another label label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member help wanted Issues identified as good community contribution opportunities linux Issues with VS Code on Linux snap Issues related to the snap package verification-found Issue verification failed
Projects
None yet
9 participants