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) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • DB Error: no such field
Pages: [1] 2

Author Topic: DB Error: no such field  (Read 3849 times)

dflasse

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
    • Tout peut arriver
DB Error: no such field
July 23, 2014, 05:18:48 am
When enabling multi language support on my 4.4.4 civicrm/Drupal 7.23 install, I've the error DB Error: no such field that shows up.

The original install is in English. I need to enable French.

Here's the error log:

Database Error Code: Unknown column 'v.label' in 'field list', 1054
Additional Details:
Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] =>
SELECT  v.label as label ,v.name as value, v.grouping as grouping
FROM   civicrm_option_value v,
       civicrm_option_group g
WHERE  v.option_group_id = g.id
  AND  g.name            = 'languages'
  AND  g.is_active       = 1  AND  v.is_active = 1  ORDER BY v.weight [nativecode=1054 ** Unknown column 'v.label' in 'field list']
    [type] => DB_Error
    [user_info] =>
SELECT  v.label as label ,v.name as value, v.grouping as grouping
FROM   civicrm_option_value v,
       civicrm_option_group g
WHERE  v.option_group_id = g.id
  AND  g.name            = 'languages'
  AND  g.is_active       = 1  AND  v.is_active = 1  ORDER BY v.weight [nativecode=1054 ** Unknown column 'v.label' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="
SELECT  v.label as label ,v.name as value, v.grouping as grouping
FROM   civicrm_option_value v,
       civicrm_option_group g
WHERE  v.option_group_id = g.id
  AND  g.name            = 'languages'
  AND  g.is_active       = 1  AND  v.is_active = 1  ORDER BY v.weight [nativecode=1054 ** Unknown column 'v.label' in 'field list']"]
)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: no such field
July 23, 2014, 09:31:11 am
Was this site upgraded from a previous version?
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.

dflasse

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
    • Tout peut arriver
Re: DB Error: no such field
July 24, 2014, 12:15:03 am
Yes. We're using civicrm since version 1.6. Is this related?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: no such field
July 24, 2014, 04:10:09 am
I'm not sure, but I would suggest you try the Ensuring Schema Integrity on Upgrades procedure.
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.

Mich___

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: 4.7.6
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 5.4.32
Re: DB Error: no such field
February 23, 2015, 05:11:02 am
Hi, I have a similar problem,

Getting this error: DB Error: no such field
after moving and upgrading database.

I used this method to move a database:
Alternatively, If both of these solutions fail: 1/. run a clean database installation to a new database (by deleting/renaming civicrm.settings.php). 2/. Confirm that this clean installation works 3/. Download clean database. 4/. Replace the SQL for the `civicrm_domain`  table in your original database with the new SQL from the clean database. 5/. Upload the updated original database. 6/. edit civicrm.settings.php to repoint to the original database. 7/. rebuild the menus as instructions above

then i upgraded.

Here the error log:
Could you help me to decipher the error?

[23-Feb-2015 11:45:36 Europe/Berlin] PHP Fatal error: Call to undefined function is_admin() in /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 83


On line 83 I could find this code:
if (is_admin()) {
require_once (ABSPATH . 'wp-admin/admin-header.php');
}
else {
// FIX ME: we need to figure out to replace civicrm content on the frontend pages
}
}


What does it mean, and what could be a fix?
Best wishes and thanks, Michael

p.s. this is the error log by civicrm:

Feb 23 12:17:38  [info] $backTrace = #0 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(239): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB.php(975): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#4 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#5 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...", "DB_Error", TRUE)
#6 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'v.label' in 'field list'")
#7 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#9 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common->query("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#10 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#11 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#12 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1116): CRM_Core_DAO->query("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...", TRUE)
#13 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/OptionGroup.php(152): CRM_Core_DAO::executeQuery("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...", (Array:1))
#14 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/PseudoConstant.php(321): CRM_Core_OptionGroup::values("languages", FALSE, FALSE, FALSE, NULL, "label", TRUE, FALSE, "name")
#15 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php(3255): CRM_Core_PseudoConstant::get("CRM_Contact_BAO_Contact", "preferred_language", (Array:0), NULL)
#16 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/I18n.php(129): CRM_Contact_BAO_Contact::buildOptions("preferred_language")
#17 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Smarty.php(165): CRM_Core_I18n::languages(TRUE)
#18 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Smarty.php(183): CRM_Core_Smarty->initialize()
#19 /home/gemeingut/www/www/wp-content/plugins/files/civicrm/custom_ext/sfe.donationreceipts/donationreceipts.civix.php(13): CRM_Core_Smarty::singleton()
#20 /home/gemeingut/www/www/wp-content/plugins/files/civicrm/custom_ext/sfe.donationreceipts/donationreceipts.php(29): _donationreceipts_civix_civicrm_config(Object(CRM_Core_Config))
#21 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(194): donationreceipts_civicrm_config(Object(CRM_Core_Config))
#22 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(133): CRM_Utils_Hook->runHooks((Array:2), "civicrm_config", 1, Object(CRM_Core_Config), NULL, NULL, NULL, NULL, NULL)
#23 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(69): CRM_Utils_Hook->commonInvoke(1, Object(CRM_Core_Config), NULL, NULL, NULL, NULL, NULL, "civicrm_config", "wordpress")
#24 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(907): CRM_Utils_Hook_WordPress->invoke(1, Object(CRM_Core_Config), NULL, NULL, NULL, NULL, NULL, "civicrm_config")
#25 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php(256): CRM_Utils_Hook::config(Object(CRM_Core_Config))
#26 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/bin/cron.php(32): CRM_Core_Config::singleton()

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: no such field
February 23, 2015, 05:28:50 am
What are your old and new CiviCRM versions?

