ERROR: duplicate key value violates unique constraint "ticket_flag_per_user"

Moderator: crythias

Post Reply
cgr
Znuny newbie
Posts: 14
Joined: 07 Apr 2017, 07:08
Znuny Version: 6.0.4
Real Name: Christian Graebener
Company: Evotec AG

ERROR: duplicate key value violates unique constraint "ticket_flag_per_user"

Post by cgr »

Hi All,

since I updated my OTRS Systems both on Centos 7 with postgresql 9.3. from 5.14 to 6.04 I keep receiving these Error messages
during the day:

ERROR: duplicate key value violates unique constraint "ticket_flag_per_user"

In the logs I find a more detailed error :
[Fri Jan 26 10:21:01 2018][Error][Kernel::System::Ticket::TicketFlagSet][6597] ERROR: duplicate key value violates unique constraint "ticket_flag_per_user"
DETAIL: Key (ticket_id, ticket_key, create_by)=(46827, Seen, 47) already exists., SQL: '
INSERT INTO ticket_flag
(ticket_id, ticket_key, ticket_value, create_time, create_by)
VALUES (?, ?, ?, '2018-01-26 10:21:01', ?)'

This seems to be coming from the database itself so I used pgadmin to clean up the database - but it didn't help.

Anyone experienced the same ? What could I do ? Systems are working but this error doesn't disappear.

cheers

Christian
wurzel
Znuny guru
Posts: 3224
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: ERROR: duplicate key value violates unique constraint "ticket_flag_per_user"

Post by wurzel »

Hi,

cleaning the database....

did you rebuild the config + delete caches afterwards?


I am not a DBA specialist... maybe you should ask one.

Florian
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
cgr
Znuny newbie
Posts: 14
Joined: 07 Apr 2017, 07:08
Znuny Version: 6.0.4
Real Name: Christian Graebener
Company: Evotec AG

Re: ERROR: duplicate key value violates unique constraint "ticket_flag_per_user"

Post by cgr »

Thank you,

I kept straight to the script - howto upadte to otrs 6.
Ehen the steps are included in that script my answer would have been yes - but I just doublechecked

it could be I missed

PostgreSQL:

shell> cd /opt/otrs/
shell> cat scripts/DBUpdate-to-5.postgresql.sql | psql --set ON_ERROR_STOP=on --single-transaction otrs otrs

before running the update script ...

Any ideas ? should I repeat the steps ?
cgr
Znuny newbie
Posts: 14
Joined: 07 Apr 2017, 07:08
Znuny Version: 6.0.4
Real Name: Christian Graebener
Company: Evotec AG

Re: ERROR: duplicate key value violates unique constraint "ticket_flag_per_user"

Post by cgr »

Ok - I am an idiot.

just doublechecked and so when I last "doublechecked" my steps I compared them to upgrading from 4 to 5.

So in the end - the answer should have been yes - I followed all the steps in the instruction but ther was no step deleting chaches and so on - I installed using the rpm.
Post Reply