You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by David Ramirez <da...@gmail.com> on 2023/03/08 16:12:35 UTC

HELP NEEDED: Cannot use the mariadb/mysql JDBC connector to enable DB Authentication.

Good morning/afternoon/night to you all!
I am writing this as I believe it is a very silly mistake but I am not
savvy enough on Guacamole+Tomcat to identify the issue.
I had a standalone Guacamole 1.4.0 Installation which is reachable through
a NGINX Reverse Proxy. The access to Guacamole was using local
authentication with the user-mapping.xml user definition file and it worked.

I've followed all the steps on the documentation to upgrade and install
Guacamole Server on Ubuntu 20.04.
* I have made my guacamole Install by compiling it from source code on
1.5.0. It compiles and installs ok.
* Guacamole installed as root <-- I know I have to correct this at some
point in the future.
* Same access through NGINX
* I am using init.d start scripts managing it as a legacy systemctl unit.
* Guacamole home is /etc/guacamole as default
* I decided to use mariadb instead of MySQL, so I installed it using the
tutorial from DigitalOcean at:
https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-20-04
* I have downloaded the JDBC extension package at:
https://apache.org/dyn/closer.lua/guacamole/1.5.0/binary/guacamole-auth-jdbc-1.5.0.tar.gz?action=download
* I have placed this extension at /etc/guacamole/extensions
* I created the database per the instructions on the manual.
* I downloaded the DB connector for MariaDB at:
https://mariadb.com/kb/en/about-mariadb-connector-j/
* I placed the connector at /etc/guacamole/lib
* Here is my guacamole.properties file contents:
guacd-hostname: localhost
guacd-port: 4822
# MariaDB/MySQL properties
mysql-hostname: localhost
mysql-database: guacamole_db
mysql-username: guacamole_user
mysql-password: somepassword
mysql-driver: mariadb
** I added the driver definition to mariadb
* Restarted tomcat 9

When I try to login to guacamole I see an error that the action could not
be completed and contact the administrator.
So, it is an error with the DB connector. When looking at:
/va/log/tomcat9/catalina.out here is the output:
[2023-03-08 16:03:47] [info] 16:03:47.527 [http-nio-8080-exec-10] WARN
 o.a.g.e.AuthenticationProviderFacade - The "mysql" authentication provider
has encountered an internal error which will halt the authentication
process. If this is unexpected or you are the developer of this
authentication provider, you may wish to enable debug-level logging. If
this is expected and you wish to ignore such failures in the future, please
set "skip-if-unavailable: mysql" within your guacamole.properties.
[2023-03-08 16:03:47] [info] 16:03:47.527 [http-nio-8080-exec-10] ERROR
o.a.g.rest.RESTExceptionMapper - Unexpected internal error:
[2023-03-08 16:03:47] [info] ### Error querying database.  Cause:
java.sql.SQLException: No suitable driver found for
jdbc:mysql://localhost:3306/guacamole_db
[2023-03-08 16:03:47] [info] ### The error may exist in
org/apache/guacamole/auth/jdbc/user/UserMapper.xml
[2023-03-08 16:03:47] [info] ### The error may involve
org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
[2023-03-08 16:03:47] [info] ### The error occurred while executing a query
*[2023-03-08 16:03:47] [info] ### Cause: java.sql.SQLException: No suitable
driver found for jdbc:mysql://localhost:3306/guacamole_db*

It is CLEAR as light that Tomcat9 is unable to read/reach the mariadb
connector. But for the love of me, I can't find why tomcat9 is unable to
read/reach the connector at /etc/guacamole/lib
/etc/guacamole is owned by root with group root with permissions
rwx,r-x,r-x which I believe is correct. Beyond that I do not know what may
be wrong.
I really believe this is a very simple mistake that I am overseeing.
Any help would be really appreciated!
Regards,
David.

Re: HELP NEEDED: Cannot use the mariadb/mysql JDBC connector to enable DB Authentication.

