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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • [solved] import error : Unknown column in 'field list', 1054
Pages: [1]

Author Topic: [solved] import error : Unknown column in 'field list', 1054  (Read 3906 times)

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
[solved] import error : Unknown column in 'field list', 1054
April 06, 2011, 04:06:41 am
I'm trying to import a list of organisations into the system, and get an error as follow :
(sorry for the bad format, the error page wouldn't even display and came in a 'save as' dialog.)

Code: [Select]
Error Details
Database Error Code: Unknown column 'functions_and_services_12' in 'field list', 1054
Additional Details:
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_value_XXXX_org_custom_data_3  ( org_type_16,functions_and_services_12,entity_id ) VALUES ( 'Institution','école de théatre',1473 ) ON DUPLICATE KEY UPDATE org_type_16 = 'Institution',functions_and_services_12 = 'école de théatre' [nativecode=1054 ** Unknown column 'functions_and_services_12' in 'field list']
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_value_XXXX_org_custom_data_3  ( org_type_16,functions_and_services_12,entity_id ) VALUES ( 'Institution','école de théatre',1473 ) ON DUPLICATE KEY UPDATE org_type_16 = 'Institution',functions_and_services_12 = 'école de théatre' [nativecode=1054 ** Unknown column 'functions_and_services_12' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_value_smarteu_org_custom_data_3  ( org_type_16,functions_and_services_12,entity_id ) VALUES ( 'Institution','école de théatre',1473 ) ON DUPLICATE KEY UPDATE org_type_16 = 'Institution',functions_and_services_12 = 'école de théatre' [nativecode=1054 ** Unknown column 'functions_and_services_12' in 'field list']"]
)
(CiviCRM 3.3.5 on Drupal 6.2)

On a side note, to make sure it wasn't a schema corruption/upgrade problem, I tried to drop all civicrm tables, recreate them using the civicrm.mysql from the crm/sql folder on the server, then reimporting my data as advised here : http://wiki.civicrm.org/confluence/display/CRMDOC33/Ensuring+Schema+Integrity+on+Upgrades.

 However this doesn't work and I had to restore the original tables : there are several localised tables (_FR, _NL, _EN ) and fields in our data. The data import tries to import data in the localised fields or tables, which don't exist in the restored 3.3.5 core schema and the import fails.
« Last Edit: April 06, 2011, 06:19:12 am by ehanuise »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: import error : Unknown column in 'field list', 1054
April 06, 2011, 05:33:31 am
Would appear to be an issue with a custom field that was deleted, yet not fully removed from the system. Did you have an issues with a field called "functions_and_services?"

If so you might need to try to manually remove it from civicrm_custom_field. I think that's the table anyhow. I would grep a dump of the DB to find it.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
Re: import error : Unknown column in 'field list', 1054
April 06, 2011, 05:40:25 am
That costom field exists and is used.
I'll try to scrap it and recreate it, thanks for the tip  8)

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
Re: import error : Unknown column in 'field list', 1054
April 06, 2011, 05:47:16 am
Hey, now I remember when that field was created, there was some issue with the field creation, maybe due to its size (32000). Is there a maximum size for a custom field of type 'text' ?

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
Re: import error : Unknown column in 'field list', 1054
April 06, 2011, 06:18:59 am
OK, I nailed it...
"Database field length" should not exceed 255 characters, as it's a mysql 'varchar', limited to 255 char until mysql 5.0.3
I have mysql 5.0.77, but still it seems to be an issue.
I'll recreate the field using more conservative values, or a 'note' type.

Thanks for the tip !

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: [solved] import error : Unknown column in 'field list', 1054
April 06, 2011, 08:34:04 am
My pleasure. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • [solved] import error : Unknown column in 'field list', 1054

This forum was archived on 2017-11-26.