You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2017-11-28 17:21:43

ialex
Guest
Registered: 2017-11-28
Posts: 2

Error Update 9.1.6 to 9.2.1

Hello,
Trying to update GLPI and get this error:

9.2 migrate notifications templates - Error during the database query: 
INSERT INTO `glpi_notifications_notificationtemplates` (`notifications_id`, `mode`, `notificationtemplates_id`) 
SELECT `id`, `mode`, `notificationtemplates_id` FROM `glpi_notifications` - 
Error  - Duplicate entry '1-mail-6' for key 'unicity'

did you get this problem and how to resolve?
Thanx

Offline

#2 2017-11-29 10:58:02

ialex
Guest
Registered: 2017-11-28
Posts: 2

Re: Error Update 9.1.6 to 9.2.1

I think this code  write from https://github.com/glpi-project/glpi/bl … _91_92.php

 
   if ($DB->fieldExists("glpi_notifications", "mode", false)) {
      $query = "REPLACE INTO `glpi_notifications_notificationtemplates`
                       (`notifications_id`, `mode`, `notificationtemplates_id`)
                       SELECT `id`, `mode`, `notificationtemplates_id`
                       FROM `glpi_notifications`";
      $DB->queryOrDie($query, "9.2 migrate notifications templates");
      //migrate any existing mode before removing the field
      $migration->dropField('glpi_notifications', 'mode');
      $migration->dropField('glpi_notifications', 'notificationtemplates_id');
      $migration->migrationOneTable("glpi_notifications");
   }

But the code on release link from main page has this command '$query = "INSERT INTO ...'

After a manual fix I got the following error

9.2 multiple alter in glpi_slas - Error during the database query: 
ALTER TABLE `glpi_slas` ADD INDEX `slms_id` (`slms_id`) 
- Error - Key column 'slms_id' doesn't exist in table

Last edited by ialex (2017-11-29 10:58:52)

Offline

#3 2017-12-05 18:40:39

kornelson
Guest
Registered: 2017-12-05
Posts: 2

Re: Error Update 9.1.6 to 9.2.1

I Have the same error, and i can't find the way that fix this? Please may be if anybody can help with those errors. thanks.

Offline

#4 2017-12-05 18:41:32

kornelson
Guest
Registered: 2017-12-05
Posts: 2

Re: Error Update 9.1.6 to 9.2.1

I found this answer in order to solve the problem, but doesn't work for me.

https://github.com/glpi-project/glpi/issues/3172

Offline

#5 2018-04-27 18:58:27

ennder
Guest
Registered: 2018-04-27
Posts: 2

Re: Error Update 9.1.6 to 9.2.1

The duplicate records can be found with this SQL script :

SELECT
  nt1.id id1, nt2.id id2, nt1.notifications_id nid1, nt2.notifications_id nid2,
  nt1.notificationtemplates_id ntid1, nt2.notificationtemplates_id ntid2
FROM
  glpi_notifications_notificationtemplates nt1
  LEFT OUTER JOIN glpi_notifications_notificationtemplates nt2 ON
    nt2.notifications_id=nt1.notifications_id AND
    nt2.notificationtemplates_id=nt1.notificationtemplates_id AND
    nt2.mode='mailing' AND
    nt1.mode='mail'
WHERE
  nt2.id IS NOT NULL
ORDER BY
  nt1.notifications_id, nt1.notificationtemplates_id;

Offline

Board footer

Powered by FluxBB