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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • CiviCRM config_backend Issues
Pages: [1] 2

Author Topic: CiviCRM config_backend Issues  (Read 3704 times)

phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
CiviCRM config_backend Issues
May 27, 2011, 07:42:28 am
Background:
CiviCRM 3.3.6 on a Drupal install with 5 languages.

Issue
We are repeatedly getting a PEAR.php memory error for no apparent reason. After resetting the civicrm_domain.config_backend to an earlier value it seems to resolve the issue. No configuration changes have been made to CiviCRM but potentially they have been made to the Drupal configuration.

To help with debugging, does anyone know how to obtain information about the values in this db field and its structure?
Currently the values that have caused the PEAR.php memory error are the two items below. These do not exist in the config_backend that works

s:13:\"/index.php?q=\
b:0

These 2 values are only in the one that works
s:1:\"0\"
s:1:\"/\"

Each of these values is separated by a semi-colon and the order of the values is different but I an not sure if this is an issue.

Any feedback would be appreciated as this is becoming a repeating problem (every 10-14 days) but this is the first time we have captured the values. Any other information of the config_backend structure would be good

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: CiviCRM config_backend Issues
May 27, 2011, 05:58:14 pm
I'm not sure that you are going down the right path here.

I would investigate where your memory is going - it may be that although the final symptom is a call into PEAR, the problem might be the number of Apache processes or mail processes, or the Apache processes gradually each getting bigger.  There's some useful information on relevant commands at http://rimuhosting.com/howto/memory.jsp.

Sometimes you may need to increase the php maximum memory limit for CiviCRM, especially if you've just upgraded from D6 to D7.

But before spending too much time on this, I'd emphasize that often it is easier and less expensive to just increase the server RAM to see if that helps.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
Re: CiviCRM config_backend Issues
May 27, 2011, 11:08:42 pm
Thanks for the reply.
In this instance it is not a memory issue but is a common pear error that CiviCRM does not report back the full information about. After modifying the PEAR.php file to output $message sent to the PEAR_error function (line 866).

This repeated error has only occurred on a multi-language site we have and the underlying error is always very different but generally is due to a database error (tables or columns missing due to incorrect upgrade, error with restoring from backup and missing db views.

We still need to do some internal testing and build a test system to recreate the problem but this time we removed the data in the config_backend and the underlying PEAR error was due to the US language table was missing (this would be the default in the initial CiviCRM state). Restoring the value of the config_backend from a backup removed this error and everything worked ok again. Put the old value back and then we get the PEAR error again. We needed to get our live system back up ASAP so could not spend any more time investigating on the live system. The only differences in the config_backend are listed in my first post.

I hope this help clarify this issue further and the reason why I have ask the question :)


Standard PEAR error that could and does mean it could be a number of issues none of them memory related.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16 bytes) in /var/www/drupal_aiw/sites/all/modules/civicrm/packages/PEAR.php on line 884

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM config_backend Issues
May 28, 2011, 07:46:50 am

config_backend stores some of your civicrm settings in a "serialized" (a php function, check php manual) in the DB. Both those values seem quite off. Its typically quite a long string. In my local install the length is 2732 characters and starts off with

Code: [Select]
a:74:{s:10:"lcMessages";s:5:"en_US";s:25:"monetaryThousandSeparator";s:1:",";s:20:"monetaryDecimalPoint";s:1:".";s:11:"moneyformat";s:5:"%c %a";s:16:"moneyvalueformat";s:3:"%!i";s:12:"countryLimit";a:3:{i:0;s:4:"1228";i:1;s:4:"1101";i:2;s:4:"1226";}s:13:"provinceLimit";a:1:{i:0;s:4:"1228";}s:21:"defaultContactCountry";s:4:"1228";s:15:"defaultCurrency";s:3:"USD";s:14:"legacyEncoding";s:12:"Windows-1252";s:23:"customTranslateFunction";s:0:"";s:14:"fieldSeparator";s:1:",";s:11:"_qf_default";s:17:"Localization:next";s:21:"_qf_Localization_next";s:4:"Save";s:13:"inheritLocale";i:0;s:21:"defaultCurrencySymbol

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
Re: CiviCRM config_backend Issues
May 28, 2011, 08:43:27 am
Thanks Lobo
The string is a very long string but on examination the difference between it working and not working are the two sets of strings listed in the first message, each surrounded by the rest of the string separated by a semi-colon. Do you know when this value gets changed? No changes where made to CiviCRM at a settings level just a civimail was sent out as far as I am aware this time.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM config_backend Issues
May 28, 2011, 09:28:23 am

This string is typically updated only when the settings screens are updated (i.e. u change the value of a setting)

On initialization if it find a null value, it creates a default set of values

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: CiviCRM config_backend Issues
May 29, 2011, 08:53:56 pm
phunter: in other words, it is safe to delete the whole config_backend entry, as long as you are willing to go through the config screens again. When a site is having serious issues during manual procedures this is one way that it can often be brought back to sanity fairly easily.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
Re: CiviCRM config_backend Issues
May 31, 2011, 05:17:35 am
JoeMurray: We assumed it was safe to delete all the config_backend value but I don't think this is the case in a multi-lanugage environment as it causes other issues we have found.

Lobo: With further investigation this is the actual error we get underneath the PEAR memory error. The error is something to do with a missing title field but I can’t see any relevant to why it is there in this instance.

Also attached is the config_backend value that causes the problem. may only be valid in a mult-lanuage environment.

PEAR Error $message variable listed below:

DB_Error Object
(
    [error_message_prefix] =>
    [mode] => 16
    [level] => 1024
   
Code: [Select]
=> -19
    [message] => DB Error: no such field
    [userinfo] => SELECT civicrm_uf_group.id, title, civicrm_uf_group.is_active, is_reserved, group_type
                        FROM civicrm_uf_group
                        LEFT JOIN civicrm_uf_join ON (civicrm_uf_group.id = uf_group_id) AND civicrm_uf_group.is_active = 1
                              WHERE civicrm_uf_join.module = 'User Account' ORDER BY civicrm_uf_join.weight, civicrm_uf_group.title [nativecode=1054 ** Unknown column 'title' in 'field list']
    [backtrace] =>
)



Any Ideas as to why we would get this error of missing title field in this situation?

Thanks

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: CiviCRM config_backend Issues
May 31, 2011, 05:39:50 pm
phunter: In a multilingual site, the civicrm_uf_group table (as well as most others) has a number of fields that are changed from a unlocalized name like title to multiple fields with different names indicating the localization of the value stored in each. So a system that has enabled en_US (American English) and ca_FR (Canadian French) will no longer have a title field in its civicrm_uf_group table, just title_en_US and title_ca_FR.

The backtrace not included would indicate the code that creates the problematic query. It may be that there is an oversight in some code that is not properly internationalized. It would be helpful to see that stack trace, and others that are producing similar issues.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
Re: CiviCRM config_backend Issues
May 31, 2011, 10:51:01 pm
JoeMurry: Very helpful reply, thanks.
I will investigate this further and report any further findings back to this post.



phunter

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Drupal 7
Re: CiviCRM config_backend Issues
June 14, 2011, 12:31:59 am
This issue seems difficult to investigate due to the fact that in a multi-Language installation we find that the config_backend is becoming corrupted but with no indication on when this is happening. Once this becomes corrupted we fix by restoring a backup of this value and everything works fine again. All the underlying PEAR errors are as a result of the config_backend not having the correct value. The last error resulted in a config_backend value of just 'N;'

Can anyone suggest a way to capture when this value is changed as no changes have been made to the system or settings through the UI, only standard CRM, event management (one event), and mail sent through CiviMail.

Any suggestions would be a great help.

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: CiviCRM config_backend Issues
October 26, 2011, 10:37:01 am
Okay, i think i've just run into this issue, which might be a repeat of several threads, like these ones:

http://forum.civicrm.org/index.php?topic=20547.0
http://forum.civicrm.org/index.php?topic=18688.0

My circumstances are with making a dev copy of a D6/CiviCRM3.3.6 mulitlingual site, so I think the multilingual is some kind of issue here. I tried setting the config_backend to blank and it didn't help.

The first layer has been identified earlier in this thread - that the PEAR debug is failing, going into some kind of loop. As a first step, i edited line 882 of the PEAR.php script to just do a straight print_r(debug_backtrace()); die(); instead of the fancy stuff that was breaking in there.

When I look at that backtrace - I see that the actual error is a db access error, and it's trying to access it with the production user/passwd (not set up on my dev machine).

So I guess that means the database credentials are somehow being cached in the database? Sounds like a bad idea?

Here's the sql:

SELECT v.name as valueName, v.value, g.name as optionName
FROM   civicrm_option_value_en_US v,
       civicrm_option_group_en_US g
WHERE  ( g.name = 'directory_preferences'
OR       g.name = 'url_preferences' )
AND    v.option_group_id = g.id
AND    v.is_active = 1

The debug_backtrace shows that the code goes bad during the drupal configuration, so i think it's related to the language negotiation.

In any case - my solution was to add the mysql credentials from my production server, but I think my specific issue might enlighten this general problem.

I can send someone the full backtrace if that's helpful.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM config_backend Issues
October 26, 2011, 08:50:37 pm

i dont think we intentionally cache the dsn info in the DB. Would be worth investigating and getting to the root of this issue. Can we get ssh access to the box?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: CiviCRM config_backend Issues
October 27, 2011, 04:56:05 am
I'll try and recreate it on a publicly accessible server, but it'll have to wait til next week.

As I think about it again ... it's quite confusing to me that it was trying to access the server with those production credentials.

The site was originally set up as a single-language site, and then we had to make the mysql user a super user to allow the multi-language thing. Then I gave in and upgraded them to Mysql 5.1 and that allowed me to downgrade some of those superpowers. All that was on the production server (not in production yet ...), so I'm not sure how all of that might have left the tables, etc. Those mysql super powers and related trigger things are definitely outside my scope and comfort zone ...

btc97

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.4
  • CMS version: Drupal
  • MySQL version: 5.5.37
  • PHP version: 5.3.3
Re: CiviCRM config_backend Issues
March 27, 2012, 08:29:41 pm
I'm facing the same problem I believe.

All I'm trying to do is rename a multi-language CiviCRM database on a local MAMP installation, but after running through the process multiple times, I'm stuck on:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /Users/myname/Sites/mysite/sites/all/modules/civicrm/packages/PEAR.php on line 884

I've tried duplicating the database using PHPMyAdmin, dumping and restoring using mysql. I just don't know what could be going wrong. I thought it may be the old database name cached somewhere, but I've cleared all the CiviCRM cache tables, emptied config_backend, deleted template_c files.

Of course, I could just not rename the database, but this looks like some underlying problem, and it will probably rear its head when I push the db to the production server...

Any recommendations?

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • CiviCRM config_backend Issues

This forum was archived on 2017-11-26.