MySQL - Duplicate entry

Moderator: crythias

Post Reply
sommerzeit
OTRS newbie
Posts: 11
Joined: 15 Dec 2017, 17:12
OTRS Version?: 6.0.2
Real Name: Florian Sommer

MySQL - Duplicate entry

Post by sommerzeit » 05 Jan 2018, 11:58

Hello community.

I am using OTRS Version: 6.0.2
I am using OS: Debian 9.3 (without GUI)
I am using Database: MySQL 15.1, Distrib 10.1.26-MariaDB

I have this problem:
I'm getting these messages in the system protocol:
OTRS-CGI-10 Duplicate entry '24-Seen-2' for key 'ticket_flag_per_user', SQL: '

I looked at the syslog and there are two entries for this:

Code: Select all

Jan  5 10:20:41 XXX-otrs OTRS-CGI-10[723]: [Error][Kernel::System::Ticket::TicketFlagSet][Line:6597]: Duplicate entry '24-Seen-2' for key 'ticket_flag_per_user', SQL: '#012            INSERT INTO ticket_flag#012            (ticket_id, ticket_key, ticket_value, create_time, create_by)#012            VALUES (?, ?, ?, '2018-01-05 09:20:40', ?)'
Jan  5 10:20:41 XXX-otrs OTRS-CGI-10[751]: [Error][Kernel::System::Ticket::TicketFlagSet][Line:6597]: Duplicate entry '24-Seen-2' for key 'ticket_flag_per_user', SQL: '#012            INSERT INTO ticket_flag#012            (ticket_id, ticket_key, ticket_value, create_time, create_by)#012            VALUES (?, ?, ?, '2018-01-05 09:20:40', ?)'
Im also getting deadlock

Code: Select all

Jan  5 11:26:34 XXX-otrs OTRS-CGI-10[751]: [Error][Kernel::System::AuthSession::DB::DESTROY][Line:601]: Deadlock found when trying to get lock; try restarting transaction, SQL: '#012                    DELETE FROM sessions#012                    WHERE session_id = ?#012                        AND data_key = ?#012                        AND id <= ?'


Does anybody know where this is coming from and how I can prevent it?
I'm not able to reproduce it, but the message occurs several times a day, always with a different number.
I didn't do any changes to the database since the installation.


Thanks for your help.

Best regards.

crythias
Moderator
Posts: 10108
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: MySQL - Duplicate entry

Post by crythias » 05 Jan 2018, 16:30

While it's not recommended to mess directly with the database, there seems to be an issue where there's a double attempt to mark an article as seen.

Duplicate entry for key could be the same item is open in multiple tabs and attempt to mark an article or ticket as seen might have duplicated.

Is this a one off or constant? A one-off should be ignored as it's not too much of an issue, though it could be a bug to address.

DeadLock issue may also be something to report as a bug. It seems to indicate an issue with someone logging off their session.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask

sommerzeit
OTRS newbie
Posts: 11
Joined: 15 Dec 2017, 17:12
OTRS Version?: 6.0.2
Real Name: Florian Sommer

Re: MySQL - Duplicate entry

Post by sommerzeit » 08 Jan 2018, 12:53

Thank you very much for your input!

Since I did a reboot it didn't occur again.
I'll let you know if anything changes.


Best regards

Rikimaru
OTRS newbie
Posts: 8
Joined: 04 Jul 2017, 12:11
OTRS Version?: 6.0.6

Re: MySQL - Duplicate entry

Post by Rikimaru » 04 May 2018, 20:01

Hello Community,

im currently facing the same issue. I could find out, that this error is occuring, if you open multiple tickets in tabs.
Unfortunately all my tries, to solve this issue were unsuccessful. Reboot didn't work, flush Ticket_Flag, creating
new agent didn't work this out.

Maybe someone can give a helping hand here.

Kind regards :)

bgone
OTRS newbie
Posts: 28
Joined: 26 Oct 2010, 10:19
OTRS Version?: 6.0.19

Re: MySQL - Duplicate entry

Post by bgone » 06 Aug 2019, 10:43

Hi,

yes, we meet this issue since upgrade to OTRS 6

DBD::mysql::db do failed: Duplicate entry '2580-Seen-2' for key 'ticket_flag_per_user' at /opt/otrs//Kernel/System/DB.pm line 470.

Post Reply