SugarCRM v5.0.0.b
on
Linux 2.6.24.4_0 Appliance distro.
(1) What is causing the cron errors:
PHP Notice: Undefined offset: 6 in /usr/share/sugarcrm/include/TimeDate.php on line 308
PHP Notice: Undefined offset: 6 in /usr/share/sugarcrm/include/TimeDate.php on line 314
(2) and omitting to send a proper email with a PDF of a Zucker report?
we have tried the various clues in
http://www.sugarcrm.com/wiki/index.p...hip_from_cache
Additional errors still occcuring that seem to be preventing cron daemon to schedule Zucker Reports to PDF/Email on our Linux server.
This is a followup to another post today that dealt with two other periphery issues that were hiding the underlying inability to produce the PDF's and EMAILS.
After some concerns with the errors going into /usr/share/sugarcrm/sugarcrm.log
names:
- FATAL SugarCRM - MySQL errir 1242:: Subquery returns more than 1 row
- FATAL SugarCRM - error fetching relationships from cache schedules_created_by
We are still left with the problem that scheduled reports are NOT being processed by cron.
A fair chunck of the above errors were rectified and reported to the sugarCRM FORUM,
by simply erasing (emptying and resetting) the contents of a tracking table called tracker
#mysql
mysql> /u sugarcrm
mysql> truncate table tracker;
mysql> quit
#
So here's the details of what elese we've tried and still have no result as of tonight.......
The SCHEDULING procedure is based on:
/etc/init.d/crond daemon running in the background
processing the contents of /etc/crontab
/etc/crontab includes an entry
* * * * * apache cd /usr/share/sugarcrm; php5 -f cron.php 2>&1
(which means run every 1 minute constantly)
/etc/cron.d/sugarcrm this seems to be an alternative location/way of running cron.php from crond
(similar to the line that is usually recommended in /etc/crontab above)
**Note: we changed to using /etc/crontab, and commented out the cron line in /etc/cron.d/sugarcrm.
/usr/share/sugarcrm/cache/modules/Schedulers/schedulersvardefs.php controls the scheduling (??)
/usr/share/sugarcrm/cache/modules/Schedulers/php.pid steps the time interval
/usr/share/sugarcrm/cron.php contains the script which processes any sugarCRM scheduled jobs.
Firefox client SugarCE session users can present a .jrxml (Jasper Report) as a Zucker Report
and then schedule that report to run every so often (hourly, 6hrly, daily, monthly) producing a PDF (or other)
and either leaving that PDF (or other) as a finished report inside one of the sugarCE session ARCHIVES
and/or sending the PDF (or other) as an attachment to an email to a designated email address.
RUN REPORT has the option
/var/log/cron shows the results of cron running every cycle
/usr/share/sugarcrm/sugarcrm.log shows any errors
OBSERVATIONS:
Reports that are loaded by a user (ie: gazzatest) thru the client browser sugarCE into Zucker Reports
can schedule them - but then gets an 'access denied' line appear in sugarCE when trying to see the schedules later. (??)
This is a recent phenomenon since we've started debugging the failing scheduling by cron issue.
Alternatively, creating the reports as user:admin and having admin schedule them for gazzatest - also fails to produce results.
Through all this, running the actual report (once, manually) can produce a PDF, put the PDF in the reports archive,
and can also email it out across the LAN, over the firewall/mail gateway and to the real workd email recipient (gaz@alchester.com.au)
So we're left with debugging why the use of crond to process the scheduled list of jobs is failing.
We see evidence in /var/log/cron that the crond is trying to do something every 60 seconds.....
[root@abssugar Schedulers]# more /var/log/cron
.......
...................
CRON (04/01-22:57:42-4497) STARTUP (V5.0)
apache (04/01-22:58:01-4504) CMD (cd /usr/share/sugarcrm ; php5 -f cron.php >/dev/null 2>&1)
apache (04/01-22:59:01-4510) CMD (cd /usr/share/sugarcrm ; php5 -f cron.php >/dev/null 2>&1)
apache (04/01-23:00:01-4514) CMD (cd /usr/share/sugarcrm ; php5 -f cron.php >/dev/null 2>&1)
root (04/01-23:01:01-4518) CMD (run-parts /etc/cron.hourly)
apache (04/01-23:01:01-4520) CMD (cd /usr/share/sugarcrm ; php5 -f cron.php >/dev/null 2>&1)
apache (04/01-23:02:01-4524) CMD (cd /usr/share/sugarcrm ; php5 -f cron.php >/dev/null 2>&1)
[root@abssugar Schedulers]# date
Wed Apr 1 23:02:57 EST 2009
We can see that /etc/crontab is set to run all these timely jobs:
[root@abssugar Schedulers]# more /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
#
# php scheduler for sugarcrm is via /etc/cron.d/sugarcrm
* * * * * apache cd /usr/share/sugarcrm; php5 -f cron.php 2>&1
[root@abssugar Schedulers]#
CHANGES ATTEMPTED:
1. /etc/cron.d/sugarcrm We have not found out why /etc/cron.d/sugarcrm was originally setup to run the "php5 -f cron.php"
Also, /etc/cron.d/suagarcrm was chmod 644 for root/root - and we expect that perhaps apache needs greater access to this.
SO: we chmod 755.
2. Point (1) aside, we still saw no linkage of sugarCE to use /etc/cron.d/sugarcrm
SO: we commented out the execution line inside of /etc/cron.d/sugarcrm
and activated it inside of /etc/crontab.
3. We also observe that sugarCRM v5.0.0.b instructions suggest the line should read ...... php -f cron.php.....
BUT the Linux 2.6.24.4 Applicance distro seems to only come with php5.
4. Stopping and starting the apache server and the cron daemon to ensure all these settings are in use:
# /etc/init.d/httpd stop (start)
# /etc/init.d/crond stop (start)
FINDINGS:
Now we are getting an email sent every 60 seconds containing 15pairs of lines as below
from: Cron Daemon
root@alchester.com.au
subject Cron <apache@abssugar> cd /usr/share/sugarcrm; php5 -f cron.php 2>&1
PHP Notice: Undefined offset: 6 in /usr/share/sugarcrm/include/TimeDate.php on line 308
PHP Notice: Undefined offset: 6 in /usr/share/sugarcrm/include/TimeDate.php on line 314
PHP Notice: Undefined offset: 6 in /usr/share/sugarcrm/include/TimeDate.php on line 308
PHP Notice: Undefined offset: 6 in /usr/share/sugarcrm/include/TimeDate.php on line 314
...... (repeats another 13-times......)
The above error was previously associated with the issue of "relationships.cache.php"
not containing a column called: "schedulers_create_by"
(but instead, having: "schedulers_create_by_rel"
BUT: The difference this time, is there is NO corresponding error appearing in /usr/share/sugarcrm/sugarcrm.log
"FATAL SugarCRM - error fetching relationships from cache schedules_created_by"
AND: The other difference is there is NO additional failure in the email after the 15 pairs of lines:
"PHP Warning: mysql_query(): Unable to save result set in /usr/share/sugarcrm/include/database/MysqlManager.php on line 151
Query Failed:select user_id, (select id FROM tracker t2 WHERE t2.user_id = t1.user_id AND visible = 1
ORDER BY id DESC LIMIT 14,1) minid FROM tracker t1 GROUP by user_id::
MySQL error 1242: Subquery returns more than 1 row
Still stumped.
Gaz


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks