[almighty] DB migration failure due to constraint

Baiju Muthukadan bmuthuka at redhat.com
Tue Jan 3 06:19:08 UTC 2017


Hi Konrad,

My recent PR was successfully merged to master branch, but the changes were
not reflected in the Demo site.

https://github.com/almighty/almighty-core/pull/625

This is the error from the server:
------------------x<---------------------x<-----------------x<-----------------
2016/12/26 11:08:05 Failed to get current user: user: unknown userid
1000140000
2016/12/26 11:08:05 Opening DB connection attempt 1 of 50
2016/12/26 11:08:05 Current version 15. Nothing to update.
2016/12/26 11:08:05 loading work item type system.planneritem
2016/12/26 11:08:05 Work item type system.planneritem exists, will
update/overwrite the fields only and parentPath

(pq: duplicate key value violates unique constraint
"work_item_links_unique_idx")
[2016-12-26 11:08:05]
panic: pq: duplicate key value violates unique constraint
"work_item_links_unique_idx"

goroutine 1 [running]:
panic(0xb2e0c0, 0xc820519980)
/usr/lib/golang/src/runtime/panic.go:481 +0x3e6
main.main()
/tmp/go/src/github.com/almighty/almighty-core/main.go:122 +0x9f1
------------------x<---------------------x<-----------------x<-----------------

When I tried to run a similar query this is the error I am getting.

------------------x<---------------------x<-----------------x<-----------------
UPDATE "work_item_types" SET "created_at" = '2016-11-18T12:43:04Z',
"updated_at" = '2017-01-03T11:12:21+05:30', "deleted_at" = null, "version"
= '0', "path" = '/system.planneritem' WHERE "work_item_types".deleted_at IS
NULL AND "work_item_types"."name" = 'system.planneritem';
ERROR:  duplicate key value violates unique constraint
"work_item_links_unique_idx"
DETAIL:  Key (source_id, target_id, link_type_id)=(442, 443,
4db307d9-adf6-4b6c-8779-da8bb2b92534) already exists.
CONTEXT:  SQL statement "UPDATE work_item_links SET deleted_at =
NEW.deleted_at WHERE link_type_id = NEW.id"
PL/pgSQL function update_wil_after_wilt() line 3 at SQL statement
SQL statement "UPDATE work_item_link_types SET deleted_at = NEW.deleted_at
WHERE NEW.name IN (source_type_name, target_type_name)"
PL/pgSQL function update_wilt_after_wit() line 3 at SQL statement
------------------x<---------------------x<-----------------x<-----------------

Any idea how to fix this?

Regards,
Baiju M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/almighty-public/attachments/20170103/26763ef8/attachment.htm>


More information about the almighty-public mailing list