Defect #996

CVS view ends up with "duplicate key violates unique constraint" after 0.7.0RC1 update

Added by Stefan Kremer over 9 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2008-04-04
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

0%

Category:SCM
Target version:-
Resolution: Affected version:

Description

This error first time came up after 0.7.0RC1 migration. SVN repository works fine. Only CVS repositories are affected.

Processing RepositoriesController#show (for 172.22.150.25 at 2008-04-02 17:31:40) [GET]
Session ID: e6ad346ab116a5d1e4df25d930061c49
Parameters: {"action"=>"show", "id"=>"project", "controller"=>"repositories"}

ActiveRecord::StatementInvalid (PGError: ERROR: duplicate key violates unique constraint "changesets_repos_rev"
: UPDATE changesets SET "scmid" = NULL, "comments" = E'no message', "commit_date" = '2007-12-03', "committer" = E'USER', "committed_on" = '2007-12-03 00:00:00.000000', "repository_id" = 5, "revision" = 1 WHERE "id" = 14):

Version: 0.7.0RC1
Database: Postgre

test.csv Magnifier - Query Result (533 Bytes) Stefan Kremer, 2008-04-08 13:20

repository2.csv Magnifier - Partial query result (6.03 KB) Sandrine LEAL, 2008-07-10 17:53


Related issues

Related to Redmine - Defect #3761: Most recent CVS revisions are missing in "revisions" view Closed 2009-08-19
Related to Redmine - Defect #6706: Resolving issues with the commit message produces the wro... Closed 2010-10-20
Duplicated by Redmine - Defect #1098: Upgrading from 0.6.3 to 0.7 , get repsoitiory page i... Closed 2008-04-24

Associated revisions

Revision 1355
Added by Jean-Philippe Lang over 9 years ago

CVS duplicate key violation fix (#996, #1098).

Revision 4794
Added by Toshi MARUYAMA almost 7 years ago

scm: cvs: use localtime at cvs rlog -d option (#996, #3761).

Revision 4801
Added by Toshi MARUYAMA almost 7 years ago

scm: cvs: change temporary revision number from "_N" to "tmpN" (#996, #3761, #6706).

'_' is SQL "like" special character.

History

#1 Updated by Jean-Philippe Lang over 9 years ago

Is it a new CVS repository or is it a repository that was already loaded before the migration to 0.7RC1 ?

#2 Updated by Stefan Kremer over 9 years ago

Hi Jean-Philippe,

THX for your fast answer. All repositories are created before migration.

#3 Updated by Jean-Philippe Lang over 9 years ago

I don't have a clue.
Could you post (as attached file) the result of this query:

select id, revision, committed_on from changesets where repository_id = 5

Thanks

#4 Updated by Stefan Kremer over 9 years ago

BTW. We got three CVS all of them do not work since updated to 0.7.0 RC1.

#5 Updated by Stefan Kremer over 9 years ago

Pardon!

See attached the result set.

#6 Updated by Jean-Philippe Lang over 9 years ago

  • Category set to SCM

I can't see what is happening. I've imported a CSV repository in a 0.6.4 install with a postgresql DB then migrated to 0.7.0RC1 and everything works as expected. New CVS commits are properly added to the database.
Could you post the error log so I can see exactly where this error comes from ?

#7 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from New to Resolved
  • Target version set to 0.7

r1355 should fix this problem. Can you confirm please ?

#8 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from Resolved to Closed

Should be fixed in 0.7.0 release. Reopen if needed.

#9 Updated by Sandrine LEAL over 9 years ago

I've got the same error with redmine 0.7.3 and a CVS repository:

Changeset Update (0.000000) Mysql::Error: #23000Duplicate entry '2-423' for key 2: UPDATE `changesets` SET `committer` = 'nicolas', `scmid` = NULL, `comments` = 'Nature : Modification fonctionnelle\nSofts Impact', `revision` = '423', `committed_on` = '2008-03-07 15:00:32', `repository_id` = 2, `commit_date` = '2008-03-07' WHERE `id` = 901

The repository was created with Redmine 0.6.3 before migration to 0.7.3

Config :
Redmine : 0.7.3
Rails : 2.0.2
DB : mySQL 5.0.27
OS: windows server 2003

Attached query result
Changeset Load (0.781000) SELECT * FROM `changesets` WHERE (changesets.repository_id = 2 AND (revision LIKE '_%')) ORDER BY committed_on ASC, id ASC, changesets.committed_on DESC, changesets.id DESC

#10 Updated by Jean-Philippe Lang over 9 years ago

  • Target version deleted (0.7)

#11 Updated by Sandrine LEAL over 9 years ago

Is there anybody working on this bug because it's very important for us ? Some of our repositories doesn't work anymore and there is no workaround.

#12 Updated by Toshi MARUYAMA almost 7 years ago

  • Assignee set to Toshi MARUYAMA

#13 Updated by Toshi MARUYAMA almost 7 years ago

  • Status changed from Reopened to Closed

I commit some revisions to SVN trunk.
If you still have a problem in SVN trunk r4802, please reopen this issue.

Also available in: Atom PDF