ERROR IN MIGRATION FROM H2 TO MYSQL

98 views
Skip to first unread message

Rafael Kochon

unread,
Apr 18, 2024, 8:57:52 AM4/18/24
to rundeck-discuss
hey, I did a new installation and I need to change the database from h2 to mysql,
 I followed the manual, but something is missing to complete. 
1. Ubuntu 22 OS 
2. mysql 8.0 installation works and rundekc user logs in ok 
3. I made the modification to rundeck-config.properties When restarting the rundeck it does not go up, follow the .log msg

 Can anyone help me with this database transition 

please.
 ty


rundeck-config.properties
------------- ------------- 
#loglevel.default is the default log level for jobs: ERROR,WARN,INFO,VERBOSE,DEBUG
loglevel.default=INFO
rdeck.base=/var/lib/rundeck

#rss.enabled if set to true enables RSS feeds that are public (non-authenticated)
rss.enabled=false
# change hostname here
grails.serverURL=http://10.10.10.10:4440
dataSource.dbCreate = none
dataSource.url = jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;DB_CLOSE_ON_EXIT=FALSE;NON_KEYWORDS=MONTH,HOUR,MINUTE,YEAR,SECONDS
grails.plugin.databasemigration.updateOnStart=true

dataSource.driverClassName = org.mariadb.jdbc.Driver
dataSource.url = jdbc:mysql://localhost/rundeck?autoReconnect=true&useSSL=false
dataSource.useirname = rundeckuser
dataSource.password = *********
------------- ------------- ------------- ------------- ------------- ------------- ------------- ------------- ------------- ------------- ---

LOG
---------------------------------------------
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) ~[jetty-server-9.4.53.v20231009.jar!/:9.4.53.v20231009]
        at org.eclipse.jetty.server.Server.doStart(Server.java:387) ~[jetty-server-9.4.53.v20231009.jar!/:9.4.53.v20231009]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.53.v20231009.jar!/:9.4.53.v20231009]
        at org.springframework.boot.web.embedded.jetty.JettyWebServer.initialize(JettyWebServer.java:123) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.web.embedded.jetty.JettyWebServer.<init>(JettyWebServer.java:90) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getJettyWebServer(JettyServletWebServerFactory.java:447) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getWebServer(JettyServletWebServerFactory.java:181) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:184) ~[spring-boot-2.7.12.jar!/:2.7.12]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.7.12.jar!/:2.7.12]
        ... 33 more

rac...@rundeck.com

unread,
Apr 18, 2024, 9:26:25 AM4/18/24
to rundeck-discuss

Hi,

Just found a typo in your config (useirname != username), change this line:

dataSource.useirname = rundeckuser

by the following one:

dataSource.username = rundeckuser

Also, based on this, change this connection string:

dataSource.url = jdbc:mysql://localhost/rundeck?autoReconnect=true&useSSL=false

by the following one:

dataSource.url=jdbc:mariadb://localhost/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true

Hope it helps!

Rafael Kochon

unread,
Apr 18, 2024, 9:54:50 AM4/18/24
to rundeck-discuss
hi,  
THANKS for the response.
I adjusted it according to your instructions.
I restarted the rundeck, but it still has an error, there are many error lines in the log, there is no way to compare it with the previous error, but I believe we have already made progress in correcting it.

* question:
This SQL base is empty, it doesn't need a structure inside? When changing the connection from h2 to mysql, will rundeck automatically create the structure within the database?

-----------------------------------------------------------------------

# change hostname here
grails.serverURL=http://10.10.10.10:4440
dataSource.dbCreate = none
dataSource.url = jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;DB_CLOSE_ON_EXIT=FALSE;NON_KEYWORDS=MONTH,HOUR,MINUTE,YEAR,SECONDS
grails.plugin.databasemigration.updateOnStart=true

dataSource.driverClassName = org.mariadb.jdbc.Driver
dataSource.url = jdbc:mariadb://localhost/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
dataSource.username = rundeckuser
dataSource.password = *********

rac...@rundeck.com

unread,
Apr 18, 2024, 10:14:06 AM4/18/24
to rundeck-discuss
Regarding this:

This SQL base is empty, it doesn't need a structure inside? When changing the connection from h2 to mysql, will rundeck automatically create the structure within the database?

You don't need to create a structure, Rundeck must build it on the empty database in the first run. Make sure to use an empty database.

Which error are you seeing?

Regards.

Rafael Kochon

unread,
Apr 18, 2024, 10:28:56 AM4/18/24
to rundeck-discuss
rundeck does not UP, after modification, in rundeck-config.properties for mysql connection.

If  change to h2 connection, the system stays UP normally

Rafael Kochon

unread,
Apr 18, 2024, 9:10:11 PM4/18/24
to rundeck-discuss
hi
Is there any alternative to adjust this, give up mysql and use h2? rundeck?
ty

Rafael Kochon

unread,
Apr 19, 2024, 10:41:24 PM4/19/24
to rundeck-discuss
ola, boa noite 

ainda na luta com o rundeck com mysql

olhando 9999 linhas encontrei esse erro:

 tail -f /var/log/rundeck/service.log | grep HHH000339
[2024-04-19T23:38:47,515] WARN  internal.JdbcEnvironmentInitiator - HHH000339: Could not obtain connection metadata: java.sql.SQLInvalidAuthorizationSpecException: Could not connect to address=(host=localhost)(port=3306)(type=master) : (conn=9) Access denied for user 'rundeckuser'@'localhost' (using password: YES)
[2024-04-19T23:38:49,143] WARN  internal.JdbcEnvironmentInitiator - HHH000339: Could not obtain connection metadata: java.sql.SQLInvalidAuthorizationSpecException: Could not connect to address=(host=localhost)(port=3306)(type=master) : (conn=10) Access denied for user 'rundeckuser'@'localhost' (using password: YES)


obs, consigo acessar o mysql pelo terminal localhost e por outro pc da rede pelo dbeaver.

grato

Rafael Kochon

unread,
Apr 20, 2024, 8:26:07 AM4/20/24
to rundeck-discuss

I managed to find a solution in this group. Rundeck worked perfectly with mysql THANK
https://groups.google.com/g/rundeck-discuss/c/aqB1WADmH0I
Reply all
Reply to author
Forward
0 new messages