jjethwa / rundeck

GNU General Public License v3.0
123 stars 136 forks source link

External Postgres DB #192

Closed three-old-coders closed 3 years ago

three-old-coders commented 3 years ago

Hi, I try to use the Image 3.3.10 with an external Postgres DB, but the container does not start. In /var/log/rundeck/rundeck.logs I see

Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100) ~[hibernate-core-5.4.18.Final.jar!/:5.4.18.Final] at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54) ~[hibernate-core-5.4.18.Final.jar!/:5.4.18.Final]

How can I set the hibernate dialect?

docker-compose.txt

Thanks in advance

Jens

jjethwa commented 3 years ago

Hi @three-old-coders

I think there might be some previous log entries that might help? Maybe in the service.log or container log? Is the database being set up during the container start?

three-old-coders commented 3 years ago

I noticed, when using an external database the property names are different (starting with DATABASE_), so I corrected this.

Next I got the error: "sed: -e expression #1, char 68: unterminated `s' command" This was caused by an " char used as arg for GUI_BRAND_HTML and is fixed.

Now database initialization fails with ERROR: database "postgres" already exists. Yes, the database exists, but schema and tables are not present. The property SKIP_DATABASE_SETUP is set to false, because I need all schema updates, but no database creation.

Providing a schema in the URL fails, too, therefore my URL is: RUNDECK_DATABASE_URL=jdbc:postgresql://host:5432/postgres instead of RUNDECK_DATABASE_URL=jdbc:postgresql://host:5432/postgres?currentSchema=my_schema

Is there any chance to provide a different schema and let rundeck recreate all missing tables on 1st start?

Thanks for the quick reply and help

jjethwa commented 3 years ago

Hi @three-old-coders

The schema should be created by rundeck when it starts up if it does not already exist, it just needs the database to be available. Do you mind setting SKIP_DATABASE_SETUP to true and starting it again? Let's see what shows up in the logs.

three-old-coders commented 3 years ago

Hi, I created a new "database" to start over. With SKIP_DATABASE_SETUP = false, all rundeck tables got created in "database/schema/public". So I ignore the schema issue for now. docker log shows a restart of the container:

rundeck | 2021-04-06 09:42:40,707 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. rundeck | 2021-04-06 09:42:40,707 WARN For [program:rundeck], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored rundeck | 2021-04-06 09:42:40,707 INFO Included extra file "/etc/supervisor/conf.d/rundeck.conf" during parsing rundeck | 2021-04-06 09:42:40,717 INFO RPC interface 'supervisor' initialized rundeck | 2021-04-06 09:42:40,717 CRIT Server 'unix_http_server' running without any HTTP authentication checking rundeck | 2021-04-06 09:42:40,717 INFO supervisord started with pid 145 rundeck | 2021-04-06 09:42:41,721 INFO spawned: 'fatalservice' with pid 148 rundeck | 2021-04-06 09:42:41,723 INFO spawned: 'rundeck' with pid 149 rundeck | READY rundeck | 06.04.2021 09:42:41.737 - Starting rundeckd2021-04-06 09:42:42,745 INFO success: fatalservice entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) rundeck | 2021-04-06 09:42:42,810 INFO success: rundeck entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) rundeck | bash: line 1: 159 Killed java -Drundeck.jaaslogin=true -Djava.security.auth.login.config=/etc/rundeck/jaas-loginmodule.conf -Dloginmodule.name=RDpropertyfilelogin -Drdeck.config=/etc/rundeck -Drundeck.server.configDir=/etc/rundeck -Dserver.datastore.path=/var/lib/rundeck/data/rundeck -Drundeck.server.serverDir=/var/lib/rundeck -Drdeck.projects=/var/lib/rundeck/projects -Dlog4j.configurationFile=/etc/rundeck/log4j2.properties -Dlogging.config=file:/etc/rundeck/log4j2.properties -Drdeck.runlogs=/var/lib/rundeck/logs -Drundeck.server.logDir=/var/lib/rundeck/logs -Drundeck.config.location=/etc/rundeck/rundeck-config.properties -Djava.io.tmpdir=/tmp/rundeck -Drundeck.server.workDir=/tmp/rundeck -Dserver.http.port=4440 -Drdeck.base=/var/lib/rundeck -Xmx1024m -Xss4m -Xms256m -XX:MaxMetaspaceSize=256m -server -Dfile.encoding=UTF-8 -Dserver.web.context=/rundeck -jar /var/lib/rundeck/bootstrap/rundeck-3.3.10-20210301.war --skipinstall &>> /var/log/rundeck/service.log rundeck | 2021-04-06 09:44:35,699 INFO exited: rundeck (exit status 0; expected) rundeck | 2021-04-06 09:44:36,701 INFO spawned: 'rundeck' with pid 265 rundeck | 06.04.2021 09:44:36.725 - Starting rundeckd2021-04-06 09:44:37,728 INFO success: rundeck entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) rundeck | bash: line 1: 275 Killed java -Drundeck.jaaslogin=true -Djava.security.auth.login.config=/etc/rundeck/jaas-loginmodule.conf -Dloginmodule.name=RDpropertyfilelogin -Drdeck.config=/etc/rundeck -Drundeck.server.configDir=/etc/rundeck -Dserver.datastore.path=/var/lib/rundeck/data/rundeck -Drundeck.server.serverDir=/var/lib/rundeck -Drdeck.projects=/var/lib/rundeck/projects -Dlog4j.configurationFile=/etc/rundeck/log4j2.properties -Dlogging.config=file:/etc/rundeck/log4j2.properties -Drdeck.runlogs=/var/lib/rundeck/logs -Drundeck.server.logDir=/var/lib/rundeck/logs -Drundeck.config.location=/etc/rundeck/rundeck-config.properties -Djava.io.tmpdir=/tmp/rundeck -Drundeck.server.workDir=/tmp/rundeck -Dserver.http.port=4440 -Drdeck.base=/var/lib/rundeck -Xmx1024m -Xss4m -Xms256m -XX:MaxMetaspaceSize=256m -server -Dfile.encoding=UTF-8 -Dserver.web.context=/rundeck -jar /var/lib/rundeck/bootstrap/rundeck-3.3.10-20210301.war --skipinstall &>> /var/log/rundeck/service.log rundeck | 2021-04-06 09:46:18,041 INFO exited: rundeck (exit status 0; expected)

The rundeck.log is not really helpful:

root@7d8f1233a0ad:/# cat /var/log/rundeck/rundeck.log [2021-04-06T09:43:41,956] WARN spi.SqlExceptionHelper [main] - SQL Warning Code: 0, SQLState: 00000 [2021-04-06T09:43:41,958] WARN spi.SqlExceptionHelper [main] - constraint "uk_pl6hleyex3ofoaklduhbyretw" of relation "auth_token" does not exist, skipping [2021-04-06T09:43:42,016] WARN spi.SqlExceptionHelper [main] - SQL Warning Code: 0, SQLState: 00000 [2021-04-06T09:43:42,016] WARN spi.SqlExceptionHelper [main] - constraint "uk_trqsa9so0qcv6okcd6fan88yf" of relation "log_file_storage_request" does not exist, skipping [2021-04-06T09:43:42,029] WARN spi.SqlExceptionHelper [main] - SQL Warning Code: 0, SQLState: 00000 [2021-04-06T09:43:42,030] WARN spi.SqlExceptionHelper [main] - constraint "uk_3k75vvu7mevyvvb5may5lj8k7" of relation "project" does not exist, skipping [2021-04-06T09:43:42,042] WARN spi.SqlExceptionHelper [main] - SQL Warning Code: 0, SQLState: 00000 [2021-04-06T09:43:42,042] WARN spi.SqlExceptionHelper [main] - constraint "uk_9dh5owjlbb2x223gopaq6t0jm" of relation "report_filter" does not exist, skipping [2021-04-06T09:43:42,054] WARN spi.SqlExceptionHelper [main] - SQL Warning Code: 0, SQLState: 00000 [2021-04-06T09:43:42,054] WARN spi.SqlExceptionHelper [main] - constraint "uk_4t4ehlssm8lvaxieybr42ow5x" of relation "scheduled_execution" does not exist, skipping [2021-04-06T09:43:42,066] WARN spi.SqlExceptionHelper [main] - SQL Warning Code: 0, SQLState: 00000 [2021-04-06T09:43:42,066] WARN spi.SqlExceptionHelper [main] - constraint "uk_ow5u86267bvtsol1k9xsox40i" of relation "storage" does not exist, skipping [2021-04-06T09:43:45,373] WARN beans.GenericTypeAwarePropertyDescriptor [main] - Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)] [2021-04-06T09:45:43,626] WARN beans.GenericTypeAwarePropertyDescriptor [main] - Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)] [2021-04-06T09:47:34,316] WARN beans.GenericTypeAwarePropertyDescriptor [main] - Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)] [2021-04-06T09:49:29,972] WARN beans.GenericTypeAwarePropertyDescriptor [main] - Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)] [2021-04-06T09:51:10,374] WARN beans.GenericTypeAwarePropertyDescriptor [main] - Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)] root@7d8f1233a0a

The service log shows no additional information. I guesss I just messed up the docker-compose.yml, but without any hints from the logs it's hard to track down...

jjethwa commented 3 years ago

We're a bit closer, but I don't know why the container log is showing that the rundeck process is getting killed. Your compose file looks good, but I might be missing something as I'm not an expert with compose. Do you mind sharing the latest version of your compose file again?

three-old-coders commented 3 years ago

Sorry for the late reply. I moved to the "original" rundeck docker image and got it working. I will come back to this issue as soon I have some spare time. Thanks for your fast response and help. Maybe we close the issue for now?

jjethwa commented 3 years ago

Sure! Thanks for the update 👍