View Issue Details

IDProjectCategoryView StatusLast Update
0002372SOGoBackend Generalpublic2013-10-15 12:44
Reporterthomasg Assigned Tojraby 
Status resolvedResolutionfixed 
Product Version2.0.6 
Fixed in Version2.1.0 
Summary0002372: /etc/cron.daily/sogo exited with return code 1 with Ubuntu package

Getting the error "/etc/cron.daily/sogo exited with return code 1" from cron once a day.

Anthony Milan posted a fix in 2009

Seems that there is a "/" missing in the line SOGOSPOOL=/var/spool/sogo/

TagsNo tags attached.


has duplicate 0002450 closedfrancis /etc/cron.daily/sogo exits non-zero if /var/spool/sogo is non-empty 




2013-07-23 07:38

reporter   ~0005765

I see the error too. (debian 7, x64)

However: adding the missing trailing "/" doesn't solve it here. It does correct the issue on your server?



2013-07-30 18:45

reporter   ~0005776

Yes getting still the error. The fix didn't correct the error.

Christian Mack

Christian Mack

2013-07-31 09:00

developer   ~0005779

What do you get, when you start this script as root on the command line?



2013-07-31 09:09

reporter   ~0005780

root@mail:/etc/cron.daily# ./sogo

Christian Mack

Christian Mack

2013-07-31 11:13

developer   ~0005781

Could you change the find command, to not drop error messages?
You can achive that by removing the "2> /dev/null" part temporarily.



2013-07-31 11:46

reporter   ~0005782

root@mail:/etc/cron.daily# ./sogo
/usr/bin/find: /var/spool/sogo/user1': No such file or directory /usr/bin/find:/var/spool/sogo/user2': No such file or directory
/usr/bin/find: /var/spool/sogo/user3': No such file or directory /usr/bin/find:/var/spool/sogo/user4': No such file or directory
/usr/bin/find: `/var/spool/sogo/user5': No such file or directory

and then interestingly, running it again:
root@mail:/etc/cron.daily# ./sogo

Christian Mack

Christian Mack

2013-07-31 13:22

developer   ~0005783

So the source of this error code is indeed the find command.

Looks like a race condition to me.
Find encounters an directory and, while testing if it is empty or while trying to remove it, this directory vanishes on its own.

I have seen such things on remote file systems.
Is your /var/spool/sogo on an nfs or cifs share?

Or are there any other scripts removing these directories?



2013-07-31 14:31

reporter   ~0005784

Nope: they're on a normal, local xfs filesystem, and nothing else (as far as I know) is accessing them.

It seems to me it gives the error message, but it succeeds to actually removes the file. (I created an empty test directory, and it disappeared, even though the error message came up)



2013-07-31 15:36

reporter   ~0005785

Sorry for the late response.

I can confirm the things heupink wrote.

The folder is on a normal ext4 and also nothing else is accessing them.



2013-08-30 12:08

reporter   ~0005934

I have the same problem.

Could anyone find a solution for that?

I wonder why the issue string is incomplete?!



2013-08-30 15:58

viewer   ~0005935

For reference, the current command:
find "$SOGOSPOOL" -mindepth 1 -type d -empty -exec /bin/rmdir {} \; 2> /dev/null

It is broken since find will try to openat() the directory once rmdir returns, yielding the error message that you see.

To fix it, we need to tell find to delete the directory on its own:
find "$SOGOSPOOL" -mindepth 1 -type d -empty -delete

And that cron job scares me, it should check for the owner before deleting anything:
find "$SOGOSPOOL" -mindepth 1 -type d -user sogo -empty -delete

Does this work for you guys?

Christian Mack

Christian Mack

2013-09-03 08:40

developer   ~0005936

Works for me on CentOS 5.



2013-09-03 09:21

reporter   ~0005937

Worked here too, on debian 7 x64. Thanks!



2013-09-03 14:05

viewer   ~0005938

Shoudl be fixed now:

Issue History

Date Modified Username Field Change
2013-07-20 05:45 thomasg New Issue
2013-07-23 07:38 heupink Note Added: 0005765
2013-07-30 18:45 thomasg Note Added: 0005776
2013-07-31 09:00 Christian Mack Note Added: 0005779
2013-07-31 09:09 heupink Note Added: 0005780
2013-07-31 11:13 Christian Mack Note Added: 0005781
2013-07-31 11:46 heupink Note Added: 0005782
2013-07-31 13:22 Christian Mack Note Added: 0005783
2013-07-31 14:31 heupink Note Added: 0005784
2013-07-31 15:36 thomasg Note Added: 0005785
2013-08-30 12:08 masoodmx Note Added: 0005934
2013-08-30 15:58 jraby Note Added: 0005935
2013-09-03 08:40 Christian Mack Note Added: 0005936
2013-09-03 09:21 heupink Note Added: 0005937
2013-09-03 14:05 jraby Note Added: 0005938
2013-09-03 14:05 jraby Assigned To => jraby
2013-09-03 14:05 jraby Status new => resolved
2013-09-03 14:05 jraby Resolution open => fixed
2013-10-15 12:43 francis Fixed in Version => 2.1.0
2013-10-15 12:44 francis Relationship added has duplicate 0002450