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 »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Civimail Cron Error: Invalid username and/or password
Pages: [1] 2 3

Author Topic: Civimail Cron Error: Invalid username and/or password  (Read 8452 times)

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Civimail Cron Error: Invalid username and/or password
September 01, 2010, 11:02:37 am
Hi All,

Here's my situation. I'm running CiviCRM v3.2.2 on Drupal on a 1and1 host to which I have ssh access. I have a site_key configured and cronjobs set up for civimail.cronjob.php and CiviMailProcessor.php. Cron was working perfectly for months until I recently updated to v3.2.2 and now I get strange errors when attempting to run either of the php scripts above.

My cron commands are set up to run as follows:
*/10    *       *       *       *       wget -O - -q -t 1 --post-data='name=USER&pass=PASS&key=SITE_KEY' http://www.atyourpalate.com/drupal-6.6/sites/all/modules/civicrm/bin/civimail.cronjob.php
*/15    *       *       *       *       wget -O - -q -t 1 --post-data='name=USER&pass=PASS&key=SITE_KEY' http://www.atyourpalate.com/drupal-6.6/sites/all/modules/civicrm/bin/CiviMailProcessor.php

When attempting to do this from shell or from a browser (http://www.atyourpalate.com/drupal-6.6/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=USER&pass=PASS&key=SITE_KEY) I get the following result:
ERROR: Invalid username and/or password

I've tried creating a new drupal user, synced to a civicrm contact record, and even generated a new site key and resulted in the same error.

I am able to successfully log in to the drupal account with the new username and password. I am at a loss as to how to fix this. PLEASE! ANYONE! HELP!!!

bdanza

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 3
  • CiviCRM version: 3.4.6
  • CMS version: Joomla 1.5, Drupal 6.2x
Re: Civimail Cron Error: Invalid username and/or password
September 03, 2010, 07:51:53 am
Are you using the ' marks when you use the cron code?

this is how mine looks...

Code: [Select]
*      *      *      *      *       wget -O - -q -t 1 --post-data='name=name&pass=pword&key=key1234' http://www.example.org/administrator/components/com_civicrm/civicrm/bin/civimail.cronjob.php

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 03, 2010, 08:00:13 am
Yes, I pasted the exact content of my crontab. I am indeed using the single-quote (') around the post-data information.

Even if I were to rework the wget command to look like this:

Code: [Select]
wget -O - -q -t 1 'http://www.atyourpalate.com/drupal-6.6/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=USER&pass=PASS&key=SITE_KEY'
It still results in the following message:
ERROR: Invalid username and/or password

Any ideas?!

bdanza

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 3
  • CiviCRM version: 3.4.6
  • CMS version: Joomla 1.5, Drupal 6.2x
Re: Civimail Cron Error: Invalid username and/or password
September 03, 2010, 08:12:56 am
the one you just reposted is missing the quote after the name= ,

All I can think of besides that is that the user you created does not have access to civimail in your drupal user permissions.

there should be a user group in admin/user/permissions that can access the CiviMAIL function, and the user you created for this should be given that permission level.

B.

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 03, 2010, 08:18:39 am
Is this a new ACL that needs to be configured from previous versions? Where can I find these settings?

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civimail Cron Error: Invalid username and/or password
September 10, 2010, 04:52:05 am
No, it shouldn’t be a new ACL.

Did it work at all in any CiviCRM 3.2 version, or only in CiviCRM 3.1?

(Of course make sure any special characters in name, pass and key are URL-escaped.)
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 10, 2010, 09:17:16 am
It used to work in CiviCRM 3.1 just fine. The username has access to all the civicrm module items. No special characters in the key or password either. It's all alphanumeric. I even updated my drupal installation and that didn't seem to work either.

Any ideas? At this point, I'm thinking of doing a fresh install and migrating the DB.....

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Civimail Cron Error: Invalid username and/or password
September 13, 2010, 06:03:45 am
Can you try adding the ‘edit all contacts’ permission? This was just reported: http://forum.civicrm.org/?topic=15472.msg66839#msg66839

Also, do check whether you can actually login (by hand) with the credentials passed to wget.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 13, 2010, 06:42:40 am
Quote from: Piotr Szotkowski on September 13, 2010, 06:03:45 am
Can you try adding the ‘edit all contacts’ permission? This was just reported: http://forum.civicrm.org/?topic=15472.msg66839#msg66839

The original username and password I was using had ALL permissions, including Access CiviCRM, Access CiviMail and Edit All Contacts. I created a new user with a new role called CiviCron which ONLY has permissions for Access CiviCRM, Access CiviMail and Edit All contacts.

Quote from: Piotr Szotkowski on September 13, 2010, 06:03:45 am
Also, do check whether you can actually login (by hand) with the credentials passed to wget.

I was successfully able to login with the new user credentials manually, however, when running wget on the command-line, I get the same error as before. So...no luck....weird.....


xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Civimail Cron Error: Invalid username and/or password
September 13, 2010, 06:48:13 am
Quote from: shayaknyc on September 13, 2010, 06:42:40 am

I was successfully able to login with the new user credentials manually, however, when running wget on the command-line, I get the same error as before. So...no luck....weird.....


Stab in the dark, as you seem to have shell access with php-cli:
cd civicrm root;
php5 bin/civimail.cronjob.php -u user -p password -s yoursite.org

What does it says?

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

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 13, 2010, 07:00:10 am
Quote from: xavier on September 13, 2010, 06:48:13 am

Stab in the dark, as you seem to have shell access with php-cli:
cd civicrm root;
php5 bin/civimail.cronjob.php -u user -p password -s yoursite.org

What does it says?

X+

Ok....this is interesting...this is the error I got:

Code: [Select]
X-Powered-By: PHP/5.2.14
Content-type: text/html

<br />
<b>Warning</b>:  require_once(bin/cli.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>/homepages/29/d100263672/htdocs/wsb3626572001/drupal-6.6/sites/all/modules/civicrm/bin/civimail.cronjob.php</b> on line <b>67</b><br />
<br />
<b>Fatal error</b>:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'bin/cli.php' (include_path='.:/usr/lib/php5') in <b>/homepages/29/d100263672/htdocs/wsb3626572001/drupal-6.6/sites/all/modules/civicrm/bin/civimail.cronjob.php</b> on line <b>67</b><br />

Hoping this means I'm on the road to debugging...... :D

--S

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 13, 2010, 07:35:47 am
So, I checked line 67 in civimail.cronjob.php and it's looking for cli.php which is in the same ../civicrm/bin directory. Why can't it open it? I even tried modifying the permissions on it. It's currently set for 644. I tried 664 and 666 each while running the php5 command and it resulted in the same error.

Weird!!!

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 13, 2010, 07:44:58 am
Ok...some more weirdness....I looked at line 67 again in civimail.cronjob.php and noticed that it's looking for bin/cli.php even though cli.php is in the same directory as civimail.cronjob.php. So, I removed the "bin/" prefix so that it just pointed to cli.php and then I got a NEW error on line 97 in cli.php which is in the middle of the following function:
Code: [Select]
function setEnv() {
// so the configuration works with php-cli
$_SERVER['PHP_SELF' ] ="/index.php";
$_SERVER['HTTP_HOST']= $this->site;
require_once ("./civicrm.config.php");
          $this->key= CIVICRM_SITE_KEY;
$_REQUEST['key']= $this->key;
    }
Line 97 is where it says require_once ("./civicrm.config.php"); However, I don't think there IS a civicrm.config.php. I do have a civicrm.settings.php in my ../sites/default directory though which includes the site key.....

Any ideas?

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 13, 2010, 07:55:18 am
LOL Ok...so there IS a civicrm.config.php in the civicrm module directory...however, I had it point directly to the absolute path for civicrm.settings.php just to see what would happen and I got the following error....

Code: [Select]
X-Powered-By: PHP/5.2.14
Set-Cookie: PHPSESSID=cbc5d83b499b5e0224a512e42368378d; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html

<br />
<b>Fatal error</b>:  Cannot redeclare _pear_call_destructors() (previously declared in /usr/lib/php5/PEAR.php:735) in <b>/homepages/29/d100263672/htdocs/wsb3626572001/drupal-6.6/sites/all/modules/civicrm/packages/PEAR.php</b> on line <b>811</b><br />


Any ideas? Can this be related?

shayaknyc

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 0
Re: Civimail Cron Error: Invalid username and/or password
September 13, 2010, 08:38:01 am
Just upgraded to CiviCRM v3.2.3 from v3.2.2 and it still gives me the same "ERROR: Invalid Username and/or password"

*sigh*

--S

Pages: [1] 2 3
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Civimail Cron Error: Invalid username and/or password

This forum was archived on 2017-11-26.