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 »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Problem running cron jobs
Pages: [1]

Author Topic: Problem running cron jobs  (Read 4287 times)

stirrell

  • Guest
Problem running cron jobs
January 28, 2009, 07:10:50 am
Hello there,

I was wondering if anyone else had run into this problem. I am having trouble with the maintenance cron jobs. An example of how I've set them up to run is:

wget http://www.domainname.com/sites/all/modules/civicrm/bin/UpdateMembershipRecord.php?name=UserName&pass=PassWord&key=key

I get a logged error from the server stating:

Quote
ERROR: You need to send a valid key to execute this file. More info at: http://wiki.civicrm.org/confluence/display/CRMDOC/Command-line+Script+Configuration.

So it looks like the key is not getting passed... if I run the command through a browser, it runs fine. Has anyone else had a similar experience?

Thanks,
Scott

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Problem running cron jobs
January 28, 2009, 07:29:27 am
if you just run that wget directly in shell (not via cron) do you still get the error?

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: Problem running cron jobs
January 30, 2009, 03:21:43 pm
Hi Scott,

I'll bet that the problem is with an unsafe character in the user name and/or password - not only is there an issue with the normal suspects
 & = + $ ? % , / : { } #
but I've seen an issue with ! as well. Set up an admin user just for scheduled crons with a secure user name and password and the problem may disappear.
--
Joe

benced

  • Guest
Re: Problem running cron jobs
February 04, 2009, 07:37:17 am
same problem here my username, password and key all contain alpha characters only

I am still running Drupal 5 and an earlier version on CiviCRM

I am hoping the problem will disappear on upgrade to Drupal 6
« Last Edit: February 04, 2009, 07:39:20 am by benced »

alfred_nutile

  • Ask me questions
  • ****
  • Posts: 464
  • Karma: 14
    • River Valley Tech Collective
Re: Problem running cron jobs
February 12, 2009, 05:53:55 am
The wget url should have \ to help with odd characters.
For example
....php?name=civimail\&pass=civimail08


I do not see that in your post?

mrengy

  • Guest
Re: Problem running cron jobs
February 17, 2009, 09:34:13 pm
I'm having a problem with the key for this as well.

I carefully followed the instructions at http://wiki.civicrm.org/confluence/display/CRMDOC/Command-line+Script+Configuration

And I edited the site key line in my civicrm.settings.php file to read:

define( 'CIVICRM_SITE_KEY', 'r0zsfYtC0PcEF\x^' );

and went to the URL: http://recycleabike.org/crm/bin/civimail.cronjob.php?key=r0zsfYtC0PcEF\x^

It still gave me the error: ERROR: You need to send a valid user name and password to execute this file.

Also, once before when I was trying a different site key, it gave a different error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mikeeng/recycleabike.org/crm/standalone/civicrm.settings.php on line 148

At which point I checked around line 148, but didn't find anything immediately obvioiusly wrong there.

Thoughts?

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Problem running cron jobs
February 17, 2009, 10:59:50 pm
hi

I think you are not giving user name and password in url.
You might want to try url like : http://recycleabike.org/crm/bin/civimail.cronjob.php?name=username&pass=password&key=r0zsfYtC0PcEF\x^

kiran
You Are Designed To Choose... Defined By Choice.

mrengy

  • Guest
Re: Problem running cron jobs
February 18, 2009, 09:41:42 am
Hmm. I don't have a username and password - I log in with an OpenID. How do I set up a username and password for this?

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Problem running cron jobs
February 19, 2009, 04:22:13 am
hi

In case of standalone installation
username = your OpenID
password = your OpenID account password.

kiran
You Are Designed To Choose... Defined By Choice.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Problem running cron jobs
February 19, 2009, 06:16:22 am

kiran's reply is not correct. i think wes morgan has fixed this in 2.2. i'll ask him to respond here

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

yasa

  • Guest
Re: Problem running cron jobs
March 13, 2009, 12:02:46 am
Quote from: stirrell on January 28, 2009, 07:10:50 am
Hello there,

I was wondering if anyone else had run into this problem. I am having trouble with the maintenance cron jobs. An example of how I've set them up to run is:

wget http://www.domainname.com/sites/all/modules/civicrm/bin/UpdateMembershipRecord.php?name=UserName&pass=PassWord&key=key

I get a logged error from the server stating:
ERROR: You need to send a valid key to execute this file. More info at: http://wiki.civicrm.org/confluence/display/CRMDOC/Command-line+Script+Configuration.

So it looks like the key is not getting passed... if I run the command through a browser, it runs fine. Has anyone else had a similar experience?

Thanks,
Scott

I have the same exact problem as Scott. What is the solution? did I missed something?I am using 2.2b4 and joomla 1.5.9

Thanks in advance,
Yasa
« Last Edit: March 13, 2009, 11:34:03 am by yasa »

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Problem running cron jobs
March 13, 2009, 12:57:28 am
Hi,

This is probably a dumb question, but I haven't see the answer in the dialogue so far, so ...

... Have you set the key in civicrm.settings.php?
... Did you put it in single-quotes like 'this' so it is parsed as a PHP string?

Ken

Sunil

  • I post frequently
  • ***
  • Posts: 131
  • Karma: 23
  • The community around a product more important than the product itself?
    • CiviCRM
Re: Problem running cron jobs
March 13, 2009, 01:03:52 am
Hi,

to run the cron job,
1. Define the Site key in civicrm.settings.php file
e.g. define( 'CIVICRM_SITE_KEY', '7c748907d69ccf9437fb9b477d13e442' );

2. for Drupal
  i. Run through a Browser
     http://www.domainname.com/sites/all/modules/civicrm/bin/UpdateMembershipRecord.php?name=username&pass=password&key=7c748907d69ccf9437fb9b477d13e442
  ii. Run through command prompt
     wget http://www.domainname.com/sites/all/modules/civicrm/bin/UpdateMembershipRecord.php?name=username\&pass=password\&key=7c748907d69ccf9437fb9b477d13e442

3. For Joomla
  i. Run through a Browser
     http://www.domainname.com/administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php?name=username&pass=password&key=7c748907d69ccf9437fb9b477d13e442
  ii. Run through command prompt
     wget http://www.domainname.com/administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php?name=username\&pass=password\&key=7c748907d69ccf9437fb9b477d13e442

Sunil
The community around a product more important than the product itself?

yasa

  • Guest
Re: Problem running cron jobs
March 13, 2009, 11:31:38 am
Thank you Sunil,

Quote from: Sunil on March 13, 2009, 01:03:52 am
  ii. Run through command prompt
     wget http://www.domainname.com/administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php?name=username\&pass=password\&key=7c748907d69ccf9437fb9b477d13e442

You made it really clear for me - thank you a bunch ;). When I run crons job in my sever i need to add "\" in front of &. Because the server run on *nix. I use cURL working like a charm. :)

Best,
Yasa

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Problem running cron jobs

This forum was archived on 2017-11-26.