Answers.Body: <p>It appears that your Drupal siteroot is at <code>/var/www/html/example/docroot</code>, but this search is looking for CiviCRM at <code>/var/www/html/civicrm/v4.3.8-d7</code>.  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 <code>/var/www/html/civicrm/v4.3.8-d7</code> that shouldn't be.  Please check your <code>civicrm.settings.php</code> file and perhaps the <strong>Administer menu > System Settings > Directories</strong> settings as well.  This problem is likely to clear up when you point CiviCRM to the correct install.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-18T00:44:42.207Z
Answers.Text: 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.
Answers.UserDisplayName: Christia
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-18T18:16:38.370Z
Answers.Text: @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 http://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.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-18T18:19:39.623Z
Answers.Text: 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!
Answers.UserDisplayName: Christia
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-18T00:29:12.123Z
Answers.LastActivityDate: 2016-11-18T00:29:12.123Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>This line: </p>
  
  <blockquote>
    <p>Warning: fopen(/var/www/html/example/docroot/sites/default/files/civicrm/ConfigAndLog/CiviCRM.c496aa562571a7869b7d0ea6d810ea10.log): failed to open stream: Permission denied in Log_file</p>
  </blockquote>
  
  <p>indicates a permissions error. Check that your webserver user can write to the directory:</p>
  
  <pre><code>/var/www/html/example/docroot/sites/default/files/civicrm/ConfigAndLog
  </code></pre>
  
  <p>and to this file if it exists:</p>
  
  <pre><code>/var/www/html/example/docroot/sites/default/files/civicrm/ConfigAndLog/CiviCRM.c496aa562571a7869b7d0ea6d810ea10.log
  </code></pre>
  
  <p>That may not fix the search problem you describe, but you should then get more information in the log file.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-17T20:34:49.790Z
Answers.Text: I changed the permissions for the log file and updated my post. Still get the DB error though.
Answers.UserDisplayName: Christia
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-17T08:54:17.283Z
Answers.LastActivityDate: 2016-11-17T08:54:17.283Z
Answers.UserDisplayName: Aidan
Body: <p>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:</p>
  
  <pre><code> 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] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; handle
          )
  
      [code] =&gt; -19
      [message] =&gt; 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
  </code></pre>
  
  <p>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.</p>
  
  <p>Edit: changed permissions on log file but still get the DB Error:</p>
  
  <pre><code> 17835968  17/Nov 12:32  debug    civicrm  $Fatal Error Details = Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; handle
          )
  
      [code] =&gt; -19
      [message] =&gt; 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  
  </code></pre>
  
Tags: <drupal>
Title: Date added to CiviCRM DB error when using with a smart group that has a custom field type
ThreadText: # Date added to CiviCRM DB error when using with a smart group that has a custom field type
  
  (Asked by: username_0 on 2016-11-17)
  
  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
  
  **Tags:** drupal
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-11-18. Score: 1 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_1**: @username_0Hall 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 http://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.  
  > **username_0**: 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!  
  
  ---
  
  ### Answer by username_2 on 2016-11-17. Score: 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.
  
  > **Comments:**
  > **username_0**: I changed the permissions for the log file and updated my post. Still get the DB error though.  
  
  ---
  
  