The last line in your error backtrace mentions cron.php and as you can see in this Google search, there are several threads on this forum about this.
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.

Mich___

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: 4.7.6
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 5.4.32
Re: DB Error: no such field
February 23, 2015, 06:21:51 am
4.1 was the old version (If i remember correctly)
4.5 is the new version.

I made the mistake that I deleted my civicrm database after I had some blank page issues after upgrading (civicrm was still running back then).
I imported a backup and since then I have more severe problems (even if following the method above, where I exchange the table structure and table data of civicrm_domain from the clean install - which works fine btw, only after linking it to the new imported database, is stops working), trying to figure it out since 4 days.

Can I turn of the cron function for a test?

Update: I deleted this line from the cron job file on my cp panel.
#!/bin/sh
GET 'http://gemeingut.s700.sureserver.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=XXXX&pass=XXXX&key=XXXX'

Didn´t change anything.

In the civicrm.settings.php file I only changed the database link to the imported the backup. Is this all I need to do in this file?
and does the new database need to have the same name as the one the backup was made from? (newbi question)
Thanks for any hints!


p.s. before this error I had a 500 error for a few days, which I changed like this:

[23-Feb-2015 01:44:02 UTC] PHP Fatal error: Cannot redeclare get_template() (previously declared in /home/gemeingut/www/www/wp-includes/theme.php:285) in /home/gemeingut/www/www/wp-content/plugins/files/civicrm/custom_ext/sfe.donationreceipts/backend.php on line 276

I exchanged backend.php with the backend.php from my civicrm folder backup,
I do not get the 500 error anymore.

Are there maybe more files form the backed up "files" folder which need to be transferred to the new civicrm "files" folder?
« Last Edit: February 23, 2015, 06:47:51 am by Hershel »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: no such field
February 23, 2015, 06:46:59 am
I edited your post to remove the username/password/key from your URL as you should never post passwords or site keys on any public forum.

I will look into this more and get back to you later here.
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.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: no such field
February 23, 2015, 08:15:26 am
That cron job is not the problem--you can put that back.

I looked at your CiviCRM log files and this is the last entry:

Code: [Select]

Feb 23 12:55:29  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -100
    [message] => DB Error: invalid view
    [mode] => 16
    [debug_info] =>
SELECT  v.label as label ,v.name as value, v.grouping as grouping
FROM   civicrm_option_value_de_DE v,
       civicrm_option_group_de_DE g
WHERE  v.option_group_id = g.id
  AND  g.name            = 'languages'
  AND  g.is_active       = 1  AND  v.is_active = 1  ORDER BY v.weight [nativecode=1356 ** View 'gemeingut_Wiederherstell_Datenbank_Kontakte.civicrm_option_value_de_DE' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them]
    [type] => DB_Error
    [user_info] =>
SELECT  v.label as label ,v.name as value, v.grouping as grouping
FROM   civicrm_option_value_de_DE v,
       civicrm_option_group_de_DE g
WHERE  v.option_group_id = g.id
  AND  g.name            = 'languages'
  AND  g.is_active       = 1  AND  v.is_active = 1  ORDER BY v.weight [nativecode=1356 ** View 'gemeingut_Wiederherstell_Datenbank_Kontakte.civicrm_option_value_de_DE' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them]
    [to_string] => [db_error: message="DB Error: invalid view" code=-100 mode=callback callback=CRM_Core_Error::handle prefix="" info="
SELECT  v.label as label ,v.name as value, v.grouping as grouping
FROM   civicrm_option_value_de_DE v,
       civicrm_option_group_de_DE g
WHERE  v.option_group_id = g.id
  AND  g.name            = 'languages'
  AND  g.is_active       = 1  AND  v.is_active = 1  ORDER BY v.weight [nativecode=1356 ** View 'gemeingut_Wiederherstell_Datenbank_Kontakte.civicrm_option_value_de_DE' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them]"]
)