Posted by Michael Jumper <mj...@apache.org>.
On Wed, Mar 8, 2023 at 3:38 PM David Ramirez <da...@gmail.com> wrote:

> Thanks a lot for the quick response to all!
> Michael, that was indeed the problem. Once I downloaded the latest version
> of the mysql_j client (as of March 8th, 2023 is version 8.0.32) I was able
> to use the DB authentication.
> I would like to suggest for this known issue to be documented on the
> installation guide.
>

Updates to the manual that goes out with each release are handled
identically to code changes, so we may as well directly address the issue
itself within said code.

What would be the right place to ask for this change so I can upload the
> request?
>

JIRA: https://issues.apache.org/jira/browse/GUACAMOLE/

- Mike

Re: HELP NEEDED: Cannot use the mariadb/mysql JDBC connector to enable DB Authentication.

Posted by David Ramirez <da...@gmail.com>.
Thanks a lot for the quick response to all!
Michael, that was indeed the problem. Once I downloaded the latest version
of the mysql_j client (as of March 8th, 2023 is version 8.0.32) I was able
to use the DB authentication.
I would like to suggest for this known issue to be documented on the
installation guide. What would be the right place to ask for this change so
I can upload the request?
Thanks a lot again for your help!
Regards,
David

On Wed, Mar 8, 2023 at 11:17 AM Michael Jumper <mj...@apache.org> wrote:

> The issue you're encountering is due to the MariaDB driver dropping
> support for the "jdbc:mysql:" URI format unless additional parameters are
> included in the URI:
>
>
> https://mariadb.com/kb/en/about-mariadb-connector-j/#jdbcmysql-scheme-compatibility
>
> The above affects the MariaDB driver from 3.0 onward. The MySQL version of
> the driver should work as expected, as should older versions of the MariaDB
> driver.
>
> - Mike
>
>
> On Wed, Mar 8, 2023 at 8:29 AM Alessandro Sironi <a....@me.com.invalid>
> wrote:
>
>> Hi David,
>>
>> I have no experience with Ubuntu and maria db connector, but I run w/out
>> any issue Guacamole on Debian 11 with MariaDB using MySQL connector, you
>> could try to use it instead of MariaDB connector.
>>
>> Alessandro
>> Il 08/03/2023 17:12, David Ramirez ha scritto:
>>
>> Good morning/afternoon/night to you all!
>> I am writing this as I believe it is a very silly mistake but I am not
>> savvy enough on Guacamole+Tomcat to identify the issue.
>> I had a standalone Guacamole 1.4.0 Installation which is reachable
>> through a NGINX Reverse Proxy. The access to Guacamole was using local
>> authentication with the user-mapping.xml user definition file and it worked.
>>
>> I've followed all the steps on the documentation to upgrade and install
>> Guacamole Server on Ubuntu 20.04.
>> * I have made my guacamole Install by compiling it from source code on
>> 1.5.0. It compiles and installs ok.
>> * Guacamole installed as root <-- I know I have to correct this at some
>> point in the future.
>> * Same access through NGINX
>> * I am using init.d start scripts managing it as a legacy systemctl unit.
>> * Guacamole home is /etc/guacamole as default
>> * I decided to use mariadb instead of MySQL, so I installed it using the
>> tutorial from DigitalOcean at:
>> https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-20-04
>> * I have downloaded the JDBC extension package at:
>> https://apache.org/dyn/closer.lua/guacamole/1.5.0/binary/guacamole-auth-jdbc-1.5.0.tar.gz?action=download
>> * I have placed this extension at /etc/guacamole/extensions
>> * I created the database per the instructions on the manual.
>> * I downloaded the DB connector for MariaDB at:
>> https://mariadb.com/kb/en/about-mariadb-connector-j/
>> * I placed the connector at /etc/guacamole/lib
>> * Here is my guacamole.properties file contents:
>> guacd-hostname: localhost
>> guacd-port: 4822
>> # MariaDB/MySQL properties
>> mysql-hostname: localhost
>> mysql-database: guacamole_db
>> mysql-username: guacamole_user
>> mysql-password: somepassword
>> mysql-driver: mariadb
>> ** I added the driver definition to mariadb
>> * Restarted tomcat 9
>>
>> When I try to login to guacamole I see an error that the action could not
>> be completed and contact the administrator.
>> So, it is an error with the DB connector. When looking at:
>> /va/log/tomcat9/catalina.out here is the output:
>> [2023-03-08 16:03:47] [info] 16:03:47.527 [http-nio-8080-exec-10] WARN
>>  o.a.g.e.AuthenticationProviderFacade - The "mysql" authentication provider
>> has encountered an internal error which will halt the authentication
>> process. If this is unexpected or you are the developer of this
>> authentication provider, you may wish to enable debug-level logging. If
>> this is expected and you wish to ignore such failures in the future, please
>> set "skip-if-unavailable: mysql" within your guacamole.properties.
>> [2023-03-08 16:03:47] [info] 16:03:47.527 [http-nio-8080-exec-10] ERROR
>> o.a.g.rest.RESTExceptionMapper - Unexpected internal error:
>> [2023-03-08 16:03:47] [info] ### Error querying database.  Cause:
>> java.sql.SQLException: No suitable driver found for
>> jdbc:mysql://localhost:3306/guacamole_db
>> [2023-03-08 16:03:47] [info] ### The error may exist in
>> org/apache/guacamole/auth/jdbc/user/UserMapper.xml
>> [2023-03-08 16:03:47] [info] ### The error may involve
>> org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
>> [2023-03-08 16:03:47] [info] ### The error occurred while executing a
>> query
>> *[2023-03-08 16:03:47] [info] ### Cause: java.sql.SQLException: No
>> suitable driver found for jdbc:mysql://localhost:3306/guacamole_db*
>>
>> It is CLEAR as light that Tomcat9 is unable to read/reach the mariadb
>> connector. But for the love of me, I can't find why tomcat9 is unable to
>> read/reach the connector at /etc/guacamole/lib
>> /etc/guacamole is owned by root with group root with permissions
>> rwx,r-x,r-x which I believe is correct. Beyond that I do not know what may
>> be wrong.
>> I really believe this is a very simple mistake that I am overseeing.
>> Any help would be really appreciated!
>> Regards,
>> David.
>>
>>

Re: HELP NEEDED: Cannot use the mariadb/mysql JDBC connector to enable DB Authentication.

Posted by Michael Jumper <mj...@apache.org>.
The issue you're encountering is due to the MariaDB driver dropping support
for the "jdbc:mysql:" URI format unless additional parameters are included
in the URI:

https://mariadb.com/kb/en/about-mariadb-connector-j/#jdbcmysql-scheme-compatibility

The above affects the MariaDB driver from 3.0 onward. The MySQL version of
the driver should work as expected, as should older versions of the MariaDB
driver.

- Mike


On Wed, Mar 8, 2023 at 8:29 AM Alessandro Sironi <a....@me.com.invalid>
wrote:

> Hi David,
>
> I have no experience with Ubuntu and maria db connector, but I run w/out
> any issue Guacamole on Debian 11 with MariaDB using MySQL connector, you
> could try to use it instead of MariaDB connector.
>
> Alessandro
> Il 08/03/2023 17:12, David Ramirez ha scritto:
>
> Good morning/afternoon/night to you all!
> I am writing this as I believe it is a very silly mistake but I am not
> savvy enough on Guacamole+Tomcat to identify the issue.
> I had a standalone Guacamole 1.4.0 Installation which is reachable through
> a NGINX Reverse Proxy. The access to Guacamole was using local
> authentication with the user-mapping.xml user definition file and it worked.
>
> I've followed all the steps on the documentation to upgrade and install
> Guacamole Server on Ubuntu 20.04.
> * I have made my guacamole Install by compiling it from source code on
> 1.5.0. It compiles and installs ok.
> * Guacamole installed as root <-- I know I have to correct this at some
> point in the future.
> * Same access through NGINX
> * I am using init.d start scripts managing it as a legacy systemctl unit.
> * Guacamole home is /etc/guacamole as default
> * I decided to use mariadb instead of MySQL, so I installed it using the
> tutorial from DigitalOcean at:
> https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-20-04
> * I have downloaded the JDBC extension package at:
> https://apache.org/dyn/closer.lua/guacamole/1.5.0/binary/guacamole-auth-jdbc-1.5.0.tar.gz?action=download
> * I have placed this extension at /etc/guacamole/extensions
> * I created the database per the instructions on the manual.
> * I downloaded the DB connector for MariaDB at:
> https://mariadb.com/kb/en/about-mariadb-connector-j/
> * I placed the connector at /etc/guacamole/lib
> * Here is my guacamole.properties file contents:
> guacd-hostname: localhost
> guacd-port: 4822
> # MariaDB/MySQL properties
> mysql-hostname: localhost
> mysql-database: guacamole_db
> mysql-username: guacamole_user
> mysql-password: somepassword
> mysql-driver: mariadb
> ** I added the driver definition to mariadb
> * Restarted tomcat 9
>
> When I try to login to guacamole I see an error that the action could not
> be completed and contact the administrator.
> So, it is an error with the DB connector. When looking at:
> /va/log/tomcat9/catalina.out here is the output:
> [2023-03-08 16:03:47] [info] 16:03:47.527 [http-nio-8080-exec-10] WARN
>  o.a.g.e.AuthenticationProviderFacade - The "mysql" authentication provider
> has encountered an internal error which will halt the authentication
> process. If this is unexpected or you are the developer of this
> authentication provider, you may wish to enable debug-level logging. If
> this is expected and you wish to ignore such failures in the future, please
> set "skip-if-unavailable: mysql" within your guacamole.properties.
> [2023-03-08 16:03:47] [info] 16:03:47.527 [http-nio-8080-exec-10] ERROR
> o.a.g.rest.RESTExceptionMapper - Unexpected internal error:
> [2023-03-08 16:03:47] [info] ### Error querying database.  Cause:
> java.sql.SQLException: No suitable driver found for
> jdbc:mysql://localhost:3306/guacamole_db
> [2023-03-08 16:03:47] [info] ### The error may exist in
> org/apache/guacamole/auth/jdbc/user/UserMapper.xml
> [2023-03-08 16:03:47] [info] ### The error may involve
> org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
> [2023-03-08 16:03:47] [info] ### The error occurred while executing a query
> *[2023-03-08 16:03:47] [info] ### Cause: java.sql.SQLException: No
> suitable driver found for jdbc:mysql://localhost:3306/guacamole_db*
>
> It is CLEAR as light that Tomcat9 is unable to read/reach the mariadb
> connector. But for the love of me, I can't find why tomcat9 is unable to
> read/reach the connector at /etc/guacamole/lib
> /etc/guacamole is owned by root with group root with permissions
> rwx,r-x,r-x which I believe is correct. Beyond that I do not know what may
> be wrong.
> I really believe this is a very simple mistake that I am overseeing.
> Any help would be really appreciated!
> Regards,
> David.
>
>

Re: HELP NEEDED: Cannot use the mariadb/mysql JDBC connector to enable DB Authentication.

Posted by Alessandro Sironi <a....@me.com.INVALID>.
Hi David,

I have no experience with Ubuntu and maria db connector, but I run w/out 
any issue Guacamole on Debian 11 with MariaDB using MySQL connector, you 
could try to use it instead of MariaDB connector.

Alessandro

Il 08/03/2023 17:12, David Ramirez ha scritto:
> Good morning/afternoon/night to you all!
> I am writing this as I believe it is a very silly mistake but I am not 
> savvy enough on Guacamole+Tomcat to identify the issue.
> I had a standalone Guacamole 1.4.0 Installation which is reachable 
> through a NGINX Reverse Proxy. The access to Guacamole was using local 
> authentication with the user-mapping.xml user definition file and it 
> worked.
>
> I've followed all the steps on the documentation to upgrade and 
> install Guacamole Server on Ubuntu 20.04.
> * I have made my guacamole Install by compiling it from source code on 
> 1.5.0. It compiles and installs ok.
> * Guacamole installed as root <-- I know I have to correct this at 
> some point in the future.
> * Same access through NGINX
> * I am using init.d start scripts managing it as a legacy systemctl unit.
> * Guacamole home is /etc/guacamole as default
> * I decided to use mariadb instead of MySQL, so I installed it using 
> the tutorial from DigitalOcean at: 
> https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-20-04
> * I have downloaded the JDBC extension package at: 
> https://apache.org/dyn/closer.lua/guacamole/1.5.0/binary/guacamole-auth-jdbc-1.5.0.tar.gz?action=download
> * I have placed this extension at /etc/guacamole/extensions
> * I created the database per the instructions on the manual.
> * I downloaded the DB connector for MariaDB at: 
> https://mariadb.com/kb/en/about-mariadb-connector-j/
> * I placed the connector at /etc/guacamole/lib
> * Here is my guacamole.properties file contents:
> guacd-hostname: localhost
> guacd-port: 4822
> # MariaDB/MySQL properties
> mysql-hostname: localhost
> mysql-database: guacamole_db
> mysql-username: guacamole_user
> mysql-password: somepassword
> mysql-driver: mariadb
> ** I added the driver definition to mariadb
> * Restarted tomcat 9
>
> When I try to login to guacamole I see an error that the action could 
> not be completed and contact the administrator.
> So, it is an error with the DB connector. When looking at:
> /va/log/tomcat9/catalina.out here is the output:
> [2023-03-08 16:03:47] [info] 16:03:47.527 [http-nio-8080-exec-10] WARN 
>  o.a.g.e.AuthenticationProviderFacade - The "mysql" authentication 
> provider has encountered an internal error which will halt the 
> authentication process. If this is unexpected or you are the developer 
> of this authentication provider, you may wish to enable debug-level 
> logging. If this is expected and you wish to ignore such failures in 
> the future, please set "skip-if-unavailable: mysql" within your 
> guacamole.properties.
> [2023-03-08 16:03:47] [info] 16:03:47.527 [http-nio-8080-exec-10] 
> ERROR o.a.g.rest.RESTExceptionMapper - Unexpected internal error:
> [2023-03-08 16:03:47] [info] ### Error querying database. Cause: 
> java.sql.SQLException: No suitable driver found for 
> jdbc:mysql://localhost:3306/guacamole_db
> [2023-03-08 16:03:47] [info] ### The error may exist in 
> org/apache/guacamole/auth/jdbc/user/UserMapper.xml
> [2023-03-08 16:03:47] [info] ### The error may involve 
> org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
> [2023-03-08 16:03:47] [info] ### The error occurred while executing a 
> query
> *[2023-03-08 16:03:47] [info] ### Cause: java.sql.SQLException: No 
> suitable driver found for jdbc:mysql://localhost:3306/guacamole_db*
>
> It is CLEAR as light that Tomcat9 is unable to read/reach the mariadb 
> connector. But for the love of me, I can't find why tomcat9 is unable 
> to read/reach the connector at /etc/guacamole/lib
> /etc/guacamole is owned by root with group root with permissions 
> rwx,r-x,r-x which I believe is correct. Beyond that I do not know what 
> may be wrong.
> I really believe this is a very simple mistake that I am overseeing.
> Any help would be really appreciated!
> Regards,
> David.
>