MysticRyuujin / guac-install

Script for installing Guacamole on Ubuntu
988 stars 272 forks source link

Fails to be installed on Ubuntu 18 #130

Closed marcvidalim closed 2 years ago

marcvidalim commented 4 years ago

Hi there!

Trying to access http://localhost:8080/guacamole doesn't show up the login screen, it shows a generic error message.

I've noticed on the browser inspector an error 500 related to tokens and then I looked through tomcat and the following was found:

tomcat9[27958]: ### The error occurred while executing a query tomcat9[27958]: ### Cause: java.sql.SQLException: The server time zone value 'CEST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support. tomcat9[27958]: 20:54:21.382 [http-nio-8080-exec-9] 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. tomcat9[27958]: 20:54:21.383 [http-nio-8080-exec-9] ERROR o.a.g.rest.RESTExceptionMapper - Unexpected internal error: tomcat9[27958]: ### Error querying database. Cause: java.sql.SQLException: The server time zone value 'CEST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support. tomcat9[27958]: ### The error may exist in org/apache/guacamole/auth/jdbc/user/UserMapper.xml tomcat9[27958]: ### The error may involve org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne tomcat9[27958]: ### The error occurred while executing a query tomcat9[27958]: ### Cause: java.sql.SQLException: The server time zone value 'CEST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.

Then I realized the install script failed to add the timezone to the MySQL config:

Restarting MySQL service & enable at boot... OK Synchronizing state of mysql.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable mysql

Setting timezone as Europe/Berlin File contains parsing errors: <???>

I've fixed it as follows:

mysql> SELECT @@global.time_zone; +--------------------+ | @@global.time_zone | +--------------------+ | SYSTEM | +--------------------+ 1 row in set (0.00 sec)

mysql> SET GLOBAL time_zone = 'Europe/Berlin'; Query OK, 0 rows affected (0.01 sec)

mysql> SELECT @@global.time_zone; +--------------------+ | @@global.time_zone | +--------------------+ | Europe/Berlin | +--------------------+ 1 row in set (0.00 sec)

I hope this might help someone facing the same issue and to improve the script, which is really great! (:

Thanks a lot!

errorTokensGuacamole

atahrijouti commented 4 years ago

seeing the same thing, were you able to figure it out?

marcvidalim commented 4 years ago

Yes, as I've stated in my initial message, it's required to configure the time_zone in MySQL server

djvinniev77 commented 4 years ago

for the lazy (like me) I just added the extra lines in /etc/mysql/my.cnf

[mysqld] default-time-zone='-7:00'

change the number value to correspond to your time zone. yes it breaks (time wise) when DST changes but it at least got everything going for me.

https://github.com/jruby/activerecord-jdbc-adapter/issues/897 notes some items here too.

walterzilla commented 4 years ago

FYI first solution didn't work for me (i.e. Guacamole running on Debian 10.4 with MariaDB 10.3.22) so after system timezones import I added default_time_zone = Continent/City line in usual /etc/mysql/my.cnf file.