I'm currently using MODx 2.2.6-pl for a club website and I've installed Cron Manager 1.1.0-pl through the Package Manager. When I try to run cron.php (part of Cron Manager), it fails with a "Status: 401 Not Authorized" error.
I've spotted a similar type of post in the forums but when I modified Cron Manager as recommended, I got a "500" failure. I reverted to the original cron.php and now I'm back to the 401 error.
I'm stumped. Does anybody have any thoughts on getting around the 401 error?
Thanks a million,
M
-
☆ A M B ☆
- 756 Posts
Have you double checked the permissions for the e file and folder? when you get the error how are you trying to load the from.php file (browser, from tab)?
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.
Thanks for your help.
Yes, I've checked the file and directory permissions and they are fine.
It also works perfectly if I embed the snippet in a page.
I'm on shared hosting and the cp allows me to check and see what cron makes of the command line. That's how I can see the 401 error.
Michaelc
Apologies, I should have stated clearly that the 401 error is coming from cron when I try to execute the cron.pup script from from.
M
-
☆ A M B ☆
- 756 Posts
You might try to load it via a browser to see if that works, create a new cron tab entry to test.
/usr/bin/wget -q -O /dev/null/ http://yourdomain.com/path/to/cron.php
*Note: the "-O /dev/null" above suppresses the response, remove to see any output from the execution of the file.
Also make sure that cron is running with the proper user account. If you set this via a hosting provider control panel by default it is ran by that user as that is the user account typically that the CP is setting the tab entries in. if you have ssh access you can verify directly.
let me know if that method works and what you find out about the cron tab user.
cheers
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.
I don't have SSH access. I've never needed it and I've been trying to avoid it. I can request it if necessary.
I've made some progress on the problem though...
If I try to run the Cron Manager cron.php from a browser with a normal www. web address, it works perfectly.
If I try to run it from a browser without the www. then it fails with the same 401 error as trying to run it directly from Cron.
It looks to me that the problem relates to HTTP_MODAUTH so I'm following up that angle at the moment.
Thanks so much for the help and suggestions,
Michael
Ok, got it! Easiest solution for me was to turn off authorization by adding the line:
define('MODX_REQP',false);
at the top of:
/assets/components/cronmanager/cron.php
Posting the solution in the hope that it will help anybody else who may have this issue.
Thanks for your help charless. it really was very much appreciated.
M
-
☆ A M B ☆
- 756 Posts
darn www and non-www urls, glad you were able to get it sorted out.
Cheers
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.
Hello,
I'm struggling with Cron manager as well. The errors that I get are as follow:
PHP Notice: Trying to get property of non-object in /var/www/vhosts/..../core/model/modx/modparser.class.php on line 464.
I'm running revo 2.2.6, PHP Version 5.3.3
Do You have any ideas what can be the problem?
-
☆ A M B ☆
- 756 Posts
Then that usually indicates that somewhere the xPDO results collection is call the $mycollection->get('field') on an unset field or $mycollection. The other thing is this is a "PHP Notice" which usually indicates that this is not breaking the code and parsing is continuing past that point. Do you have any other errors after or before that one that list the /components/cronmanager/ folder specifically?
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.