Ad Widget

Collapse

DB migration error during update to 7.0 (Duplicate column name 'name_upper')

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Janus006
    Junior Member
    • Dec 2019
    • 11

    #1

    DB migration error during update to 7.0 (Duplicate column name 'name_upper')

    Hi,
    Migration from a zabbix 6.0.21 to 7.0. I followed the "procedure" on the documentation for ubuntu (ubuntu 22.04.4). But it seemd to have issue with the DB upgrade.
    I changed the setting "SET GLOBAL log_bin_trust_function_creators = 1;" fut the upgrade fail.
    From the log, the migration error is:

    7980:20240627:131644.023 completed 27% of database upgrade
    7980:20240627:131644.121 [Z3005] query failed: [1060] Duplicate column name 'name_upper' [alter table `hosts` add `name_upper` varchar(128) default '' not null]
    7980:20240627:131644.121 database upgrade failed on patch 06030064, exiting in 10 seconds
    7980:20240627:131654.121 Zabbix Server stopped. Zabbix 7.0.0 (revision 49955f1fb5c).

    And for sure, from the webinterface, I have the following error:
    • The Zabbix database version does not match current requirements. Your database version: 6030063. Required version: 7000000. Please contact your system administrator.
    I tried to remove the column 'name_upper' in table items and hosts, with the same result.

    Furtinately, the server is a VM and I have s snapshot, able to revert, but I do not seemd to complete the migration.

    Any idea ?

    Many thanks
  • mathisreel66
    Junior Member
    • Jun 2024
    • 19

    #2
    I am having the same error. attempting to upgrade 6.2 to 7.0 using docker containers.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3

      That patch verifies, if a trigger exists and if not, tries to create a field... Maybe you miss that trigger, eventho you have the field... Something failed during some previous upgrades? I think mysql has "show triggers" statement...

      https://git.zabbix.com/projects/ZBX/...elease%2F7.0#5 60
      Code:
      static int    DBpatch_6030064(void)
      {
          const zbx_db_field_t    field = {"name_upper", "", NULL, NULL, 128, ZBX_TYPE_CHAR, ZBX_NOTNULL, 0};
      
          if (SUCCEED == zbx_db_trigger_exists("hosts", "hosts_name_upper_update"))
          {
              zabbix_log(LOG_LEVEL_WARNING, "hosts_name_upper_update trigger for table \"hosts\" already exists,"
                      " skipping patch of adding \"name_upper\" column to \"hosts\" table");
              return SUCCEED;
          }
      
          return DBadd_field("hosts", &field);
      }
      This shoudl create that trigger...
      create trigger hosts_name_upper_update
      before update on hosts for each row
      begin
      if new.name<>old.name
      then
      set new.name_upper=upper(new.name);
      end if;
      end;


      Comment

      • Janus006
        Junior Member
        • Dec 2019
        • 11

        #4
        Nothing failed during previous updates. It's a freshly installed 6.0 and the minor updates have been installed over time.
        Veyr disapointed

        Comment

        Working...