2

Using the CiviCRM custom search by Date added to CiviCRM, I can add any group or smart group and get results, but when I search within a specific smart group I created, which involves using criteria from a custom field, I get the following errors:

 17829237  16/Nov 16:53  warning  php     Warning: fopen(/var/www/html/example/docroot/sites/default/files/civicrm/ConfigAndLog/CiviCRM.c496aa562571a7869b7d0ea6d810ea10.log): failed to open stream: Permission denied in Log_file 
 17829238  16/Nov 16:53  debug    civicrm  $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such 
 17829239  16/Nov 16:53  warning  php     Warning: fopen(/var/www/html/example/docroot/sites/default/files/civicrm/ConfigAndLog/CiviCRM.c496aa562571a7869b7d0ea6d810ea10.log): failed to open stream: Permission denied in Log_file 
 17829240  16/Nov 16:53  debug    civicrm  $backTrace = #0 /var/www/html/civicrm/v4.3.8-d7/CRM/Core/Error.php(196): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2

Please note that we are already working on trying to upgrade our version of CiviCRM from 4.3.8, but in the meantime, I'd like to know if anyone has any ideas about what is going on here, thanks! We are on Drupal 7.50 Commons.

Edit: changed permissions on log file but still get the DB Error:

 17835968  17/Nov 12:32  debug    civicrm  $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such 
 17835969  17/Nov 12:32  debug    civicrm  $backTrace = #0 /var/www/html/civicrm/v4.3.8-d7/CRM/Core/Error.php(196): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2  
1

It appears that your Drupal siteroot is at /var/www/html/example/docroot, but this search is looking for CiviCRM at /var/www/html/civicrm/v4.3.8-d7. CiviCRM should be installed in the Drupal modules directory. I'm guessing that it IS installed in the Drupal modules directory - I don't think it works if it's not - but that there's a setting pointing to /var/www/html/civicrm/v4.3.8-d7 that shouldn't be. Please check your civicrm.settings.php file and perhaps the Administer menu > System Settings > Directories settings as well. This problem is likely to clear up when you point CiviCRM to the correct install.

  • CiviCRM was installed in a separate docroot years ago, with a symlink and modifications to the civicrm.settings.php, showing a docroot that contains the symlink. That docroot is correct. I do plan to simplify this for the upgrade, as you suggest. We also utilized some magic dirname(__FILE__).'/files/civicrm/templates_c/ for the templates directory. Directories settings reflects that. There is also a settings_location.php file set up. I think you're on the right track. Because of our complicated set up, it is possible I missed a setting somewhere. I wasn't involved in the original set up. – Christia Nov 18 '16 at 0:44
  • 1
    @ChristiaHall It's possible that the issue is one of code that's not prepared to follow symlinks. That your backtraces seem to be failing even after the permissions are fixed is a good indication that this is specific to your installation, so I don't know how much help this forum will be. I'd ordinarily suggest you hire someone from civicrm.org/providers, but you seem to have a good grasp on what needs to be done. I would suggest getting a copy of this site together and work on moving Civi out of the docroot pre-upgrade. You'll need to do it eventually anyway, and it may solve this. – Jon G - Megaphone Tech Nov 18 '16 at 18:16
  • I agree that that is the best course of action, and it may solve our other minor amount of issues as well. Thanks for your help! – Christia Nov 18 '16 at 18:19
2

This line:

Warning: fopen(/var/www/html/example/docroot/sites/default/files/civicrm/ConfigAndLog/CiviCRM.c496aa562571a7869b7d0ea6d810ea10.log): failed to open stream: Permission denied in Log_file

indicates a permissions error. Check that your webserver user can write to the directory:

/var/www/html/example/docroot/sites/default/files/civicrm/ConfigAndLog

and to this file if it exists:

/var/www/html/example/docroot/sites/default/files/civicrm/ConfigAndLog/CiviCRM.c496aa562571a7869b7d0ea6d810ea10.log

That may not fix the search problem you describe, but you should then get more information in the log file.

  • I changed the permissions for the log file and updated my post. Still get the DB error though. – Christia Nov 17 '16 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.