Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexminza opened this issue Apr 13, 2024 · 0 comments

Comments

@alexminza
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant