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

SNOW-906821: The BROWSE action is not supported on the current platform! #1505

Closed
RobbertDM opened this issue Sep 5, 2023 · 9 comments
Closed
Assignees
Labels

Comments

@RobbertDM
Copy link

  1. What version of JDBC driver are you using?
    3.14.1

  2. What operating system and processor architecture are you using?
    Ubuntu 22.04 LTS on x86_64.
    Linux xxx 6.2.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

  3. What version of Java are you using?
    openjdk 19.0.2 2023-01-17

  4. What did you do?
    I'm using DBeaver community edition and trying to add a new Snowflake connection where authenticator is set to externalbrowser.
    I first posted at DBeaver but it's the JDBC driver who's trying to open a browser and failing.
    The stack trace leads me to this line of code:

  5. What did you expect to see?
    A browser opening and showing me a page to login at Snowflake.

  6. Can you set logging to DEBUG and collect the logs?
    Here's the stack trace

2023-09-05 12:16:18.696 - Open [https://repo1.maven.org/maven2/net/snowflake/snowflake-jdbc/maven-metadata.xml]
2023-09-05 12:16:27.780 - Open [https://repo1.maven.org/maven2/net/snowflake/snowflake-jdbc/3.14.1/snowflake-jdbc-3.14.1.jar]
2023-09-05 12:16:36.380 - Open [https://www.apache.org/licenses/LICENSE-2.0.txt]
2023-09-05 12:17:11.918 - Connect with 'jdbc:snowflake://xxx.eu-west-3.aws.snowflakecomputing.com:443/?db=xxx&warehouse=xxx' (snowflake_jdbc-xxx-xxx)
2023-09-05 12:17:13.329 - Execution context opened (jdbc:snowflake://xxx.eu-west-3.aws.snowflakecomputing.com:443/?db=xxx&warehouse=xxx; Main; 1)
Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...
2023-09-05 12:17:13.726 - The BROWSE action is not supported on the current platform!
java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!
	at java.desktop/java.awt.Desktop.checkActionSupport(Unknown Source)
	at java.desktop/java.awt.Desktop.browse(Unknown Source)
	at net.snowflake.client.core.SessionUtilExternalBrowser$DefaultAuthExternalBrowserHandlers.openBrowser(SessionUtilExternalBrowser.java:66)
	at net.snowflake.client.core.SessionUtilExternalBrowser.authenticate(SessionUtilExternalBrowser.java:236)
	at net.snowflake.client.core.SessionUtil.newSession(SessionUtil.java:379)
	at net.snowflake.client.core.SessionUtil.openSession(SessionUtil.java:292)
	at net.snowflake.client.core.SFSession.open(SFSession.java:500)
	at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initialize(DefaultSFConnectionHandler.java:112)
	at net.snowflake.client.jdbc.DefaultSFConnectionHandler.initializeConnection(DefaultSFConnectionHandler.java:85)
	at net.snowflake.client.jdbc.SnowflakeConnectionV1.initConnectionWithImpl(SnowflakeConnectionV1.java:116)
	at net.snowflake.client.jdbc.SnowflakeConnectionV1.<init>(SnowflakeConnectionV1.java:96)
	at net.snowflake.client.jdbc.SnowflakeDriver.connect(SnowflakeDriver.java:187)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.lambda$1(JDBCDataSource.java:237)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.lambda$0(JDBCDataSource.java:250)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:269)
	at org.jkiss.dbeaver.ext.generic.model.GenericDataSource.openConnection(GenericDataSource.java:155)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext.connect(JDBCExecutionContext.java:103)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCRemoteInstance.initializeMainContext(JDBCRemoteInstance.java:102)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCRemoteInstance.<init>(JDBCRemoteInstance.java:61)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.initializeRemoteInstance(JDBCDataSource.java:123)
	at org.jkiss.dbeaver.ext.generic.model.GenericDataSource.<init>(GenericDataSource.java:120)
	at org.jkiss.dbeaver.ext.snowflake.model.SnowflakeDataSource.<init>(SnowflakeDataSource.java:47)
	at org.jkiss.dbeaver.ext.snowflake.SnowflakeDataSourceProvider.openDataSource(SnowflakeDataSourceProvider.java:97)
	at org.jkiss.dbeaver.registry.DataSourceDescriptor.openDataSource(DataSourceDescriptor.java:1278)
	at org.jkiss.dbeaver.registry.DataSourceDescriptor.connect0(DataSourceDescriptor.java:1117)
	at org.jkiss.dbeaver.registry.DataSourceDescriptor.connect(DataSourceDescriptor.java:950)
	at org.jkiss.dbeaver.runtime.jobs.ConnectJob.run(ConnectJob.java:77)
	at org.jkiss.dbeaver.runtime.jobs.ConnectionTestJob.run(ConnectionTestJob.java:103)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

@RobbertDM RobbertDM added the bug label Sep 5, 2023
@github-actions github-actions bot changed the title The BROWSE action is not supported on the current platform! SNOW-906821: The BROWSE action is not supported on the current platform! Sep 5, 2023
@RobbertDM
Copy link
Author

We could wrap those lines in a try/catch block and do the xdg-open line at catch time. What do you think?

RobbertDM added a commit to RobbertDM/snowflake-jdbc that referenced this issue Sep 6, 2023
@sfc-gh-spanaite sfc-gh-spanaite self-assigned this Oct 3, 2023
@sfc-gh-spanaite
Copy link
Contributor

@RobbertDM What is your default web browser?
As far as I can see the BROWSE method in java.awt.Desktop has been designed for Windows and Mac.
It has not been properly tested on Linux and mainly on Gnome and KDE. What is your Linux desktop environment?

@sfc-gh-spanaite sfc-gh-spanaite added the status-triage Issue is under initial triage label Oct 3, 2023
@RobbertDM
Copy link
Author

RobbertDM commented Oct 3, 2023

Mozilla Firefox 117.0.1
GNOME Shell 42.9
Linux 6.2.0-33-generic #33~22.04.1-Ubuntu (that's ubuntu 22.04 LTS)
Wayland

@sfc-gh-spanaite
Copy link
Contributor

sfc-gh-spanaite commented Oct 18, 2023

Hi @RobbertDM , I've tried reproducing this issue and I am not able to. I have a VM with Ubuntu 22:

$ uname -a
Linux XXX 6.2.0-34-generic #34~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep  7 13:12:03 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

then Java 19:

$ java -version
openjdk version "19.0.2" 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)
OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)
  1. A simple Java class compiled and run opens Mozilla Firefox (118.0.2 (64-bit)) for me without any issue
  2. DBeaver CE 23.2.2 also opens a browser window, something like this:

Screenshot 2023-10-18 at 14 02 50

Can you maybe update your Linux/DBeaver/Firefox to the latest versions and try again?

@sfc-gh-spanaite sfc-gh-spanaite removed the status-triage Issue is under initial triage label Oct 18, 2023
@RobbertDM
Copy link
Author

RobbertDM commented Oct 18, 2023

The problem is snap specific.

Indeed, when I just dpkg -i dbeaver-ce_23.2.2_amd64.deb, I get the same behavior as you do, opens this funny little 'Browser' window where I can SSO. Then it says Redirecting to snowflake client in 1 seconds..., which does nothing, until I close the Browser window, then DBeaver tells me it's connected and everything works fine.

For the snap version, however, it tells me something about it being unable to run in a sandbox. If you want to reproduce it, uninstall the .deb version and run snap install dbeaver-ce in your VM :)

@sfc-gh-spanaite
Copy link
Contributor

@RobbertDM When I run it from snap I get another error while trying to open the browser:

> Start Browser Support [org.eclipse.ui.browser 3.8.0.v20230329-1440]

(process:39231): GLib-GIO-WARNING **: 17:32:46.678: GDBus.Error:org.freedesktop.portal.Error.NotAllowed: This call is not available inside the sandbox

I've not looked into yet to see why.

@RobbertDM
Copy link
Author

That's what I got too last time I ran with the snap version :) idk what the difference is then to the original error 🤷

@sfc-gh-spanaite
Copy link
Contributor

Are you bound to use only the snap version rather than just installing it with dpkg? I feel this is going into a different side rather than focusing on JDBC and I don't really have the time to go further into that investigation.

@RobbertDM
Copy link
Author

Nope, fixed for me, thanks for the help, I wouldn't have thought of the .deb version without you. Let's close this one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants