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 (Moderator: Dave Greenberg) »
  • Internal Server Error on Smart Group edit/search
Pages: [1]

Author Topic: Internal Server Error on Smart Group edit/search  (Read 1220 times)

ptpittman

  • I’m new here
  • *
  • Posts: 3
  • Karma: 1
Internal Server Error on Smart Group edit/search
October 20, 2009, 01:10:58 am
Hi there,

Having an issue on CiviCRM 3.0.1/Drupal 6.1.4 (issue was there on 2.2.5, upgrade did not resolve it).

Attempting to search against a specific smart group criteria returns an "internal server error" page. Apache2 error log reveals only "premature end of script headers" for the error. Am 99.9% sure this is not a memory issue, although to be certain i increased available memory for php to 200M (and verified this is actually available in drupal phpinfo page).

http://[sitename]/civicrm/group/search?reset=1&force=1&context=smog&gid=4 for instance, returns this error.

Significantly, it is not ALL smart groups returning the error, only two of them. Others (including one with >1800 results) return fine. The groups were returning results until last week, no code changes were made (that I know of).

DB has 3435 records. Standard searches run fine.

The following return server errors (not sure how best to describe the query other than to paste its where clause from civicrm_saved_search table):

Quote
( `civicrm_group_contact_cache_11`.group_id = 11 AND civicrm_membership.membership_type_id = 6 AND civicrm_membership.status_id IN (1,2,3,4,5) AND  civicrm_membership.is_test = 0 )

AND ALSO:

 ( `civicrm_group_contact_cache_3`.group_id = 3 AND civicrm_membership.status_id IN (1,2,3) AND  civicrm_membership.is_test = 0 )

Whereas this one works fine:

Quote
(  ( LOWER(contact_a.preferred_mail_format) = 'html' AND contact_a.contact_type IN ('Individual') )  OR  ( LOWER(contact_a.preferred_mail_format) = 'html' AND contact_a.contact_type IN ('Organization') )  OR  ( LOWER(contact_a.preferred_mail_format) = 'text' AND contact_a.contact_type IN ('Individual') )  OR  ( LOWER(contact_a.preferred_mail_format) = 'text' AND contact_a.contact_type IN ('Organization') )  )

The obvious suspect is the civicrm_group_contact_cache_x tables - these don't exist, so i presume they are temporary tables created somewhere in the search?

Any clues what's going on? Any caches I could/should be clearing?
« Last Edit: October 20, 2009, 02:27:33 am by ptpittman »

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: Internal Server Error on Smart Group edit/search
October 20, 2009, 10:17:55 am

can u email me your 3.0.1 db (lobo at yahoo dot com)

i suspect the queries are not optimized and some join's are taking way too long

i'll delete it when done

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

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: Internal Server Error on Smart Group edit/search
October 20, 2009, 08:35:58 pm

thanx for the DB

i looked at group 11 (Individual members - over 26 concession)

the where clause of the smart group is:

( `civicrm_group_contact_cache_11`.group_id = 11 AND civicrm_membership.membership_type_id = 6 AND civicrm_membership.status_id IN (1,2,3,4,5) AND  civicrm_membership.is_test = 0 )

which basically points to itself and hence the infinite loop and hence the running out of memory issue

I dont think we have a way to edit the criteria, so u might want to try recreating the smart groups again and not add the same group as part of the criteria. I faintly remember a bug which added this in early versions of 2.0

ping me on IRC if u have any questions

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

ptpittman

  • I’m new here
  • *
  • Posts: 3
  • Karma: 1
Re: Internal Server Error on Smart Group edit/search
October 20, 2009, 08:51:26 pm
Thanks for your help Donald, that makes sense. Have tested recreating groups with similar criteria and they work fine, so I guess the client somehow managed to create these self-referential groups on 2.2.5. Will just delete those ones.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Internal Server Error on Smart Group edit/search

This forum was archived on 2017-11-26.