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)

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, 03:59:45 pm
Thanks, that´s great.

At the moment, when using the Mac command line, I will get this error:

mich:~ mich___$ cat /Users/mich___/Documents/gemeingut_civicrm_change.sql | s|/\\*!50017 DEFINER=`[^`]*`@`[^`]*`\s*\\*/||g'  | sed '/\\*!50013 DEFINER=.*/ d' > /Users/mich___/Documents/gemeingut_civicrm_change2.sql
-bash: !50017: event not found
mich:~ mich___$


The file is not too long, before figuring out the correct commands, would it be possible to just manually find and replace the line DEFINER=`gemeingut`@`%?
In another thread they mentioned to replace it with "", but when I use "" it creates an import error. If "" means blank, to leave nothing
behind, the definers DEFINER=`gemeingut`@`% will be back after the database is imported. This is confusing.

   
         
Quote
Thanks for the response! So in my text editor, would I replace the entire 'DEFINER=root @ localhost' string with ""? Or replace 'root @ localhost'? –  FastTrack Feb 25 '12 at 23:02
1       
@FastTrack, please remove the entire string. –  Abhay Feb 26 '12 at 7:53


Best, Michael
« Last Edit: February 24, 2015, 03:37:26 am by Mich___ »

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 24, 2015, 04:55:28 am
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).

On CiviHosting at least, it's the same database and the same user so the Definer statements should be OK.

Quote from: Mich___ on February 23, 2015, 02:22:52 pm
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?

Yes, you should always dump the entire database, structure and data, and then delete the DB and then recreate it and then import the entire database.
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 24, 2015, 06:10:34 am
Thanks!

I thought the quick mode exports tables plus data, everything.
Is there a way to safe those dump files when exported via quick option?
(I think it´s actually more data as it includes cache files etc.)

I now walk my way back - as there is one backup made last year via the control panel - which should exclude any
import/export issues, right? (as it´s done by the cp backup mode)

Then I will install the civicrm folder from that time (version 4.1.) and hope they both relate and it works.




« Last Edit: February 24, 2015, 06:25:20 am by Mich___ »

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 24, 2015, 06:43:04 am
The quick mode should actually be structure and data.

Anyhow, yes, try the old backup and let us know.
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 24, 2015, 08:22:46 am
Unfortunately:

4.1
With the control panel backup (from a previous administrator) and the old civicrm folder, I will
get following error message: DB Error: division by zero

NEW COMMENT: I managed to make a database from 2013 work, it was an automatically generated one, therefore no quick dump and I think
that´s a structure to look at. Civicrm automatically offered to upgrade the database and I can access data now.

(See further down the problems with the newest database which was dumped with quick mode)
Would this be a method? to compare both databases and erase from the newest one everything that´s not in the old one like
definer statements etc. I have to do this manually as I have no knowledge of the command lines)

Can you still have a look at the error log?
I still want to have the newest database work.
Or is there a way to merge the date of the newest database (which doesn't work) with the data from the working one?


4.5
I now focus on the newest backup again (post-upgrade),
I could upload the sql dump after adding a foreign key .... 0 to the file (and a 1 at the end of the file)

Now I geht this old error: DB Error: invalid view

These are the error logs.
(The same as at the beginning of this thread)

Can I step by step make this work? Can you guide me?

Php

[24-Feb-2015 17:11:16 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

I checked on line 83
      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
      }
    }


Civicrm:

This is either from one hour before or time is set incorrectly: nonetheless it´s the last entry
(it could be that the swap between databases is still represented in this log, but the newest and
final one is gemeingut_civicrm)

Feb 24 16:09:51  [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/extern/open.php(7): CRM_Core_Config::singleton()
#27 {main}


« Last Edit: February 24, 2015, 09:33:19 am by Mich___ »

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 24, 2015, 02:40:38 pm

The solution:

We performed a new restore after which we were able to fix your views. The issue was due to the way the views are defined. We had to enable the remote connections for your MySQL user in order to fix them.

Civihosting Support got it solved!
Thanks also for your help Hershel and Mathieu et al.
Thanks! Michael
« Last Edit: February 25, 2015, 08:38:43 am by Mich___ »

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 25, 2015, 08:41:59 am
Glad you got it fixed. Thank you for reporting back.
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.

johne15

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
    • JohnMunoz-Blog
  • CiviCRM version: 4.4
  • CMS version: Wordpress 4.1
  • MySQL version: 5.1
  • PHP version: 5.3
Re: DB Error: no such field
March 30, 2015, 10:17:54 am
Hello,

I´ve had the same bug: PHP Fatal error: Cannot redeclare get_template() (previously declared in ....
you can resolve it if you change the name of the function "get_template" in the .../sfe.donationreceipts/backend.php File. Only add a suffix and it will work.

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.