CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • yet another cronjob question
Pages: [1] 2

Author Topic: yet another cronjob question  (Read 4541 times)

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
yet another cronjob question
September 28, 2011, 04:53:58 am
I have been reading the docs and a lot of posts about getting the civimail.cronjob.php to run.  Since the upgrade to 3.4.x, none of the instructions work. 

When trying the direct command line call to bin/civimail.cronjob.php as described in the manual, it dies silently and does nothing.

Here is the output from a wget command (deleting the -q option so it will not suppress any output)

Quote
$ wget -O - --post-data='name=myuser&pass=mypass&key=mykey' http://hbg-cpac.org/sites/all/modules/civicrm/bin/civimail.cronjob.php
--2011-09-28 07:30:22--  http://hbg-cpac.org/sites/all/modules/civicrm/bin/civimail.cronjob.php
Resolving hbg-cpac.org... 69.163.142.216
Connecting to hbg-cpac.org|69.163.142.216|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.hbg-cpac.org/sites/all/modules/civicrm/bin/civimail.cronjob.php [following]
--2011-09-28 07:30:22--  http://www.hbg-cpac.org/sites/all/modules/civicrm/bin/civimail.cronjob.php
Resolving www.hbg-cpac.org... 69.163.142.216
Reusing existing connection to hbg-cpac.org:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `STDOUT'

    [<=>                                    ] 0           --.-K/s              ERROR: You need to send a valid user name and password to execute this file
    [ <=>                                   ] 76          --.-K/s   in 0s     

2011-09-28 07:30:23 (1.83 MB/s) - written to stdout [76]

The complaint about a valid user name and password happens no matter what user name I give it, including an administrator account with access to everything.  Prior to the upgrade, this wget command worked.

Meanwhile, I have been logging in and visiting mailing/queue&reset=1 to trigger each job manually.  Any help would be appreciated.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: yet another cronjob question
September 28, 2011, 06:04:15 am
Quote from: robinhood on September 28, 2011, 04:53:58 am
When trying the direct command line call to bin/civimail.cronjob.php as described in the manual, it dies silently and does nothing.

Check the php-cli configuration to see if it displays errors and what's the level of error/warning/notice. By default on debian I think it dies silently (boy, oh did that cost me hours when I tried to set up a test environment)

The latest version of civi has shipped with some improvement on the civimail cron front. Might be worthwhile to update and see.


X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: yet another cronjob question
October 23, 2011, 05:21:36 pm
Ok, I have upgraded to 3.4.7 and here is what happens with wget.
Quote
HTTP request sent, awaiting response... 503 Service unavailable
2011-10-23 20:07:20 ERROR 503: Service unavailable.
The command line call to civimail.cronjob.php still dies silently.  Setting display_errors to on made no difference.

I'm really tearing my hair out over this.  We are missing deadlines because we can't make this work.  Any help appreciated!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: yet another cronjob question
October 24, 2011, 03:36:50 am
Can you get it to work via a URL in the browser?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: yet another cronjob question
October 24, 2011, 03:53:33 am
Yes, by visiting civicrm/mailing/queue?reset=1.   That is the only way to kick off the mailing ATM.


 

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: yet another cronjob question
October 24, 2011, 03:57:19 am
No I meant the cronjob URL, something like

Code: [Select]
http://site.org/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=admin&pass=zzz&key=xxx
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: yet another cronjob question
October 24, 2011, 04:27:24 am
That produces:

Page not found
The requested page could not be found.

But, interestingly enough when I mistyped the key string once, I got this:

ERROR: Invalid key value sent. More info at:http://wiki.civicrm.org/confluence/display/CRMDOC/Command-line+Script+Configuration

Which I think means that we are finding the script and it is running the key authentication.  But why does it fail when the key is correct?

Edit: in reading some of the other posts, I decided to double check civicrm.settings.php, and all seems fine.  I cleared the templates_c directory and tried wget again, and now I am back to:

HTTP request sent, awaiting response... 404 Not Found
2011-10-24 07:43:09 ERROR 404: Not Found.
« Last Edit: October 24, 2011, 04:46:44 am by robinhood »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: yet another cronjob question
October 24, 2011, 07:36:52 am
I don't follow your last post. Do you have the URL method working in the browser?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: yet another cronjob question
October 24, 2011, 03:07:56 pm
Sorry if that was not clear.  Short answer: no it does not work in the browser.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: yet another cronjob question
October 25, 2011, 02:33:23 am
So that's the first step then. If you get "ERROR: Invalid key value sent" then try changing your key to something simple just for testing purposes.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: yet another cronjob question
October 25, 2011, 05:09:43 am
Ok this is strange but I got it to work.  By poking in echo statements in various places I followed the code to the place where it was stopping.  It got to CRM/Utils/System/Drupal.php to about line 335 in this section:
Code: [Select]
        if ( $name ) {
            $user = user_authenticate(  array( 'name' => $name, 'pass' => $pass ) );
            if ( empty( $user->uid ) ) {
                echo '<br />Sorry, unrecognized username or password.';
                exit( );
            }
... and it was never returning from the call to user_authenticate().  I didn't try to follow it from there -- is that function part of drupal?  At any rate I commented out this block so it goes directly to "if ($uid)" etc. and now my mail gets delivered. 

This is obviously not a fix or even a good work around but maybe it is a clue in that direction. 

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: yet another cronjob question
October 25, 2011, 06:01:15 am
Yes, this is a core Drupal function: http://api.drupal.org/api/drupal/modules--user--user.module/function/user_authenticate/6

If it doesn't work, there is something wrong...
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Alex Sondy

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7.2
  • MySQL version: 5.0.7
  • PHP version: 5.3.5
Re: yet another cronjob question
November 06, 2011, 04:28:44 pm
Is there any solution yet? I'm as well not able to trigger mails. They're stuck on "scheduled".

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: yet another cronjob question
November 07, 2011, 03:15:52 am
Alex, is your cron job setup? Does it run? Can you post the output of it?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Alex Sondy

  • I’m new here
  • *
  • Posts: 21
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7.2
  • MySQL version: 5.0.7
  • PHP version: 5.3.5
Re: yet another cronjob question
January 05, 2012, 05:47:51 am
Quote from: robinhood on October 25, 2011, 05:09:43 am
Ok this is strange but I got it to work.  By poking in echo statements in various places I followed the code to the place where it was stopping.  It got to CRM/Utils/System/Drupal.php to about line 335 in this section:
Code: [Select]
        if ( $name ) {
            $user = user_authenticate(  array( 'name' => $name, 'pass' => $pass ) );
            if ( empty( $user->uid ) ) {
                echo '<br />Sorry, unrecognized username or password.';
                exit( );
            }

... and it was never returning from the call to user_authenticate().  I didn't try to follow it from there -- is that function part of drupal?  At any rate I commented out this block so it goes directly to "if ($uid)" etc. and now my mail gets delivered. 

This is obviously not a fix or even a good work around but maybe it is a clue in that direction.

Did you fix the problem? I experience exactly the same issue (civicrm not authenticating the CMS user).

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • yet another cronjob question

This forum was archived on 2017-11-26.