Author Topic: Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type  (Read 4740 times)

composer47

  • Guest
Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type
« on: February 28, 2010, 12:59:30 pm »
I have attempted to upgrade Civicrm from 2.2.6 to the latest version. After the install process, I pointed my browser to the upgrade sql path:

/administrator/index.php?option=com_civicrm&task=civicrm/upgrade&reset=1

The screen prompted me to upgrade my SQL tables. After confirming it, I got the following error:

Code: [Select]
    Sorry. A non-recoverable error has occurred.

    DB Error: no such table

    Database Error Code: Table 'orhadash_joomladev.civicrm_contact_type' doesn't exist, 1146

    Return to home page.

Error Details:

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

    [code] => -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] => SELECT *
 FROM civicrm_contact_type
 
 WHERE (  civicrm_contact_type.name  = 'Individual' ) 
 
 
 
 [nativecode=1146 ** Table 'orhadash_joomladev.civicrm_contact_type' doesn't exist]
    [type] => DB_Error
    [user_info] => SELECT *
 FROM civicrm_contact_type
 
 WHERE (  civicrm_contact_type.name  = 'Individual' ) 
 
 
 
 [nativecode=1146 ** Table 'orhadash_joomladev.civicrm_contact_type' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT *
 FROM civicrm_contact_type
 
 WHERE (  civicrm_contact_type.name  = 'Individual' ) 
 

 [nativecode=1146 ** Table 'orhadash_joomladev.civicrm_contact_type' doesn't exist]"]
)

I have attempted the upgrade twice, and received the same error.  I understand this table is new in 3.1, but for some reason the upgrade script isn't creating it ?

I read this thread here which is similar (http://forum.civicrm.org/index.php?topic=12139.0), that said it was resolved by first upgrading to 3.1.1. I haven't tried this.
[/code]

Offline narayanis

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 2
Re: Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type
« Reply #1 on: March 14, 2010, 10:40:03 am »
I just went from 3.0.2 and got the same error.  I can confirm that updating to 3.1.1 first, then updating to 3.1.3 will resolve the error.

Offline Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type
« Reply #2 on: March 14, 2010, 10:32:08 pm »
1. There is NO need to upgrade to 3.1.1 before moving on to 3.1.3. You can directly move on to 3.1.3.

2. IMO "civicrm_contact_type' doesn't exist" error happens when you have installed the new codebase and -
a. try to access any another screen other than civicrm/upgrade, since the new code expects that table to be present.
- OR -
b. try to access civicrm/upgrade, but due to incorrect url civicrm try to visit default civicrm/dashboard screen, throwing the same error like 2a.

composer47, If 2a or 2b is not the case AND you can provide us the backtrace with url, we can look at the problem and fix it.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

composer47

  • Guest
Re: Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type
« Reply #3 on: March 15, 2010, 06:42:06 pm »
2a and 2b is NOT the case.  How do I provide you "the backtrace with url" ?  Where can I go to see what this means?

Offline Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type
« Reply #4 on: March 16, 2010, 06:12:38 am »
Can you get me ssh access - http://wiki.civicrm.org/confluence/display/CRMDOC/SSH+Access+Requirements and i can login and check.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Offline Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type
« Reply #5 on: March 17, 2010, 03:48:44 am »
Never mind, we have recreated the problem on joomla.

Here is what's happening - After having installed the new codebase, when user's session expires (may be due to short session lifetime), and when user tries to re-login, the code does a re-sync and tries to check if logged-in contact has any image_url set (in contact_type table as per new code) which results in throwing that error.
 
Here are the workarounds till we come out with any code fix -

Workaround - 1
==========
As soon as you see the error, doing a page reload should bring the upgrade screen back. And hitting upgrade button should work normally.

- OR -

Workaround - 2
==========
Before installing the new codebase increase the session lifteime, so that session doesn't expire between installing the new codebase and hitting the upgrade.
Note: Session lifetime could be increased from Global Configuration >> Session Settings >> Session Lifetime. Change the session timeout back to previous one, once you done with upgrade.

Let us know how this works for you.
« Last Edit: March 17, 2010, 03:50:31 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

BE55Roberts

  • Guest
Re: Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type
« Reply #6 on: March 31, 2010, 10:49:12 am »
I too have seen this error while upgrading from 2.2.2 to 3.1.3. Unfortunately, the work around didn't help. The migration is still stopping at this point. Is there a way to identify exactly which mysql upgrade script is running? For example, can I determine that civicrm_upgradedb_v1.5_v1.6_41.mysql is actually running, and thus where the problem lies? If I can determine the SQL statements running, then perhaps I can diagnose the problem in the database. I have had to create this table, based on the civicrm.mysql file, in order to get any further.

Offline aluidens

  • I’m new here
  • *
  • Posts: 28
  • Karma: 1
  • CiviCRM version: 3.4.8/4.1.1
  • CMS version: J1.5.25/J2.5.4
  • MySQL version: 5+
  • PHP version: 5.1+
Re: Upgrade from 2.2.6 to 3.1.3 - missing table civicrm_contact_type
« Reply #7 on: April 17, 2010, 10:07:37 am »
I have attempted to upgrade from 2.2.9 to 3.1.4 getting the same error message that the contact type table is missing.

I tried both workaround 1 and 2 with the same exact results.  For workaround 2 I even change the session lifetime from 15min to 45min.