SOLVED Cron user must now be a superuser; Send not happening

Questions & Problems about Installing or Upgrading with Version 3 phpList.
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation.

SOLVED Cron user must now be a superuser; Send not happening

Postby ianellis » 10:58pm, Fri 16 Aug, 2013

<Editted to a brief summary now solution is known - read last entry in thread>

I found cron needs a different command to run in 3.0 than was previously working in 2.x when on a server running php-cgi (the only option on a shared server.)

Symptom:
Cron was returning an emailed error report "access denied."
Promoted the cron user to a superuser.
The report then gave: "Processing queued campaigns." but didn't send
Last edited by ianellis on 4:41am, Mon 19 Aug, 2013, edited 2 times in total.
ianellis
phpList newbie
 
Posts: 4
Joined: 6:07pm, Fri 16 Aug, 2013

Re: Cron user must now be a superuser; Send not happening

Postby duncanc » 10:40am, Sat 17 Aug, 2013

Does the cron job run php-cli or php-cgi?

I think that the way processqueue works has been redesigned and now using php-cgi in a cron job now doesn't work. If that is the case then use php cli for the cron job.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Cron user must now be a superuser; Send not happening

Postby ianellis » 2:30pm, Sat 17 Aug, 2013

<editted for brevity>

Fear not. There remains a pathway through the new script that accommodates also cgi version of php. See end of thread.

My ISP was firm about no use of cli php for reason of security of other users on the server. However, no problem, cgi version will work.
Last edited by ianellis on 4:18am, Mon 19 Aug, 2013, edited 1 time in total.
ianellis
phpList newbie
 
Posts: 4
Joined: 6:07pm, Fri 16 Aug, 2013

Re: Cron user must now be a superuser; Send not happening

Postby duncanc » 11:39am, Sun 18 Aug, 2013

php cgi can be used in a cron job, but the problem is that the code in processqueue has been redesigned so that it relies on javascript being executed by the browser.

Presumably your current cron command is something like
Code: Select all
php /xxxx/lists/admin/index.php page=processqueue login=yyyy password=xxxx

Looking at the phplist code, this command might avoid the use of javascript
Code: Select all
php /xxxx/lists/admin/index.php page=pageaction action=processqueue ajaxed=false login=yyyy password=xxxx


If you can use php cli then that uses a different path in the code that does not use javascript.
Despite what your hosting company says, try some of these in a cron job to see if you do have access to php cli. These will create a file in your home directory. If one works then it will show details of the php version.

Code: Select all
php-cli -v >~/phpver.txt
php5 -v >~/phpver.txt
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Cron user must now be a superuser; Send not happening

Postby ianellis » 2:16pm, Sun 18 Aug, 2013

<editted for brevity>

That's almost the answer. But remove reference to the ajaxed argument. It merely needs to be empty. "false" is never tested in the script, only empty.
Last edited by ianellis on 4:20am, Mon 19 Aug, 2013, edited 1 time in total.
ianellis
phpList newbie
 
Posts: 4
Joined: 6:07pm, Fri 16 Aug, 2013

Re: Cron user must now be a superuser; Send not happening

Postby duncanc » 4:14pm, Sun 18 Aug, 2013

I managed to process the message queue by removing ajaxed=false from the command. So

Code: Select all
php /xxxx/lists/admin/index.php page=pageaction action=processqueue  login=yyyy password=xxxx

I am guessing that this will behave as processqueue used to, so it will send only "batch size" emails then exit. When the cron job next runs then the next batch will be sent.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: Cron user must now be a superuser; Send not happening

Postby ianellis » 4:36am, Mon 19 Aug, 2013

Yes! That's it. I reached that conclusion independently by reading the relevant parts of the scripts.

The bottom line for the next poor smuck that finds cron quit in 3.0, here's the holy grail: new syntax as above:

If 2.x worked with cron setup using
.../admin/index.php page=processqueue login=yyyy password=xxxx

then 3.0 will work now using
.../admin/index.php page=pageaction action=processqueue login=yyyy password=xxxx

Reason: the new concept of the processqueue script has been split between two directories. Most of it is now in a new "action" directory.

I've successfully made a test run. Messages delivered properly to my monitoring email addresses. To deal with stalling, I fire the cron every 15 minutes, but may reduce that to 10, or tweak a setting in the config.php
ianellis
phpList newbie
 
