2

I've followed the instructions here, and have guacd, guacamole, and mysql running in separate containers, linked together. I'm pretty confident I have the configurations correct, and as a test I started a plain ubuntu container, installed mysql-client, and connected to the mysql container:

PS > docker exec -it ubuntu bash
root@f31a3436f297:/# mysql -h test-mysql -u guacamole_user -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 22
Server version: 8.0.32 MySQL Community Server - GPL

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use guacamole_db;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------------------------+
| Tables_in_guacamole_db                |
+---------------------------------------+
| guacamole_connection                  |
| guacamole_connection_attribute        |
| guacamole_connection_group            |
| guacamole_connection_group_attribute  |
| guacamole_connection_group_permission |
| guacamole_connection_history          |
| guacamole_connection_parameter        |
| guacamole_connection_permission       |
| guacamole_entity                      |
| guacamole_sharing_profile             |
| guacamole_sharing_profile_attribute   |
| guacamole_sharing_profile_parameter   |
| guacamole_sharing_profile_permission  |
| guacamole_system_permission           |
| guacamole_user                        |
| guacamole_user_attribute              |
| guacamole_user_group                  |
| guacamole_user_group_attribute        |
| guacamole_user_group_member           |
| guacamole_user_group_permission       |
| guacamole_user_history                |
| guacamole_user_password_history       |
| guacamole_user_permission             |
+---------------------------------------+
23 rows in set (0.00 sec)

mysql>

However, visiting localhost:8080/guacamole results in this:

guacamole error 1

In the guacamole container logs, I see this:

2023-03-16 16:42:29 16:42:29.866 [http-nio-8080-exec-6] 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-16 16:42:29 16:42:29.869 [http-nio-8080-exec-6] ERROR o.a.g.rest.RESTExceptionMapper - Unexpected internal error: 
2023-03-16 16:42:29 ### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
2023-03-16 16:42:29 
2023-03-16 16:42:29 The last packet successfully received from the server was 63 milliseconds ago.  The last packet sent successfully to the server was 62 milliseconds ago.
2023-03-16 16:42:29 ### The error may exist in org/apache/guacamole/auth/jdbc/user/UserMapper.xml
2023-03-16 16:42:29 ### The error may involve org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
2023-03-16 16:42:29 ### The error occurred while executing a query
2023-03-16 16:42:29 ### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
2023-03-16 16:42:29 
2023-03-16 16:42:29 The last packet successfully received from the server was 63 milliseconds ago.  The last packet sent successfully to the server was 62 milliseconds ago.

From some quick googling, it seems like Communications link failure may be a vague approximation of the error, but I'm stuck where to look next. The mysql container shows nothing in the logs at the time of the guacamole error.

Things I've tried, with no success:

  • running mysql:5.7
  • specifying WITH mysql_native_password for the guacamole user
dsl101
  • 1,715
  • 16
  • 36

2 Answers2

3

Had the same problem, solved that by adding

      - MYSQL_DRIVER=mysql
      - MYSQL_SSL_MODE=disabled

to the environment of the guacamole container in the docker-compose.yml.

Hope this helps.

harenber
  • 46
  • 1
  • Thank you! In fact, I found only the `MYSQL_SSL_MODE=disabled` was necessary in my case, but that solved it. Really wish there was some reference to this on the Guacamole documentation—if there is, I certainly didn't see it on the Docker pages... – dsl101 Mar 17 '23 at 17:31
  • After setting these two environment variables now I am having following. `Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Public Key Retrieval is not allowed` – Jaffar Ramay Apr 08 '23 at 07:24
  • @JaffarRamay this is a different problem which should be solvable with these MySQL commands: `ALTER USER 'guacamole_user'@'%' IDENTIFIED WITH mysql_native_password BY 'geheim'; FLUSH PRIVILEGES;`. Change "geheim" to your desired password. – harenber Apr 10 '23 at 21:47
0

i have the same problem,here is my solution may help someone. i remove --link from docker,and set up -e GUACD_HOSTNAME=172.17.0.2 -e MYSQL_HOSTNAME=172.17.0.3 but i dont know why

Tong
  • 1
  • 2
  • That looks like the solution if you explicitly expose the ports on the mysql container (e.g. with `-p 3306:3306`. Using `--link` doesn't need the ports exposed though. – dsl101 Mar 22 '23 at 09:54