Feb 23 12:55:29  [info] $backTrace = #0 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(239): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB.php(975): PEAR_Error->PEAR_Error("DB Error: invalid view", -100, 16, (Array:2), "\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#4 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-100, 16, (Array:2), "\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#5 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -100, NULL, NULL, "\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...", "DB_Error", TRUE)
#6 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-100, NULL, NULL, NULL, "1356 ** View 'gemeingut_Wiederherstell_Datenbank_Kontakte.civicrm_option_valu...")
#7 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#9 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common->query("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#10 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#11 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...")
#12 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1116): CRM_Core_DAO->query("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...", TRUE)
#13 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/OptionGroup.php(152): CRM_Core_DAO::executeQuery("\nSELECT  v.label as label ,v.name as value, v.grouping as grouping\nFROM   c...", (Array:1))
#14 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/PseudoConstant.php(321): CRM_Core_OptionGroup::values("languages", FALSE, FALSE, FALSE, NULL, "label", TRUE, FALSE, "name")
#15 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php(3255): CRM_Core_PseudoConstant::get("CRM_Contact_BAO_Contact", "preferred_language", (Array:0), NULL)
#16 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/I18n.php(129): CRM_Contact_BAO_Contact::buildOptions("preferred_language")
#17 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Smarty.php(165): CRM_Core_I18n::languages(TRUE)
#18 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Smarty.php(183): CRM_Core_Smarty->initialize()
#19 /home/gemeingut/www/www/wp-content/plugins/files/civicrm/custom_ext/sfe.donationreceipts/donationreceipts.civix.php(13): CRM_Core_Smarty::singleton()
#20 /home/gemeingut/www/www/wp-content/plugins/files/civicrm/custom_ext/sfe.donationreceipts/donationreceipts.php(29): _donationreceipts_civix_civicrm_config(Object(CRM_Core_Config))
#21 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(194): donationreceipts_civicrm_config(Object(CRM_Core_Config))
#22 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(133): CRM_Utils_Hook->runHooks((Array:2), "civicrm_config", 1, Object(CRM_Core_Config), NULL, NULL, NULL, NULL, NULL)
#23 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(69): CRM_Utils_Hook->commonInvoke(1, Object(CRM_Core_Config), NULL, NULL, NULL, NULL, NULL, "civicrm_config", "wordpress")
#24 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(907): CRM_Utils_Hook_WordPress->invoke(1, Object(CRM_Core_Config), NULL, NULL, NULL, NULL, NULL, "civicrm_config")
#25 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php(256): CRM_Utils_Hook::config(Object(CRM_Core_Config))
#26 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm.php(404): CRM_Core_Config::singleton()
#27 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm.php(725): CiviCRM_For_WordPress->initialize()
#28 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm.php(290): CiviCRM_For_WordPress->wp_frontend()
#29 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm.php(187): CiviCRM_For_WordPress->register_hooks()
#30 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm.php(121): CiviCRM_For_WordPress->setup_instance()
#31 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm.php(1575): CiviCRM_For_WordPress::singleton()
#32 /home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm.php(1589): civi_wp()
#33 /home/gemeingut/www/www/wp-settings.php(215): include_once("/home/gemeingut/www/www/wp-content/plugins/civicrm/civicrm.php")
#34 /home/gemeingut/www/www/wp-config.php(59): require_once("/home/gemeingut/www/www/wp-settings.php")
#35 /home/gemeingut/www/www/wp-load.php(29): require_once("/home/gemeingut/www/www/wp-config.php")
#36 /home/gemeingut/www/www/wp-blog-header.php(12): require_once("/home/gemeingut/www/www/wp-load.php")
#37 /home/gemeingut/www/www/index.php(17): require("/home/gemeingut/www/www/wp-blog-header.php")
#38 {main}

which is odd because the active database for CiviCRM appears to be gemeingut_neuedatenbank but the above error references gemeingut_Wiederherstell_Datenbank_Kontakte.

I'm not sure what's going on but the first step would be to roll back your database and your code to a point where the site works. Right now it's a bit messed up. :(
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.

Mich___

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: 4.7.6
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 5.4.32
Re: DB Error: no such field
February 23, 2015, 12:55:09 pm
I think this is because I have a few databases online from previous administrators of the project - so I tried to link to them via changing the link in civicrm.settings.php to that other database gemeingut_Wiederherstell_Datenbank_Kontakte.

I will get an error: DB: invalid view

I changed it back to gemeingut_neuedatenbank and get the error: DB: no such field.
So I think that is not the main issue.

I tried f.e. to us the backup that was not a dump but made via  control panel sometime last year by a previous administrator.
It didn´t work either, but may it work if - at the same time I install the old wordpress and the old civicrm-version?
I can't risk to also loose the wordpress project/database so I´d rather leave that untouched and focus on the civicrm plugin first

So it seems that every database I either re-activate, import, or link to etc does create errors,
Only the clean install works with a clean database.

I think the problem is to merge the two databases - the one from the clean install and the backup one (I wonder why they are different - my newest sql dump was done after the upgrade)


I tried to install the civicrm-backup from before the upgrade and the database from before the upgrade (while leaving wordpress in
the upgraded version). I get the same db: invalid view.


But I will try again!
To go to the point before the update.
Also with wordpress.


Could be the problem that i dumped the sql code via export in quick mode (without taking care of tables etc.)?
And therefore when I import it the table structure is confused?

Thanks!


 

« Last Edit: February 23, 2015, 01:03:10 pm by Mich___ »

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: DB Error: no such field
February 23, 2015, 01:36:49 pm
If you're exporting/importing to another database, make sure that you remove the "DEFINER" statements in the sql dump, they might be restricting access to a specific view.

You can double-check in a MySQL admin tool/cli with:

Code: [Select]
show create view civicrm_option_value_de_DE;
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Mich___

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: 4.7.6
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 5.4.32
Re: DB Error: no such field
February 23, 2015, 02:22:52 pm
Thank you, I will check.

If I delete db_civicrm and then create a new one with the same name - does this count as "another database" or
"the same database" (for the file that was previously exported from a database with that name and now imported
to a database with the same name - but in the meantime deleted and re-created).

I ask this because in case 1 I would not need to remove definer statements, right?
(but I tried this already, to import the database to a database with the same name, and it didn´t work either) -
therefore I will try to check the definer statements anyway -

My current database with show create view civicrm_option_value_de_DE;

View
Create View
character_set_client
collation_connection
civicrm_option_value_de_DE
CREATE ALGORITHM=UNDEFINED DEFINER=`gemeingut`@`%`...
utf8
utf8_general_ci


Do I need to get rid of that?

When I check the clear install (with clear database), it gives this message.

#1146 - Table 'gemeingut_sonntag.civicrm_option_value_de_DE' doesn't exist




And otherwise will roll back the whole project until before the upgrade.
If I install wordpress & civicrm from before the update - would I also need the wordpress database
from before the upgrade?

Best wishes and thanks!!



 
« Last Edit: February 23, 2015, 02:35:37 pm by Mich___ »

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: DB Error: no such field
February 23, 2015, 02:28:59 pm
Quote from: Mich___ on February 23, 2015, 02:22:52 pm
If I delete db_civicrm and then create a new one with the same name - does this count as "another database" or "the same database" (for the file that was previously exported from a database with that name and now imported  to a database with the same name - but in the meantime deleted and re-created).

I ask this because in case 1 I would not need to remove definer statements, right?
(but I tried this already, to import the database to a database with the same name, and it didn´t work either) -
therefore I will try to check the definer statements anyway -

The definer uses the MySQL username and hostname of the server (which might be just "localhost"). It might work if both match (I have never done it, to be honest, I always remove the definer).

Quote
If I install wordpress & civicrm from before the update - would I also need the wordpress database
from before the upgrade?

Only CiviCRM. No need to rollback the Wordpress database.

Good luck :)
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Mich___

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: 4.7.6
  • CMS version: WordPress
  • MySQL version: 5
  • PHP version: 5.4.32
Re: DB Error: no such field
February 23, 2015, 02:42:13 pm
Thanks, I think I am getting closer,

when trying to open civicrm_option_value_de_DE
in myphpadmin it will get an error message (see attachment) reg. the definer.

Is there a command I can use to remove the definer from the file already uploaded?

My current database with show create view civicrm_option_value_de_DE;

View
Create View
character_set_client
collation_connection
civicrm_option_value_de_DE
CREATE ALGORITHM=UNDEFINED DEFINER=`gemeingut`@`%`...
utf8
utf8_general_ci


Merci!

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: DB Error: no such field
February 23, 2015, 03:16:36 pm
You can try removing the definer from the SQL dump using the following command line:

Code: [Select]
cat file.sql | s|/\\*!50017 DEFINER=`[^`]*`@`[^`]*`\s*\\*/||g'  | sed '/\\*!50013 DEFINER=.*/ d' > file-fixed.sql
where "file.sql" is your SQL dump.

You should also compare the file before and after, to make sure that it works correctly. Sorry for being brief, I have to run out. Don't hesitate to ask if it does not work or if you are not familiar with the command line or with sed (stream editor).

Mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • DB Error: no such field

This forum was archived on 2017-11-26.