dbeaver: Access Denied: Cannot Read /usr/bin When Installed as Snap

System information:

  • Elementary OS 5.1
  • DBeaver 6.3.1

Connection specification:

  • MariaDB
  • MySQL

Describe your question:

I am not able to read my system’s /usr/bin path within DBeaver when it is installed through the Snap packaging system. I have A MySQL and MariaDB client on my local machine in that directory and would like to use DBeaver to dump databases. Is there any insight some one can provide?

I apologize if this is a technical limitation of Snap and does not belong here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 11
  • Comments: 29 (8 by maintainers)

Most upvoted comments

My case was an issue when trying to save a DUMP on a second HDD. I solved by following steps:

1st - open ubuntu software 2nd - search for dbeaver-ce 3rd - after installed it, click Permissions 4th - check Read/write files on removable storage devices

Hope it might help someone in the future.

Cheers

snap is the biggest crap, uninstall snap version and use the deb package

Screenshot from 2020-06-29 20-52-00

Same situation here. Used snap install on ubuntu 20.04

tried snap package on ubuntu 20.04 and also can’t get native client running, even no permissions to /usr/bin… installed -deb package from https://dbeaver.io/download/ and now all fine…

i just needed to set /usr/bin as native client home dir: image

As it said above, the reason why snap version is not able to find/read the “local client” binaries is the strict confinement. But there is a way to workaround it:

  1. Allow dbeaver-ce snap to read/write from removable media Screenshot from 2023-01-30 12-42-07

  2. Create a mount point in /mnt sudo mkdir /mnt/usr_bin

  3. Bind mount your binaries location (/usr/bin in my case) to newly created dir sudo mount --bind /usr/bin/ /mnt/usr_bin/

  4. Now you are able to set /mnt/usr_bin as your “local client” home Screenshot from 2023-01-30 12-43-40

same on Ubuntu 22

A hacky workaround to keep your snap and avoid reinstalling as .deb:

Just add the your /usr/bin (or wherever your DB client is) to your bookmarked folders in file explorer:

dbeaver-snap-dir-issue

This actually worked to add the client home location somehow, but still gives me errors when actually attempting to do something like run a backup. I’m using Postgres not MariaDB, and I still get an error like Error executing process Utility 'pg_dump' not found in client home '/usr/bin' (/usr/bin) because DBeaver still doesn’t have permission to the perl script link in /usr/bin even with this location now added.

Same with postgres.

dveaver have no permission to access /usr/bin.

I ran .deb file for dbeaver and executed fine!

I can reproduce this on Ubuntu 19 when installed via “Ubuntu Software”

Same here in /snap/ Ubuntu folder with mysql. Dbeaver don’t ask permission to me in initialize application.

I tried run dbeaver with sudo, log file is below:

No protocol specified
Unable to init server: Could not connect: Connection refused
Dbeaver: Cannot open display: 
Picked up _JAVA_OPTIONS: -Duser.home=/root/snap/dbeaver-ce/56
No protocol specified
Unable to init server: Could not connect: Connection refused
Dbeaver: Cannot open display: 
> Start DBeaver Standalone [org.jkiss.dbeaver.ui.app.standalone 7.0.5.202005171753]
> Start Eclipse e4 Workbench [org.eclipse.e4.ui.workbench 1.11.200.v20200205-1503]
> Start Eclipse Workbench Model [org.eclipse.e4.ui.model.workbench 2.1.700.v20200113-1422]
> Start Eclipse Jobs Mechanism [org.eclipse.core.jobs 3.10.700.v20200106-1020]
> Start Eclipse IDE UI [org.eclipse.ui.ide 3.17.0.v20200217-1511]
> Start DBeaver Core Plug-in [org.jkiss.dbeaver.core 7.0.5.202005171753]
> Start Core File Systems [org.eclipse.core.filesystem 1.7.700.v20200110-1734]
> Start Core Resource Management [org.eclipse.core.resources 3.13.700.v20200209-1624]
2020-05-26 12:49:54.632 - Initializing DBeaver 7.0.5
2020-05-26 12:49:54.633 - Host plugin: org.jkiss.dbeaver.ui.app.standalone 7.0.5.202005171753
2020-05-26 12:49:54.633 - Initialize Core...
2020-05-26 12:49:54.634 - Can't find BC security provider. Use default JCE.
2020-05-26 12:49:54.634 - BouncyCastle not registered, using the default JCE provider
2020-05-26 12:49:54.747 - Initialize base platform...
> Start DBeaver UI Navigator [org.jkiss.dbeaver.ui.navigator 1.0.33.202005171753]
2020-05-26 12:49:54.877 - Core initialized (244ms)
2020-05-26 12:49:54.880 - Create display
No protocol specified
Unable to init server: Could not connect: Connection refused
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
	at org.eclipse.swt.SWT.error(SWT.java:4749)
	at org.eclipse.swt.widgets.Display.createDisplay(Display.java:1130)
	at org.eclipse.swt.widgets.Display.create(Display.java:1070)
	at org.eclipse.swt.graphics.Device.<init>(Device.java:175)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:636)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:627)
	at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:776)
	at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:166)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.getDisplay(DBeaverApplication.java:404)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.updateSplashHandler(DBeaverApplication.java:330)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.start(DBeaverApplication.java:205)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
