[horde] grandchild failed in cron

Andreas Mauser andreas at mauser.info
Tue Apr 17 19:37:06 UTC 2012


Hi,

----- Nachricht von Andreas Mauser <andreas at mauser.info> ---------
   Datum: Tue, 17 Apr 2012 09:32:44 +0200
     Von: Andreas Mauser <andreas at mauser.info>
Betreff: Re: [horde] grandchild failed in cron
      An: horde at lists.horde.org


> Hi,
>
> ----- Nachricht von Vilius Šumskas <vilius at lnk.lt> ---------
>   Datum: Mon, 09 Apr 2012 18:38:38 +0300
>     Von: Vilius Šumskas <vilius at lnk.lt>
> Betreff: Re: [horde] grandchild failed in cron
>      An: horde at lists.horde.org
>
>
>> Hi,
>>
>> Andreas Mauser <andreas at mauser.info> rašė:
>>
>>>>>>>>>>>>>>>>>>>>>>>>> Am 05.03.2012 12:56, schrieb Andreas Mauser:
>>>>>>>>>>>>>>>>>>>>>>>>>> In crontab I have:
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> */5 * * * * root
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>> PHP_PEAR_SYSCONF_DIR=/var/www/mauser.info/mailoffice
>>>>>>>>>>>>>>>>>>>>>>>>>> php -d
>>>>>>>>>> include_path=/var/www/mauser.info/mailoffice/pear/php
>>>>>>>>>>>>>>>>>>>>>>>>>> /var/www/mauser.info/mailoffice/pear/horde-alarms
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> and I get a:
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> /USR/SBIN/CRON[4915]: (CRON) error (grandchild
>>>>>>>> #4916
>>>>>>>>>>>>>>>>>>>>>>>>>> failed with exit
>>>>>>>>>>>>>>>>>>>>>>>>>> status 127)
>>>>>>>>>>>>>>>>>>>>>>>>>> and:
>>>>>>>>>>>>>>>>>>>>>>>>>> /bin/sh: root: not found
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> Removing 'root' at the line beginning I get:
>>>>>>>>>>>>>>>>>>>>>>>>>> PHP Fatal error:  Call to a member function setObs()
>>>>>>>>>>>>>>>>>>>>>>>>>> on a non-object in
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> Anything to fix that?
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>> Sorry I didnt give you the full error message:
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>> Removing 'root' at the line beginning I get:
>>>>>>>>>>>>>>>>>>>>>>> PHP Fatal error:  Call to a member function setObs() on
>>>>>>>>>>>>>>>>>>>>>>> a non-object in /PATH/SQL.php in line 130
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>> Does that help some more?
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> If it's really SQL.php (and not Sql.php),  
>>>>>>>>>>>>>>>>>>>>>> that's not even
>>>>>>>>>>>>>>>>>>>>>> Horde 4 code.
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> Sorry about that, I wrote the last words by  
>>>>>>>>>>>>>>>>>>>>> myself because
>>>>>>>>>>>>>>>>>>>>> I already closed the console window.
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> PHP Fatal error:  Call to a member function setObs() on a
>>>>>>>>>>>>>>>>>>>>> non-object in
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>> /var/www/mauser.info/mailoffice/pear/php/Horde/Perms/Sql.php on
>>>>>>>>>>>>>>>>>>>>> line 130
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> In fact you are right, it is Sql.php and because it is in
>>>>>>>>>>>>>>>>>>>>> horde directories I assume its a horde part?
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> Is that fixable? Because I get hundrets of messages a day
>>>>>>>>>>>>>>>>>>>>> in the logfile.
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Is there anything I can do?
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> This could only happen if the unserialization in the line
>>>>>>>>>>>>>>>>>>> fails, but you should have that in your logs too. And that
>>>>>>>>>>>>>>>>>>> could only happen if you have some broken permission object
>>>>>>>>>>>>>>>>>>> in the cache.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Ok, I take this as a fact. But what would one do in  
>>>>>>>>>>>>>>>>>> such a case?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> A reboot did not help at all.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Anyone who can help? It fills my logs daily with a hundred of
>>>>>>>>>> messages.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Did you read my reponse? First of all there has to be  
>>>>>>>>>>>>>>> some error
>>>>>>>>>>>>>>> in any of the logs about failed unserialization. Is  
>>>>>>>>>>>>>>> this the case?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> And I wrote that this may only happen if a cached value is
>>>>>>>>>>>>>>> broken. So you need to empty the cache if that's the case.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Yes, I read, but I thought a reboot of the server will do the
>>>>>>>>>>>>>> clear cache as well. I rebooted because if I run the script:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> php -d include_path=/var/www/mauser.info/mailoffice/pear/php
>>>>>>>>>>>>>> /var/www/mauser.info/mailoffice/pear/horde-clear-cache
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I get:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> PHP Fatal error:  Call to a member function setObs() on a
>>>>>>>>>>>>>> non-object in
>>>>>>>>>>>>>> /var/www/mauser.info/mailoffice/pear/php/Horde/Perms/Sql.php
>>>>>>>> on
>>>>>>>>>>>>>> line 130
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> and was afraid to ask what I did wrong now. How can I clear the
>>>>>>>> cache?
>>>>>>>>>>>>>
>>>>>>>>>>>>> No idea. You didn't tell us which caching backend you  
>>>>>>>>>>>>> use. Whether
>>>>>>>>>>>>> it's cleared by a reboot depends on whether you use a persistant
>>>>>>>>>>>>> cache storage.
>>>>>>>>>>>>
>>>>>>>>>>>> After an upgrade of mysql in Debian I was able to clear the cache,
>>>>>>>>>>>> but the grandchild error doesnt go away.
>>>>>>>>>>>>
>>>>>>>>>>>> I use memcache, the memcache application is installed, also an
>>>>>>>>>>>> entry in php.ini has been created. php5-memcache is also  
>>>>>>>>>>>> installed.
>>>>>>>>>>>
>>>>>>>>>>> I still get the grandchild error.
>>>>>>>>>>>
>>>>>>>>>>> I use memcache as a backend.
>>>>>>>>>>> I rebootet the server.
>>>>>>>>>>> I cleared the horde cache.
>>>>>>>>>>>
>>>>>>>>>>> Error dont go away.
>>>>>>>>>>>
>>>>>>>>>>> Any ideas how can I proceed?
>>>>>>>>>>
>>>>>>>>>> I can verify that the grandchild PID is the same which is generated
>>>>>>>>>> when running the Horde cron entry:
>>>>>>>>>>
>>>>>>>>>> cat /var/log/syslog |grep 1229
>>>>>>>>>>
>>>>>>>>>> Apr  4 08:35:01 webster /USR/SBIN/CRON[1229]: (root) CMD (root
>>>>>>>>>> PHP_PEAR_SYSCONF_DIR=/var/www/mauser.info/mailoffice php -d
>>>>>>>>>> include_path=/var/www/mauser.info/mailoffice/pear/php
>>>>>>>>>> /var/www/mauser.info/mailoffice/pear/horde-alarms > /dev/null 2>&1)
>>>>>>>>>>
>>>>>>>>>> Apr  4 08:35:01 webster /USR/SBIN/CRON[1228]: (CRON) error  
>>>>>>>>>> (grandchild
>>>>>>>>>> #1229 failed with exit status 127)
>>>>>>>>>>
>>>>>>>>>> The entry in the crontab is:
>>>>>>>>>>
>>>>>>>>>> ##### Horde Alarms
>>>>>>>>>> */5 * * * * root
>>>>>>>> PHP_PEAR_SYSCONF_DIR=/var/www/mauser.info/mailoffice
>>>>>>>>>> php -d include_path=/var/www/mauser.info/mailoffice/pear/php
>>>>>>>>>> /var/www/mauser.info/mailoffice/pear/horde-alarms > /dev/null 2>&1
>>>>>>>>>>
>>>>>>>>>> How can I fix this or work around?
>>>>>>>>>
>>>>>>>>> Error 127 means "command not found", so there is something wrong
>>>>>>>>> with your cron or environment. Make sure you can execute
>>>>>>>>> "PHP_PEAR_SYSCONF_DIR=/var/www/mauser.info/mailoffice  php -d
>>>>>>>>> include_path=/var/www/mauser.info/mailoffice/pear/php
>>>>>>>>> /var/www/mauser.info/mailoffice/pear/horde-alarms" with the root
>>>>>>>> user.
>>>>>>>>
>>>>>>>> I can not execute:
>>>>>>>>
>>>>>>>> PHP_PEAR_SYSCONF_DIR=/var/www/mauser.info/mailoffice  php -d
>>>>>>>> include_path=/var/www/mauser.info/mailoffice/pear/php
>>>>>>>> /var/www/mauser.info/mailoffice/pear/horde-alarms
>>>>>>>>
>>>>>>>> I get a:
>>>>>>>>
>>>>>>>> PHP Fatal error:  Call to a member function setObs() on a non-object
>>>>>>>> in /var/www/mauser.info/mailoffice/pear/php/Horde/Perms/Sql.php on
>>>>>>>> line 130
>>>>>>>>
>>>>>>>> Line 130 is:
>>>>>>>>
>>>>>>>> $this->_permsCache[$name]->setObs($this->_cache, $this->_db);
>>>>>>>>
>>>>>>>> What is wrong here?
>>>>>>>
>>>>>>> Jan have already explained. Your cache is corrupt most probably.
>>>>>>
>>>>>> I know. But I cleared the cache successfully but the grandchild
>>>>>> error does not go away.
>>>>>>
>>>>>>> You need to debug this line by line in PHP code and see where it goes.
>>>>>>
>>>>>> I dont know how to debug PHP, but I can take steps if you can suggest.
>>>>>>
>>>>>>> Also try disabling Caching completely to see if that helps.
>>>>
>>>>> I disabled the memcache server, and I set all to cache on local files
>>>>> which works.
>>>>
>>>>> But the grandchild error does NOT go away.
>>>>
>>>>> It only goes away if I comment the Horde Alarms line in crontab.
>>>>
>>>>> It seems to be the only thing in cron which produces error, as all my
>>>>> other scripts works well.
>>>>
>>>>> Any help welcome.
>>>>
>>>>> Andreas
>>>>
>>>> As   I  said  before  there  is  something  wrong  with your cron  or  the
>>>> shell environment. You should contact your OS mailing list.
>>>>
>>>> BTW,  searching google for the grandchild error gives a ton of results
>>>> regarding cron on debian/ubuntu.
>>>
>>> I have found and read them all.
>>>
>>> And I also used different shells to test. And I used several  
>>> tricks to work around.
>>> But it is definitely this Horde Alarm line which causes this behaviour.
>>
>> *Which* line?
>>
>>> Can you tell on which Linux distribution Horde 4 shall work the nicest?
>>> Then I will just move to another distribution. What about CentOS6?  
>>> Supported and ok?
>>
>> It's not like Horde has a list of supported platforms. Every decent  
>> Linux should do. I'm not sure but I think the error you are seeing  
>> can be solved easly and without a need to change distribution. Just  
>> ask about it on their list.
>>
>> For me personally Horde 4 including horde-alarm script runs nicelly  
>> on RHEL6. But then again, I don't run it in separete PEAR  
>> installation.
>
> I set a ';' in the crontab line after the first variable.
>
> */5 * * * * root  
> PHP_PEAR_SYSCONF_DIR=/var/www/mauser.info/mailoffice/; /usr/bin/php  
> -d include_path=/var/www/mauser.info/mailoffice/pear/php/  
> /var/www/mauser.info/mailoffice/pear/horde-alarms > /dev/null
>
> It seems that the grandchild error goes away then. Does this affect  
> the command in any way?
>
> However, when I run the crontab entry as it is (after * * * root) on  
> the console I still get this error:
>
> root at webster:~ #  
> PHP_PEAR_SYSCONF_DIR=/var/www/mauser.info/mailoffice/ /usr/bin/php  
> -d include_path=/var/www/mauser.info/mailoffice/pear/php/  
> /var/www/mauser.info/mailoffice/pear/horde-alarms
> PHP Fatal error:  Call to a member function setObs() on a non-object  
> in /var/www/mauser.info/mailoffice/pear/php/Horde/Perms/Sql.php on  
> line 130
>
> Did I run the command correctly on the console?

Ok, after some testing I disabled any memcaching in Horde, and I  
uninstalled memcached.
As Cache System I choose 'Store data in filesystem'.
I deleted all files out of the cache directory /var/www/horde-cache  
which I set in Horde, then I rebootet the server, to make sure it all  
works.

After a reboot I logged into Horde and was able to clear the cache on  
the console.
After a while, lets say 5-10 minutes I run this command:

root at webster:~ # php -d  
include_path=/var/www/mauser.info/mailoffice/pear/php  
/var/www/mauser.info/mailoffice/pear/horde-clear-cache

PHP Fatal error:  Call to a member function setObs() on a non-object  
in /var/www/mauser.info/mailoffice/pear/php/Horde/Perms/Sql.php on  
line 130

root at webster:~ # rm -rf /var/www/horde-cache/*

root at webster:~ # php -d  
include_path=/var/www/mauser.info/mailoffice/pear/php  
/var/www/mauser.info/mailoffice/pear/horde-clear-cache
Are you sure you want to expire all cached data?
     (y) Yes
     (n) No

Ihre Auswahl [n]: y
[   OK   ] Cache data cleared.

root at webster:~ # /usr/bin/php -d  
include_path=/var/www/mauser.info/mailoffice/pear/php/  
/var/www/mauser.info/mailoffice/pear/horde-alarms
root at webster:~ #

So if I use memcache or local files, after a while I get the grandchild error.
As it works for a while I assume the problem must be somewhere in (my) Horde.

Can someone please look into that again?

Andreas


More information about the horde mailing list