Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Kea Kea
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 502
    • Issues 502
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 52
    • Merge requests 52
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source Projects
  • KeaKea
  • Issues
  • #2126
Closed
Open
Created Oct 07, 2021 by Andrei Pavel@andrei🐧Maintainer

foreign key constraint fail when upgrading mysql schema from 1.9.11 to 2.0.0

For clarity, this happens when upgrading from schema version 11 to schema version 12.

This happens when the dhcp4_options table has entries with non-NULL values in the dhcp_client_class, but the dhcp4_client_class table has no entry with such a value in the name column.

Is reaching such a state possible only with CB commands?

The error message is:

Processing /opt/kea/share/kea/scripts/mysql/upgrade_011_to_012.sh file...
ERROR 1452 (23000) at line 16: Cannot add or update a child row: a foreign key constraint fails (`keatest`.`#sql-alter-1-2`, CONSTRAINT `fk_dhcp4_options_client_class` FOREIGN KEY (`dhcp_client_class`) REFERENCES `dhcp4_client_class` (`name`) ON DELETE CASCADE ON UPDATE )

Is turning the update statements from the upgrade script into the following a solution?

UPDATE dhcp4_options SET dhcp_client_class = NULL;
UPDATE dhcp6_options SET dhcp_client_class = NULL;

Reproduction steps: https://support.isc.org/Ticket/Display.html?id=19464#txn-720297

Edited Oct 13, 2021 by Andrei Pavel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking