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 CiviReport (Moderator: Dave Greenberg) »
  • Error on cron for CiviReportMail.php
Pages: [1]

Author Topic: Error on cron for CiviReportMail.php  (Read 2621 times)

NullSmurf

  • Guest
Error on cron for CiviReportMail.php
December 22, 2009, 01:46:13 pm
When invoking CiviReportMail.php by browser, I get the following:

Sorry. A non-recoverable error has occurred.
Could not find valid value for sendmail
Return to home page.

From the file, it appears to be failing here, line 35:

Code: [Select]
$sendmail     = CRM_Utils_Request::retrieve( 'sendmail', 'Boolean', CRM_Core_DAO::$_nullObject, true );
Wish I were better with php.  TIA

Bruce

Sunil

  • I post frequently
  • ***
  • Posts: 131
  • Karma: 23
  • The community around a product more important than the product itself?
    • CiviCRM
Re: Error on cron for CiviReportMail.php
December 22, 2009, 10:42:47 pm
Hi,

For CiviReportMail.php
Correct Parameters are
sendmail   = true
instanceId = 3 (e.g.)
reset          = 1

so URL should be like :
http://domain/sites/all/modules/civicrm/bin/CiviReportMail.php?sendmail=true&instanceId=3&reset=1
( i ignored authentication here )

In your case there might be
i. Typo in sendmail
OR
ii. sendmail parameter is not present.

I get same error in both cases.

sunil

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

NullSmurf

  • Guest
Re: Error on cron for CiviReportMail.php
December 23, 2009, 09:18:38 am
That worked beautifully, Sunil.  Thank you, sir!

bdanza

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 3
  • CiviCRM version: 3.4.6
  • CMS version: Joomla 1.5, Drupal 6.2x
Re: Error on cron for CiviReportMail.php
August 10, 2010, 09:48:33 am
Hey guys, I am having the same problem

I have tried using:
/administrator/components/com_civicrm/civicrm/bin/CiviReportMail.php?instanceId=25&reset=1&sendmail=true
/administrator/components/com_civicrm/civicrm/bin/CiviReportMail.php?instanceId=25&reset=1&sendmail=1

but I still get:

Sorry. A non-recoverable error has occurred.
Could not find valid value for sendmail

naseem_sarwar

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: civivrm version 4
  • CMS version: drupal 7
  • MySQL version: mysql 5+
  • PHP version: php version 5+
Re: Error on cron for CiviReportMail.php
January 09, 2012, 07:51:57 am
I am getting the same issue.

Sorry. A non-recoverable error has occurred.
Could not find valid value for sendmail.

and if run that script via the shell script. if gives me that error.
ERROR: You need to send a valid user name and password to execute this file

To give you some information of my complicated system is that. site it built and running on vm unbunto box on a windows server. but i am using SMTP services from the windows server. there is not SMTP server on VM.

So i dont know that might be the reason. but looks like there is problem with code.
i have backtrace the issue values too. and they are here too.

backTrace

/var/www/cisdfc/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 296
/var/www/cisdfc/sites/all/modules/civicrm/bin/CiviReportMail.php, retrieve, 73
/var/www/cisdfc/sites/all/modules/civicrm/bin/CiviReportMail.php, processReport, 60
/var/www/sdfcic/sites/all/modules/civicrm/bin/CiviReportMail.php, run, 108
« Last Edit: January 10, 2012, 02:05:49 am by naseem_sarwar »

fen

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 13
    • CivicActions
  • CiviCRM version: 3.3-4.3
  • CMS version: Drupal 6/7
  • MySQL version: 5.1/5.5
  • PHP version: 5.3/5.4
Re: Error on cron for CiviReportMail.php
January 09, 2012, 08:05:44 am
Quote from: naseem_sarwar on January 09, 2012, 07:51:57 am
and if run that script via the shell script. if gives me that error.
ERROR: You need to send a valid user name and password to execute this file

Are you including name=NAME and pass=PASSWORD in the shell script?  See http://wiki.civicrm.org/confluence/display/CRMDOC40/Command-line+Script+Configuration for more details.

Sorry, I can't help you with IIS debugging.

naseem_sarwar

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: civivrm version 4
  • CMS version: drupal 7
  • MySQL version: mysql 5+
  • PHP version: php version 5+
Re: Error on cron for CiviReportMail.php
January 09, 2012, 08:46:40 am
Yeah i am putting the all the information name, pass. although i am putting this.

$PHP $CIVI_ROOT/bin/CiviReportMail.php  -sdefault -uuser -ppassword
but on the shell script its giving error of ERROR: You need to send a valid user name and password to execute this file

but if i use.
http://sitename/sites/all/modules/civicrm/bin/CiviReportMail?name=user&pass=password&key=key
then is gived this error.
Sorry. A non-recoverable error has occurred.
Could not find valid value for sendmail

I have done all the debugging. but i think someone who know the system well. they know better about it.

Dlobo: gave me that code for manual running and its working for me.
http://sitename/sites/all/modules/civicrm/bin/CiviReportMail.php?name=user&pass=password&reset=1&sendmail=0&instanceId=4&key=8cb4dfgdfgdfg920e3dcf0bd64a1e
« Last Edit: January 09, 2012, 09:21:43 am by naseem_sarwar »

naseem_sarwar

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: civivrm version 4
  • CMS version: drupal 7
  • MySQL version: mysql 5+
  • PHP version: php version 5+
Re: Error on cron for CiviReportMail.php
January 10, 2012, 01:38:15 am
Hi guys,

from the shell i am still getting this error.

$PHP $CIVI_ROOT/bin/CiviReportMail.php -sdefault -uUser -pPassword

ERROR: You need to send a valid user name and password to execute this file

I dont know where the issue is. or this file wont run from script or something. But i have run via the url option. but i am sending the same values here too. but not working.
In code ther is nothing i can see problem.

thanks
Naseem

naseem_sarwar

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: civivrm version 4
  • CMS version: drupal 7
  • MySQL version: mysql 5+
  • PHP version: php version 5+
Re: Error on cron for CiviReportMail.php
January 12, 2012, 07:03:53 am
Hi guys,

luckily i have setup all the reminders, mailings and reports mails. here i am giving you the steps i have done. my system is quite complicated that's why i have done some extra steps to make it happen. although it was quite difficult for me to play with this new system and also learning linux at the same time. But anyway here is the code.

Changes to files civimail.cronjob.php, EmailProcessor.php,action.cronjob.php and CiviReportMail.php

first issue is with CLI.
Code: [Select]
function run( ) {
    session_start( );                               
                                           
    if (! function_exists( 'drush_get_context' ) ) {
        require_once '/var/www/'sitename'/sites/all/modules/civicrm/civicrm.config.php'; // this was not working for me. ('../civicrm.config.php')
    }

    require_once 'CRM/Core/Config.php';
    $config =& CRM_Core_Config::singleton();

    // this does not return on failure
    CRM_Utils_System::authenticateScript( true );

    // we now use DB locks on a per job basis
    processQueue( $config );
}

// you can run this program either from an apache command, or from the cli
if ( php_sapi_name() == "cli" ) {
  require_once ("cli.php");  //remove the "bin/"
  $cli=new civicrm_cli ();

  //if it doesn't die, it's authenticated
  require_once 'CRM/Core/Config.php';
  $config =& CRM_Core_Config::singleton();

  processQueue( $config );

} else  { //from the webserver
  run( );
}



so i removed the 'bin'. because it is already in the path in crontabs.

changes to bin/Cli.php

if (! function_exists( 'civicrm_conf_init' ) ) {
            //naseem ./
         
         require_once ("/var/www/sitename/sites/all/modules/civicrm/civicrm.config.php"); // some how ("../civicrm.config.php") was not working for me. so i add full path
        }
then you need to add that patch to this file. http://issues.civicrm.org/jira/browse/CRM-8918

then there is some deprecation issue with civicrm/packages/pear.php file. it is not working with current system. must be a bug or need to made some changes. i made that file pear.php.bak. so i am not using it. in your case i think someone experience ll let you know.

i think that ll do the job.

but there is one problem with CiviReportMail.php. it doesn't run with Cli. so for this you need to run via the url and need to send parameters.  for this you can use
wget method and the whole url which is working fine form you.
wget 'http://sitename/sites/all/modules/civicrm/bin/CiviReportMail.php?name=user&pass=password&reset=1&sendmail=0&instanceId=4&key=8cb4dfgdfgdfg920e3dcf0bd64a1e'

Where instanceId is your report id. only problem is this you it ll save as a file. so you can remove these files with this code. rm *Civi*.

I hope that ll help.


 
« Last Edit: January 12, 2012, 07:07:07 am by naseem_sarwar »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Error on cron for CiviReportMail.php

This forum was archived on 2017-11-26.