Error updating splash shell
2020-05-26 12:49:54.889 - DBeaver 7.0.5.202005171753 is starting
2020-05-26 12:49:54.893 - OS: Linux 5.4.0-31-generic (amd64)
2020-05-26 12:49:54.894 - Java version: 1.8.0_252 by Private Build (64bit)
2020-05-26 12:49:54.895 - Install path: '/snap/dbeaver-ce/56/usr/share/dbeaver'
2020-05-26 12:49:54.895 - Instance path: 'file:/root/snap/dbeaver-ce/56/.local/share/DBeaverData/workspace6/'
2020-05-26 12:49:54.895 - Memory available 89Mb/910Mb
2020-05-26 12:49:54.905 - Starting RMI server at 38631
2020-05-26 12:49:54.964 - Run workbench
2020-05-26 12:49:54.964 - Create display
No protocol specified
Unable to init server: Could not connect: Connection refused
2020-05-26 12:49:54.964 - Internal error in workbench lifecycle
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
	at org.eclipse.swt.SWT.error(SWT.java:4749)
	at org.eclipse.swt.widgets.Display.createDisplay(Display.java:1130)
	at org.eclipse.swt.widgets.Display.create(Display.java:1070)
	at org.eclipse.swt.graphics.Device.<init>(Device.java:175)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:636)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:627)
	at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:776)
	at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:166)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.getDisplay(DBeaverApplication.java:404)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.start(DBeaverApplication.java:232)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
2020-05-26 12:49:54.966 - DBeaver is stopping
2020-05-26 12:49:54.969 - Stop RMI server
> Start DBeaver UI [org.jkiss.dbeaver.ui 5.1.48.202005171753]
No protocol specified
Unable to init server: Could not connect: Connection refused
2020-05-26 12:49:55.043 - org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
	at org.eclipse.swt.SWT.error(SWT.java:4749)
	at org.eclipse.swt.widgets.Display.createDisplay(Display.java:1130)
	at org.eclipse.swt.widgets.Display.create(Display.java:1070)
	at org.eclipse.swt.graphics.Device.<init>(Device.java:175)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:636)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:627)
	at org.eclipse.swt.widgets.Display.getDefault(Display.java:2282)
	at org.jkiss.dbeaver.ui.UIUtils.getDisplay(UIUtils.java:1744)
	at org.jkiss.dbeaver.ui.UIUtils.asyncExec(UIUtils.java:1750)
	at org.jkiss.dbeaver.core.DBeaverUI.initialize(DBeaverUI.java:135)
	at org.jkiss.dbeaver.core.DBeaverUI.getInstance(DBeaverUI.java:95)
	at org.jkiss.dbeaver.core.DBeaverCoreAdapterFactory.getAdapter(DBeaverCoreAdapterFactory.java:54)
	at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:339)
	at org.eclipse.core.internal.runtime.AdapterManager.loadAdapter(AdapterManager.java:366)
	at org.jkiss.dbeaver.utils.GeneralUtils.queryAdapterManager(GeneralUtils.java:729)
	at org.jkiss.dbeaver.utils.GeneralUtils.adapt(GeneralUtils.java:708)
	at org.jkiss.dbeaver.utils.GeneralUtils.adapt(GeneralUtils.java:723)
	at org.jkiss.dbeaver.runtime.DBWorkbench.getPlatformUI(DBWorkbench.java:66)
	at org.jkiss.dbeaver.utils.RuntimeUtils.runTask(RuntimeUtils.java:225)
	at org.jkiss.dbeaver.utils.RuntimeUtils.runTask(RuntimeUtils.java:190)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.shutdown(DBeaverApplication.java:512)
	at org.jkiss.dbeaver.ui.app.standalone.DBeaverApplication.start(DBeaverApplication.java:258)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
2020-05-26 12:49:55.045 - DBeaver shutdown completed
2020-05-26 12:49:55.107 - Shutdown Core...
2020-05-26 12:49:55.235 - Total database drivers: 81 (81)
2020-05-26 12:49:55.336 - Shutdown completed in 229ms
No protocol specified
Unable to init server: Could not connect: Connection refused
Dbeaver: Cannot open display: 
Dbeaver:
An error has occurred. See the log file
/root/snap/dbeaver-ce/56/.local/share/DBeaverData/workspace6/.metadata/.log.

I tried above mentioned steps… didn’t help though So I just went the command line way Sharing commands for MYSQL

Create dump mysqldump -u [username] -p -h [host] [databasename] > [dumpfile.sql]

Import Dump data mysqldump -u [username] -p -h [host] [databasename] < [dumpfile.sql]

Import Dump data at localhost mysqldump -u [username] -p [databasename] < [dumpfile.sql]

PS: I self created the databasename while importing before using the command.

Using .deb based installation and everything works perfectly (the specific issue for me was setting local client, required to perform the backup operation).

same here, installed via snap install dbeaver-ce trying to dump a mysql database with no success.

As far as i can tell its related to strict confinement, because dbeaver need an local client to do the export, and because of snap confinement dbeaver cant reach the mysql client installed on my system

that wasnt fix yet?

This could easily be fixed in the snap, and I’m happy to help the developers with this, but I can’t do anything until they actually use a publicly available snapcraft.yaml file to build the snap and use the patches provided by the community. This issue is tracked here: https://github.com/dbeaver/dbeaver/issues/8774

@galgalesh Thank you, I am personally fine wit the MariaDB client, but I think it may be more valuable to include both.