Posts: 4
Joined: 6:07pm, Fri 16 Aug, 2013

Re: SOLVED Cron user must now be a superuser; Send not happe

Postby jeffschips » 5:25pm, Wed 21 Aug, 2013

Okay really frustrated.

In php < 3.0 was able to use:

/usr/local/bin/php /home/mydo/public_html/lists/admin/index.php -p processqueue > /dev/null 2>&1

Now that does not work nor do the recommendations listed here. I never had to use a login/password combination. I believe on some shared hosting accounts the password/login names are visible from other accounts. Nevertheless, when I attempt to use the login/password method, still no go.

I'm pulling out my hair and customer is requesting emails go out pronto!

Help
jeffschips
phpLister
 
Posts: 13
Joined: 11:01pm, Mon 04 Jun, 2012

Re: SOLVED Cron user must now be a superuser; Send not happe

Postby duncanc » 5:49pm, Wed 21 Aug, 2013

You are using php-cli, so the original problem and solution are not relevant.

What error message are you getting? If none then change your command to capture the output instead of discarding it.
Code: Select all
/usr/local/bin/php /home/mydo/public_html/lists/admin/index.php -p processqueue >~/processqueue.log 2>&1

The output will go to a file processqueue.log in your home directory, /home/mydo
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: SOLVED Cron user must now be a superuser; Send not happe

Postby jeffschips » 6:02pm, Wed 21 Aug, 2013

Thank you!

There is only one sentence in the log file:

cannot find config file


That's it.
jeffschips
phpLister
 
Posts: 13
Joined: 11:01pm, Mon 04 Jun, 2012

Re: SOLVED Cron user must now be a superuser; Send not happe

Postby duncanc » 7:58pm, Wed 21 Aug, 2013

It appears that in phplist 3 you need to specify the location of the config file in the command.
So if the config file is in the default location then your command should be:
Code: Select all
/usr/local/bin/php /home/mydo/public_html/lists/admin/index.php -p processqueue -c /home/mydo/public_html/lists/config/config.php >~/processqueue.log 2>&1
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: SOLVED Cron user must now be a superuser; Send not happe

Postby jeffschips » 8:12pm, Wed 21 Aug, 2013

Bingo!

Success!

Thanks for your help it might be useful for a moderator to suggest that tiny fact (that a path to config file is required to be included in cron job commands) in the documentation.

thanks again!
jeffschips
phpLister
 
Posts: 13
Joined: 11:01pm, Mon 04 Jun, 2012

Re: Send not happening

Postby geminorum » 5:38pm, Sun 01 Sep, 2013

Hi,

i tried lots of methods to run cron, but none of them works.

For example:

Code: Select all
/usr/local/cpanel/3rdparty/bin/php -q /home/user/public_html/phplist/admin/index.php -p processqueue -c /home/user/public_html/phplist/config/config.php>/home/user/public_html/phplist/processqueue.log 2>&1


returns nothing. The file (processqueue.log) is empty.

I also try:

Code: Select all
/usr/local/cpanel/3rdparty/bin/php -q /home/user/public_html/phplist/admin/index.php page=processqueue login=admin password=xxx>/home/user/public_html/phplist/processqueue.log


returns only one line (in processqueue.log): Cannot find config file.

Phplist version: 3.0.2
PHP version:
PHP 5.3.17 (cli) (built: Apr 12 2013 10:46:56)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.

What did I do wrong? :shock:

Thanks!
geminorum
phpLister
 
Posts: 5
Joined: 5:28pm, Sun 01 Sep, 2013

Re: SOLVED Cron user must now be a superuser; Send not happe

Postby duncanc » 6:43pm, Sun 01 Sep, 2013

Which command did you run to get the php version details?
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: SOLVED Cron user must now be a superuser; Send not happe

Postby geminorum » 6:52pm, Sun 01 Sep, 2013

command used:
Code: Select all
/usr/local/cpanel/3rdparty/bin/php -v>/home/user/public_html/phplist/phpver.txt
geminorum
phpLister
 
Posts: 5
Joined: 5:28pm, Sun 01 Sep, 2013

Next

Return to Installing and Upgrading

Who is online

Users browsing this forum: No registered users and 1 guest