rundeck / rundeck

Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts

Home Page:http://rundeck.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running Rundeck with a DigitalOcean managed MySQL database fails due to sql_require_primary_key enabled by default

alexminza opened this issue · comments

CREATE TABLE rundeck.DATABASECHANGELOG fails due to sql_require_primary_key enabled by default:

liquibase.exception.DatabaseException: (conn=2466) Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. [Failed SQL: (3750) CREATE TABLE rundeck.DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35) NULL, `DESCRIPTION` VARCHAR(255) NULL, COMMENTS VARCHAR(255) NULL, TAG VARCHAR(255) NULL, LIQUIBASE VARCHAR(20) NULL, CONTEXTS VARCHAR(255) NULL, LABELS VARCHAR(255) NULL, DEPLOYMENT_ID VARCHAR(10) NULL)]

My Rundeck detail

  • Rundeck version: SNAPSHOT
  • Install type: docker
  • OS Name/version: ubuntu 22.04
  • DB Type/version: MySQL 8 DigitalOcean Managed Database

To Reproduce
Error is reproduced during initial startup after a new Rundeck instance/container is started configured with a DigitalOcean MySQL Managed Database.

RUNDECK_DATABASE_DRIVER=org.mariadb.jdbc.Driver
RUNDECK_DATABASE_DIALECT=org.hibernate.dialect.MySQLDialect
RUNDECK_DATABASE_URL=jdbc:mysql://##REDACTED##.c.db.ondigitalocean.com:25060/rundeck?ssl-mode=REQUIRED&allowPublicKeyRetrieval=true&autoReconnect=true

Expected behavior
Rundeck database tables schema should be defined with primary keys to follow best practices and avoid such issues.

Screenshots
Screenshot 2024-04-13 at 17 24 54

Additional context
DigitalOcean enables sql_require_primary_key by default for their managed databases to ensure proper replication and avoid unexpected issues.

In certain cases, you may also want to adjust the sql_require_primary_key, which determines whether primary keys are a requirement. When set to True (default), primary keys are required. When set to False, primary keys are optional. However, we do not currently support adjusting this mode in the control panel. Instead, you can set this mode by making a configuration request via our API.

For clusters with more than one node, we strongly recommend keeping sql_require_primary_key as True. Setting it to False may severely impact replication and cause issues.