CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • upgrade db error
Pages: [1]

Author Topic: upgrade db error  (Read 3166 times)

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
upgrade db error
January 13, 2009, 07:36:06 am
    Sorry. A non-recoverable error has occurred.

    DB Error: already exists

    Database Error Code: Duplicate entry '7' for key 1, 1062

    Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => INSERT INTO `civicrm_component` (`id`, `name`, `namespace`) VALUES ( 7,'CiviCase','CRM_Case' ) [nativecode=1062 ** Duplicate entry '7' for key 1]
    [type] => DB_Error
    [user_info] => INSERT INTO `civicrm_component` (`id`, `name`, `namespace`) VALUES ( 7,'CiviCase','CRM_Case' ) [nativecode=1062 ** Duplicate entry '7' for key 1]
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO `civicrm_component` (`id`, `name`, `namespace`) VALUES ( 7,'CiviCase','CRM_Case' ) [nativecode=1062 ** Duplicate entry '7' for key 1]"]
)

I have to break off for a while, more debugging / info as I unearth it!

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: upgrade db error
January 13, 2009, 07:42:27 am
Did you start upgrade with clean CiviCRM 2.1.x db ?

Kurund
Found this reply helpful? Support CiviCRM

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: upgrade db error
January 13, 2009, 09:59:16 am
Clean?

This is a development environment using a copy of actual data.

Nothing rude though!

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: upgrade db error
January 13, 2009, 10:07:48 am
Quote
Clean?

I mean can you import 2.1 working db and retry upgrade.

Kurund
Found this reply helpful? Support CiviCRM

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: upgrade db error
January 14, 2009, 12:39:32 am
Hey,

Quote from: myles on January 13, 2009, 07:36:06 am
    Database Error Code: Duplicate entry '7' for key 1, 1062

Did you have any custom components defined in your civicrm_component table? It seems like there is a record with id = 7 already... Can you please check the contents of this table?

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: upgrade db error
January 14, 2009, 01:21:10 am
I'm afraid that there will be a delay of a couple of days - I am an operational member of a charity who happened to have once had roles in IT - since I couldn't stand not having tools to do my job I have been putting things together - I have to attend to the day job for a couple of days and will then work out how to get round this.

For now some further background on the installation - It was a clean, working 2.1 database. I could and probably shall restore it once I've understood the nature of the error, that I am delighted to investigate.

I have been tracking civicase for some time and have had cases turned on since 1.x exploring ways of using it. It may be that - I shall investigate, but don't expect answers for a couple of days - sorry.

myles

  • I post frequently
  • ***
  • Posts: 263
  • Karma: 11
Re: upgrade db error - success (with odd bits)
January 22, 2009, 05:26:58 am
I rolled back to 2.1 database and code and ensured that everything was working as it should.

I then checked the components table - it looked something like this:

idnamenamespace
1CiviEventCRM_Event
2CiviContributeCRM_Contribute
3CiviMemberCRM_Member
4CiviMailCRM_Mail
5CiviGrantCRM_Grant
6CiviEventCRM_Event
7CiviContributeCRM_Contribute
8CiviMemberCRM_Member
9CiviMailCRM_Mail
10CiviGrantCRM_Grant
11CiviEventCRM_Event
12CiviContributeCRM_Contribute
13CiviMemberCRM_Member
14CiviMailCRM_Mail
15CiviGrantCRM_Grant
16CiviPledgeCRM_Pledge

So
I deleted all the duplicates;
changed the Pledge id to 6 (having first updated the constraining fields in the menu table);
re-applied the upgrade...

Upgrade reported success and everything appears to work... now to start exploring!

« Last Edit: January 22, 2009, 05:43:30 am by myles »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • upgrade db error

This forum was archived on 2017-11-26.