Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - duplicate inserts to the ticket_flag table with the MentionSeen key #531

Open
lukasdebaum opened this issue Jan 12, 2024 · 1 comment
Labels
1 - 🐞 bug 🐞 An issue with the system. 4 - internal Issue/MR 4 - verified This issue or pull request was verified.

Comments

@lukasdebaum
Copy link

Environment

  • Server OS: Ubuntu 22.04.3
  • Browser: Chrome, Firefox
  • Znuny version: 6.5.5

Expected behavior

No duplicate inserts to the ticket_flag table.

Actual behavior

It looks like znuny performs the insert of the ticket_flag key "MentionSeen" twice when viewing a ticket for the first time under certain conditions. This has to happen within a very short time because the entry in the DB and the duplicate entry error message usually appear in the same second or at most with a difference of one second.

ticket_id, ticket_key, ticket_value, create_time, create_by
ticket_flag-ticket_flag_per_user

[Kernel::System::Ticket::TicketFlagSet][7053] Duplicate entry '129174-MentionSeen-11' for key 'ticket_flag.ticket_flag_per_user', SQL: '
            INSERT INTO ticket_flag
            (ticket_id, ticket_key, ticket_value, create_time, create_by)
            VALUES (?, ?, ?, '2024-01-10 16:25:59', ?)'

How to reproduce

When a new ticket is viewed for the first time.
But it looks like the problem is caused by a race condition, it only occurs by a few tickets.

Additional information

[Wed Jan 10 16:26:00 2024] -e: DBD::mysql::db do failed: Duplicate entry '129174-MentionSeen-11' for key 'ticket_flag.ticket_flag_per_user' at /opt/otrs/Kernel/System/DB.pm line 497.
ERROR: OTRS-CGI-10 Perl: 5.34.0 OS: linux Time: Wed Jan 10 16:26:00 2024

 Message: Duplicate entry '129174-MentionSeen-11' for key 'ticket_flag.ticket_flag_per_user', SQL: '
            INSERT INTO ticket_flag
            (ticket_id, ticket_key, ticket_value, create_time, create_by)
            VALUES (?, ?, ?, '2024-01-10 16:25:59', ?)'

 RemoteAddress: xx.xx.xx.xx
 RequestURI: /otrs/index.pl?Action=AgentTicketZoom;TicketID=129174

 Traceback (13566): 
   Module: Kernel::System::Ticket::TicketFlagSet Line: 7053
   Module: Kernel::Modules::AgentTicketZoom::Run Line: 278
   Module: Kernel::System::Web::InterfaceAgent::Run Line: 1144
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 39
   Module: (eval) (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
   Module: ModPerl::Registry::handler (v1.99) Line: 32

Screenshots

@lukasdebaum lukasdebaum changed the title Bug - duplicate inserts to the ticket_flag table with the MentionSeen flag Bug - duplicate inserts to the ticket_flag table with the MentionSeen key Jan 12, 2024
@rkaldung rkaldung added the 4 - verified This issue or pull request was verified. label Jan 15, 2024
@rkaldung
Copy link
Member

Internal issue 839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - 🐞 bug 🐞 An issue with the system. 4 - internal Issue/MR 4 - verified This issue or pull request was verified.
Development

No branches or pull requests

2 participants