MRatWork Forum by Mustafa Ramadhan
Sawo Project - Kloxo-MR Discussions => Kloxo-MR Bugs and Requests => Topic started by: Spacedust on 2015-06-09, 18:47:45
-
Editing advanced cron reset all values to 0 even when they are different.
-
Did you select 'Enable Cron For All Users' in 'General Settings'?.
-
Did you select 'Enable Cron For All Users' in 'General Settings'?.
Yes. Just a correction:
Customer is able to add cron with minutes etc. but only first entry is actually added to the server.
If you try to edit cron entry then it shows "Field cannot be empty" and removes cron minute from the list so for example instead showing 0 it shows "-" instead.
I'm testing latest Kloxo-MR now. Maybe there was some troubles with translation.
-
See cronjob logs:
18:11 Jun/09/2015: 1: "/home/tmp/lxtmp__var_spool_cron_ldusav3bHRg":2: bad hourerrors in crontab file, can't install. [(__system__) 'crontab' '-u' 'ldusa' '/home/tmp/lxtmp__var_spool_cron_ldusav3bHRg']
18:13 Jun/09/2015: 1: "/home/tmp/lxtmp__var_spool_cron_ldusaNxM5Af":2: bad hourerrors in crontab file, can't install. [(__system__) 'crontab' '-u' 'ldusa' '/home/tmp/lxtmp__var_spool_cron_ldusaNxM5Af']
-
It happens always if I add more than one cron job entry on all customers !
-
Just tested my very old Kloxo-MR installation Kloxo-MR 7.0.0.b-2015050301 and this bug persists.
-
It works fine in Kloxo-MR 7.0.0.b-2015041302
-
Using the same phpXYs?.
-
Using the same phpXYs?.
Yes. Always php54s. Restored old cronlib.php and it works fine on production server too. I needed to readd all cron entries from last month !
-
Open '/usr/local/lxlabs/kloxo/httpdocs/driver/pserver/cronlib.php' and change:
from:
function postAdd()
{
// We need to write because reads everything from the database.
$this->write();
if (!$this->isSimple()) {
$this->checkIfNull();
$this->convertAll();
}
}
to:
function postAdd()
{
if (!$this->isSimple()) {
$this->checkIfNull();
$this->convertAll();
}
// We need to write because reads everything from the database.
$this->write();
}
-
It works, but trying to fix wrongly added entries always shows 0 in complex cron Minute:
"Field cannot be blank"
then on the list a proper minute is replaced by -
Is there anyway to fix these entires without readding them ?
-
Still some errors when adding new entires but not always. Please investigate !
Example adding something like this:
sjk2014 http://newsfakt.pl/cron-10min.php localhost complex 39 --all-- --all-- --all-- --all--
Then trying to edit and saving does not work properly.
-
Try add '/usr/local/lxlabs/kloxo/pscript/fixcron' with content:
#!/bin/sh
. /script/directory
lxphp.exe ../bin/cronfix.php $*
-
Still some errors when adding new entires but not always. Please investigate !
Example adding something like this:
sjk2014 http://newsfakt.pl/cron-10min.php localhost complex 39 --all-- --all-- --all-- --all--
Then trying to edit and saving does not work properly.
So, try change to:
function postAdd()
{
if (!$this->isSimple()) {
$this->checkIfNull();
$this->convertAll();
}
// We need to write because reads everything from the database.
//$this->write();
}
-
Also change to '// $this->write();' for 'function postUpdate()'
-
Does not help - instead of my minute 37 it shows 0 in minute.
-
Add will be execute postAdd() and update will be execute postUpdate().
-
Both postAdd() and postUpdate() have $this->write(); disabled and nothing.
-
Comparing content of cronlib.php between Kloxo-MR 7.0.0.b-2015041302 and latest update.
-
I didn't found this issue in latest update.
-
Adding/removing works fine. Editing does not !
-
Please check my cronlib.php
http://tnij.org/uv6mtnx
-
Still the same, for some customers even when adding:
21:37 Jun/09/2015: 1: "/home/tmp/lxtmp__var_spool_cron_rochstar79lFpKba":4: bad hourerrors in crontab file, can't install. [(__system__) 'crontab' '-u' 'rochstar79' '/home/tmp/lxtmp__var_spool_cron_rochstar79lFpKba']
21:37 Jun/09/2015: 1: "/home/tmp/lxtmp__var_spool_cron_rochstar794tzkyz":4: bad hourerrors in crontab file, can't install. [(__system__) 'crontab' '-u' 'rochstar79' '/home/tmp/lxtmp__var_spool_cron_rochstar794tzkyz']
21:37 Jun/09/2015: 1: "/home/tmp/lxtmp__var_spool_cron_rochstar796xgCZY":4: bad hourerrors in crontab file, can't install. [(__system__) 'crontab' '-u' 'rochstar79' '/home/tmp/lxtmp__var_spool_cron_rochstar796xgCZY']
21:38 Jun/09/2015: 1: "/home/tmp/lxtmp__var_spool_cron_rochstar79GVofwo":4: bad hourerrors in crontab file, can't install. [(__system__) 'crontab' '-u' 'rochstar79' '/home/tmp/lxtmp__var_spool_cron_rochstar79GVofwo']
21:39 Jun/09/2015: 1: "/home/tmp/lxtmp__var_spool_cron_rochstar79W6ozqI":4: bad hourerrors in crontab file, can't install. [(__system__) 'crontab' '-u' 'rochstar79' '/home/tmp/lxtmp__var_spool_cron_rochstar79W6ozqI']
-
$this->write(); for PostAdd is a must
Now testing PostUpdate is different place.
-
Adding/removing works.
When trying to edit all minutes/hours which were selected are changed to 0 and nothing is changed.
-
Just tested my old Kloxo-MR 7.0.0.b-2015041302 - it also has troubles with editing cron jobs.
I'm testing even older one.
-
Very old version Kloxo-MR 7.0.0.b-2015011402 also the same - 0's when editing cron jobs instead of proper minutes.
-
Even Kloxo-MR 7.0.0.b-2014120802 has it too ;(
22:57 Jun/09/2015: 1: "/tmp/lxtmp__var_spool_cron_admin2QDLMY":2: bad hourerrors in crontab file, can't install. [(__system__) 'crontab' '-u' 'admin' '/tmp/lxtmp__var_spool_cron_admin2QDLMY']
Error Box - Press Esc to close
×
Alert: Adding crontab has failed due to . Please delete this cron and add it again.
-
Kloxo-MR 7.0.0.b-2014082703 the same - this is the first 7.0.0 beta version I got.
-
Kloxo-MR 6.5.1.b-2014063001 - the same - wow this bug is so old !
-
Bingo ! Kloxo-MR 6.5.1.b-2014041003 works fine :)
Here comes the file: http://tnij.org/7yk3ykq
-
There is a bug somewhere here:
static function convertBackCronList($list, $staticlist)
{
if (is_string($list)) {
$list = array($list);
}
foreach ($list as $k => $v) {
if ($v === '--all--') {
return $list;
}
if ($staticlist) {
$outl[] = $staticlist[$k];
} else {
$outl[] = $k;
}
}
return $outl;
}
Restoring this showed proper values when editing but they are not saved to cron (it also removes all fields in editor) however on cron list they are properly edited, must be something else too:
static function convertBackCronList($list, $staticlist)
{
if ($list[0] === '--all--') {
return $list;
}
foreach ($list as $l) {
if ($staticlist) {
$outl[] = $staticlist[$l];
} else {
$outl[] = $l;
}
}
return $outl;
}
-
Mustafa any ideas ?
-
It all started when you fixed security bug: https://github.com/mustafaramadhan/kloxo/commit/71d145fcfee7dad378e1c34f26ad8f65e2768f53 editing cron jobs causes all values to be 0
-
OK - my latest code almost works well. Please note it was translated to Polish, because you still didn't add this to our translation file.
Also static $__desc_weekday = array("", "", "day_of_week"); is a correct form not "Week" which does not exists on our translation file as well.
-
Still not working well in latest upload.
Please see:
-
Just tested 7.0.0.b-2015061802 and still doesn't work all values other than 0 are changed to 0 when editing...
-
Is it fixed ?
-
Only update still unfixed. But, no issue for add cron.
-
Only update still unfixed. But, no issue for add cron.
I do not mean adding. I mean editing - all values are reset to 0 !
-
So, at this moment, delete the old ones and then add the new one.
-
So, at this moment, delete the old ones and then add the new one.
My code is working fine even when editing ;)