Hello,
When I try to run cron (admin/reports/status/run-cron) I get an access denied error, even if I'm logged in as admin.
If I ssh to the site and run "php cron.php" I get an HTML page output followed by the error:
PHP Fatal error: Call to undefined function sendError() in <drupal-path>/includes/common.inc(1685) : eval()'d code on line 7
The HTML output is basically the same "access denied" error page. I don't know if the PHP Fatal error is related to the access denied error (though it looks pretty bad...).
Help? Any ideas?
Daniel.
At 11:46 PM 12/30/2009, Daniel Carrera wrote:
Hello,
When I try to run cron (admin/reports/status/run-cron) I get an access denied error, even if I'm logged in as admin.
If I ssh to the site and run "php cron.php" I get an HTML page output followed by the error:
PHP Fatal error: Call to undefined function sendError() in <drupal-path>/includes/common.inc(1685) : eval()'d code on line 7
You probably have some PHP code in some page content that references the function sendError, but that function is not defined anywhere. You have to find the page that includes this code.
If you don't have too many pages, you can do this manually. If you have many, you can easily find the title of the page by searching the node_revisions table in the MySQL database for your Drupal installation. Use the query "select title from node_revisions where body like '%sendError%'; The results of this query should show you the title of the page, then you can fix the code.
Ken
Hi Ken,
Use the query "select title from node_revisions where body like '%sendError%'; The results of this query should show you the title of the page, then you can fix the code.
Well, I have progress of sorts. I found the offending page and deleted it and the PHP fatal error doesn't happen anymore, but I still can't run cron. I get the same old "access denied" page. So I guess the access denied error is caused by something else.
Any ideas why I would get an access denied error when running cron.php?
Daniel.
On 12/31/2009 12:39 AM, Daniel Carrera wrote:
Hi Ken,
Use the query "select title from node_revisions where body like '%sendError%'; The results of this query should show you the title of the page, then you can fix the code.
Well, I have progress of sorts. I found the offending page and deleted it and the PHP fatal error doesn't happen anymore, but I still can't run cron. I get the same old "access denied" page. So I guess the access denied error is caused by something else.
Any ideas why I would get an access denied error when running cron.php?
Daniel.
Cron should run even for anonymous...have you checked the actual file permissions and ownership on cron.php? They could be borked.
--Susan
Hi Susan,
Susan Stewart wrote:
Cron should run even for anonymous...have you checked the actual file permissions and ownership on cron.php? They could be borked.
$ ls -l cron.php -rw-r--r-- 1 admin admin 262 Aug 9 2006 cron.php
Looks ok to me. Note that when I run "php cron.php" the program *does* run. It starts Drupal and generates HTML showing my Drupal site and everything. But the page content is "Access denied". :-(
Daniel.
On Thu, Dec 31, 2009 at 12:02 AM, Daniel Carrera daniel.carrera@theingots.org wrote:
Looks ok to me. Note that when I run "php cron.php" the program *does* run. It starts Drupal and generates HTML showing my Drupal site and everything. But the page content is "Access denied". :-(
I suggest you open up a database connection and look in the cache_page table for any entries with a cid like '%cron.php'.
I've seen very similar behavior before - http://drupal.org/node/177790 - we're still trying to pin down what exactly causes it.
Cheers, Greg
Greg Knaddison wrote:
On Thu, Dec 31, 2009 at 12:02 AM, Daniel Carrera daniel.carrera@theingots.org wrote:
Looks ok to me. Note that when I run "php cron.php" the program *does* run. It starts Drupal and generates HTML showing my Drupal site and everything. But the page content is "Access denied". :-(
I suggest you open up a database connection and look in the cache_page table for any entries with a cid like '%cron.php'.
I think you might be on the right track here. Earlier today I cleared the cache for an unrelated reason, and now when I run "php cron.php" I don't see any output, so something has clearly changed.
Now, unfortunately, it still doesn't seem to have worked. When I go to "status report" it still says that cron hasn't run in ages, and when I go to admin/reports/status/run-cron I still get the access denied error.
As of now, the query "SELECT * FROM cache_page WHERE cid LIKE '%cron%'" returns 0 rows.
If I open a web browser and visit "mysite.org/cron.php" I get a Drupal page saying "access denied".
Daniel.
Correction: I took a database backup from yesterday and I ran the same query and on that database you still don't see any cache_page entries with '%cron%'.
I have no idea why running "php cron.php" doesn't give any output now.
Daniel.
Daniel Carrera wrote:
Greg Knaddison wrote:
On Thu, Dec 31, 2009 at 12:02 AM, Daniel Carrera daniel.carrera@theingots.org wrote:
Looks ok to me. Note that when I run "php cron.php" the program *does* run. It starts Drupal and generates HTML showing my Drupal site and everything. But the page content is "Access denied". :-(
I suggest you open up a database connection and look in the cache_page table for any entries with a cid like '%cron.php'.
I think you might be on the right track here. Earlier today I cleared the cache for an unrelated reason, and now when I run "php cron.php" I don't see any output, so something has clearly changed.
Now, unfortunately, it still doesn't seem to have worked. When I go to "status report" it still says that cron hasn't run in ages, and when I go to admin/reports/status/run-cron I still get the access denied error.
As of now, the query "SELECT * FROM cache_page WHERE cid LIKE '%cron%'" returns 0 rows.
If I open a web browser and visit "mysite.org/cron.php" I get a Drupal page saying "access denied".
Daniel.
There could be a corrupt file on the server. You could re-upload all files and folders, except the site folder, with the most current version of Drupal. If that does not work, try turning off all of your modules, run cron. If cron works there, start bringing the modules back on line one at a time, running cron in between each. When the problem comes back, that should be the module that is giving you the problem. You can re upload that module or find a different one to do the same thing.
Good Luck.
On Thu, Dec 31, 2009 at 3:35 PM, Daniel Carrera < daniel.carrera@theingots.org> wrote:
Correction: I took a database backup from yesterday and I ran the same query and on that database you still don't see any cache_page entries with '%cron%'.
I have no idea why running "php cron.php" doesn't give any output now.
Daniel.
Daniel Carrera wrote:
Greg Knaddison wrote:
On Thu, Dec 31, 2009 at 12:02 AM, Daniel Carrera daniel.carrera@theingots.org wrote:
Looks ok to me. Note that when I run "php cron.php" the program *does* run. It starts Drupal and generates HTML showing my Drupal site and everything. But the page content is "Access denied". :-(
I suggest you open up a database connection and look in the cache_page table for any entries with a cid like '%cron.php'.
I think you might be on the right track here. Earlier today I cleared the cache for an unrelated reason, and now when I run "php cron.php" I don't see any output, so something has clearly changed.
Now, unfortunately, it still doesn't seem to have worked. When I go to "status report" it still says that cron hasn't run in ages, and when I go to admin/reports/status/run-cron I still get the access denied error.
As of now, the query "SELECT * FROM cache_page WHERE cid LIKE '%cron%'" returns 0 rows.
If I open a web browser and visit "mysite.org/cron.php" I get a Drupal page saying "access denied".
Daniel.
-- [ Drupal support list | http://lists.drupal.org/ ]
On Thu, Dec 31, 2009 at 1:35 PM, Daniel Carrera daniel.carrera@theingots.org wrote:
Correction: I took a database backup from yesterday and I ran the same query and on that database you still don't see any cache_page entries with '%cron%'.
I have no idea why running "php cron.php" doesn't give any output now.
Weird. The other common source of this problem is the cron_semaphore which can get stuck in a weird state.
I suggest looking at your recent log entries admin/reports/dblog and also browsing around looking at information related to cron_sempahor: http://www.google.com/search?q=cron_semaphore
Regards, Greg
I made a while ago a handbook page with the several solutions Im using to solve cron problems, see www.drupal.org/node/553430. Try those and please add or correct if there is one missing.
Hans www.koba.be
2009/12/31, Greg Knaddison Greg@growingventuresolutions.com:
On Thu, Dec 31, 2009 at 1:35 PM, Daniel Carrera daniel.carrera@theingots.org wrote:
Correction: I took a database backup from yesterday and I ran the same query and on that database you still don't see any cache_page entries with '%cron%'.
I have no idea why running "php cron.php" doesn't give any output now.
Weird. The other common source of this problem is the cron_semaphore which can get stuck in a weird state.
I suggest looking at your recent log entries admin/reports/dblog and also browsing around looking at information related to cron_sempahor: http://www.google.com/search?q=cron_semaphore
Regards, Greg
-- Greg Knaddison | 303-800-5623 | http://growingventuresolutions.com Mastering Drupal - http://www.masteringdrupal.com -- [ Drupal support list | http://lists.drupal.org/ ]
I've tried almost all of these suggestions but nothing has worked yet. The only one I haven't tried yet is turning off modules. I need to make a backup site to test this, but I'm having trouble.
Can anyone help me make a backup site? I made a copy of the database and I have a new Drupal site pointing to it, and it basically works. The problem is that all links point URL.
If my live site is http://example.org/community
And my backup is http://example.org/backup
When you go to the backup site, all the links generated by Drupal still say 'http://example.org/community/<something>'.
Any ideas?
Thanks, Daniel.
KOBA | Hans Rossel wrote:
I made a while ago a handbook page with the several solutions Im using to solve cron problems, see www.drupal.org/node/553430. Try those and please add or correct if there is one missing.
Hans www.koba.be
2009/12/31, Greg Knaddison Greg@growingventuresolutions.com:
On Thu, Dec 31, 2009 at 1:35 PM, Daniel Carrera daniel.carrera@theingots.org wrote:
Correction: I took a database backup from yesterday and I ran the same query and on that database you still don't see any cache_page entries with '%cron%'.
I have no idea why running "php cron.php" doesn't give any output now.
Weird. The other common source of this problem is the cron_semaphore which can get stuck in a weird state.
I suggest looking at your recent log entries admin/reports/dblog and also browsing around looking at information related to cron_sempahor: http://www.google.com/search?q=cron_semaphore
Regards, Greg
-- Greg Knaddison | 303-800-5623 | http://growingventuresolutions.com Mastering Drupal - http://www.masteringdrupal.com -- [ Drupal support list | http://lists.drupal.org/ ]
On Jan 3, 2010, at 1:49 PM, Daniel Carrera wrote:
I've tried almost all of these suggestions but nothing has worked yet. KOBA | Hans Rossel wrote:
I made a while ago a handbook page with the several solutions Im using to solve cron problems, see www.drupal.org/node/553430. Try those and please add or correct if there is one missing.
Hi, Dan,
Did you try the suggestions at the above page (http://drupal.org/node/553430) ?
-D
Domenic Santangelo wrote:
Hi, Dan,
Did you try the suggestions at the above page (http://drupal.org/node/553430) ?
All except the last one about turning off modules. For that, I need to make a backup site (I can't turn off modules nilly willy on the live site). I just wrote to the list asking for help with that. This is what I said:
Can anyone help me make a backup site? I made a copy of the database and I have a new Drupal site pointing to it, and it basically works. The problem is that all links point URL.
If my live site is http://example.org/community
And my backup is http://example.org/backup
When you go to the backup site, all the links generated by Drupal still say 'http://example.org/community/<something>'.
Any ideas?
Thanks. Daniel.
On Jan 3, 2010, at 2:05 PM, Daniel Carrera wrote:
Domenic Santangelo wrote:
Hi, Dan,
Did you try the suggestions at the above page (http://drupal.org/node/553430) ?
If my live site is http://example.org/community
And my backup is http://example.org/backup
When you go to the backup site, all the links generated by Drupal still say 'http://example.org/community/<something>'.
Any ideas?
settings.php -- modify $base_url. Documentation is inline there in settings.php
Hope this helps, -D
If there is no $base_url set clear cache (/admin/settings/performance) should be enough.
Hans
Did you try the suggestions at the above page (
http://drupal.org/node/553430) ?
If my live site is http://example.org/community
And my backup is http://example.org/backup
When you go to the backup site, all the links generated by Drupal still say 'http://example.org/community/<something>'.
Any ideas?
settings.php -- modify $base_url. Documentation is inline there in settings.php
Hope this helps,
-D
[ Drupal support list | http://lists.drupal.org/ ]
There was no $base_url set, but setting it did not fix the links. I tried clearing the cache but that didn't help, but then again, maybe it was giving me the cached page from the usual site. How do I clear the cache manually? Is it save to just write "DELETE * FROM <...>" for every cache_* table?
Daniel.
KOBA | Hans Rossel wrote:
If there is no $base_url set clear cache (/admin/settings/performance) should be enough.
Hans
>> >> Did you try the suggestions at the above page (http://drupal.org/node/553430) ? > > If my live site is http://example.org/community > > And my backup is http://example.org/backup > > When you go to the backup site, all the links generated by Drupal still > say 'http://example.org/community/<something>'. > > Any ideas? settings.php -- modify $base_url. Documentation is inline there in settings.php Hope this helps, -D -- [ Drupal support list | http://lists.drupal.org/ ]-- Hans Rossel KOBA Webdesign bvba Beukenlaan 56 9051 Gent (Sint-Denijs-Westrem) Belgium BTW 0817.931.516 +32.9.334.52.60 +32.472.79.32.16 www.koba.be http://www.koba.be info@koba.be mailto:info@koba.be
On Jan 3, 2010, at 2:48 PM, Daniel Carrera wrote:
There was no $base_url set, but setting it did not fix the links. I tried clearing the cache but that didn't help, but then again, maybe it was giving me the cached page from the usual site. How do I clear the cache manually? Is it save to just write "DELETE * FROM <...>" for every cache_* table?
Check the url_alias table -- are the aliases set to the production path?
-D
Domenic Santangelo wrote:
On Jan 3, 2010, at 2:48 PM, Daniel Carrera wrote:
There was no $base_url set, but setting it did not fix the links. I tried clearing the cache but that didn't help, but then again, maybe it was giving me the cached page from the usual site. How do I clear the cache manually? Is it save to just write "DELETE * FROM <...>" for every cache_* table?
Check the url_alias table -- are the aliases set to the production path?
Grr... The problem is deeper than I thought. I did the following test:
1. Edit a page on the live site: example.org/live/foo 2. Visit the page on the backup: example.org/backup/foo 3. The two pages are the same... WTF??
My first thought is that settings.php in the backup is still pointing to the live database... nope. So I figure that it must be the browser cache.
<insert rant about Firefox moving the cache settings AGAIN and wasting 20 minutes trying to find them>
So I finally clear the Firefox cache and visit example.org/backup/foo and guess what I find? A blank page. No error, nothing. Looks as if PHP just dies. As for WHY the browser kept showing me pages from a different URL, I have no idea.
<daniel kicks his computer>
I'm really tempted to throw my computer out the window.
Daniel.
You could check in the php error log on the server what the error is, but if you get a white page it might just be that you don't have a good copy of your database. I'm not sure how you imported your database but phpmyadmin is not so good at that. You could use bigdump or an alternative approach using backup_migrate module.
1. Install backup_migrate on the live site, take a backup with it 2. Copy all files to the test site 3. Replace on test settings.php with a new fresh copy from default.settings.php and do a new fresh install of Drupal 4. Enable on the fresh install the backup migrate module and restore the backup
As for the cache, you can truncate all tables starting with cache_ in the database or use the function http://api.drupal.org/api/function/cache_clear_all/6
Hans www.koba.be
2010/1/4 Daniel Carrera daniel.carrera@theingots.org
Domenic Santangelo wrote:
On Jan 3, 2010, at 2:48 PM, Daniel Carrera wrote:
There was no $base_url set, but setting it did not fix the links. I tried clearing the cache but that didn't help, but then again, maybe it was giving me the cached page from the usual site. How do I clear the cache manually? Is it save to just write "DELETE * FROM <...>" for every cache_* table?
<daniel kicks his computer>
I'm really tempted to throw my computer out the window.
Daniel.
[ Drupal support list | http://lists.drupal.org/ ]