cron job open_basedir restriction in effect with Akismet

frjo - July 13, 2008 - 07:40
Project:Akismet
Version:5.x-1.4
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

After installing Akismet I started to get a lot of PHP errors in my Drupal log after every cron run. I found another post about the same problem at http://drupal.org/node/278040.

It looks like Akismet cron via some function is trying to access theme files but get the path wrong.

file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(themes/garland/minnelli/style.css) is not within the allowed path(s): (/var/www/web:/tmp) in /var/www/web/site/includes/theme.inc on line 106.

Any ideas how to fix this? I have look in akismet_cron.inc without finding anything that jumped out.

Akismet is working well otherwise and stops almost alla spam comments to my site. Thank you for providing this module for the community!

#1

gnosis - August 12, 2008 - 21:50

We just started seeing this problem as well on one of our sites.

There must be a hidden conflict somewhere. Akismet is running on the live site and not causing the cron issue. But the dev version is throwing these warnings during cron. Disabling Akismet solves the problem. We're comparing other modules that are running on dev but not live to see if we can find the missing link.

The warning is actually coming from function list_themes() in includes/theme.inc. I know Akismet makes use of theme functions during normal operations, but I haven't been able to trace this back to the cron run yet.

-G

#2

pcambra - August 22, 2008 - 09:03

Same problem here

#3

vovaodei - September 5, 2008 - 07:33

confirming, having the same problem.

Apache2 error log shows:

[...]
[Fri Sep 05 08:40:45 2008] [error] [client 69.89.31.149] PHP Warning:  file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(themes/chameleon/marvin/style.css) is not within the allowed path(s):
(/var/customers/webs/web32/com-domains/www.mysite.com:/tmp:/var/lib/php5:/tmp/phpsessions:/usr/share/squirrelmail:/var/lib/php4/tmp:/var/lib/php4:/usr/share/php) in /var/customers/webs/web32/com-domains/www.mysite.com/includes/theme.inc on line 106
[Fri Sep 05 08:40:45 2008] [error] [client 69.89.31.149] PHP Warning:  file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(themes/garland/minnelli/style.css) is not within the allowed path(s):
(/var/customers/webs/web32/com-domains/www.mysite.com:/tmp:/var/lib/php5:/tmp/phpsessions:/usr/share/squirrelmail:/var/lib/php4/tmp:/var/lib/php4:/usr/share/php) in /var/customers/webs/web32/com-domains/www.mysite.com/includes/theme.inc on line 106
[...]

:-(

#4

dwarner - October 16, 2008 - 16:34

Confirmed

#5

arvana - October 23, 2008 - 19:17

I just started having this problem as well. In my case it seems to be a conflict with the Google Analytics module as the problem goes away when I disable it.

#6

ferrangil - December 29, 2008 - 13:39

I'm not using Askimet but GA, and having the same problems.
Any solution??

#7

frjo - December 30, 2008 - 12:03
Status:active» won't fix

The project page says that this module is not supported any more so I close this issue.

I have been using mollom instead for some time and it works really well.

http://drupal.org/project/mollom

#8

criznach - August 3, 2009 - 17:32

FYI, I found this to be related to the devel module. In my case, disabling devel fixed it.

To further troubleshoot the source of these errors, try this...

In the watchdog() function in bootstrap.inc, locate this line:

  db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, $request_uri, referer_uri(), $_SERVER['REMOTE_ADDR'], time());

Insert the additinal lines below so it looks like this...

if ($type == 'php' && $user->uid == 1) {
$message .= "<pre>".print_r(debug_backtrace(), true)."</pre>";
}

  db_query("INSERT INTO {watchdog} (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)", $user->uid, $type, $message, $severity, $link, $request_uri, referer_uri(), $_SERVER['REMOTE_ADDR'], time());

You should now have a debug backtrace log of every php error triggered by the admin user.

 
 

Drupal is a registered trademark of Dries Buytaert.