Skip to content

Migration Version20250309122806 causes syntax errors on initial install #3184

@reynolb5

Description

@reynolb5

Description of the problem

When installing DOMJudge 9.0.0 on a fresh MySQL database, this migration: https://github.com/DOMjudge/domjudge/blob/9.0/webapp/migrations/Version20250309122806.php causes the following error:

[error] Migration DoctrineMigrations\Version20250309122806 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'sort_key_public' used in key specification without a key length"

Line 23 of the file linked above creates the sort_key_public and sort_key_restricted columns in the rankcache table as TEXT columns; however, as noted here MySQL doesn't permit TEXT columns to be indexed. Subsequent attempts to start the domserver then fail on line 23, as the columns already exist.

Your environment

  • DOMjudge version 9.0.0
  • Docker image based on Debian Bookworm-slim
  • Deployed in Amazon Elastic Container Service
  • Database is an AWS Aurora MySQL 8.0.mysql_aurora.3.08.2

Steps to reproduce

  1. With a setup similar to the above (I think the key point is likely just an empty MySQL database), start DOMJudge

Expected behaviour

System successfully sets up its database and starts

Actual behaviour

Task is unable to start cleanly, and repeatedly tries to restart, failing on subsequent attempts due to the columns already existing

Any other information that you want to share?

Relevant sections of logs can be provided as needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions