Zentyal Forum, Linux Small Business Server

Zentyal Server => Directory and Authentication => Topic started by: peptoniET on May 03, 2016, 08:09:53 am

Title: Couldn't delete entry! - net cache flush
Post by: peptoniET on May 03, 2016, 08:09:53 am
Since sunday, when I upgraded TWO servers modules "Domain controller and file sharing" to version 4.2.3 i'm getting mails to the root account every couple of minutes with contents like this, on both servers:

Couldn't delete entry! key = IDMAP/UID2SID/3000002
Couldn't delete entry! key = IDMAP/SID2XID/S-1-5-21-4072495981-2812427868-577415633-1104
Couldn't delete entry! key = IDMAP/SID2XID/S-1-5-18
Couldn't delete entry! key = IDMAP/SID2XID/S-1-5-21-4072495981-2812427868-577415633-512
Couldn't delete entry! key = IDMAP/SID2XID/S-1-5-32-544
Couldn't delete entry! key = IDMAP/GID2SID/2512
Couldn't delete entry! key = IDMAP/SID2XID/S-1-5-21-4072495981-2812427868-577415633-1126
Couldn't delete entry! key = IDMAP/UID2SID/2502
Couldn't delete entry! key = IDMAP/SID2XID/S-1-5-21-4072495981-2812427868-577415633-500
Couldn't delete entry! key = IDMAP/UID2SID/2500
Couldn't delete entry! key = IDMAP/SID2XID/S-1-5-21-4072495981-2812427868-577415633-513
Couldn't delete entry! key = IDMAP/GID2SID/2513
Couldn't delete entry! key = IDMAP/GID2SID/3000002
Couldn't delete entry! key = IDMAP/GID2SID/3126
Couldn't delete entry! key = IDMAP/GID2SID/4

It says is coming from "/usr/bin/net cache flush" cron job

Info is different every time...
Title: Re: Couldn't delete entry! - net cache flush
Post by: cmenghi on May 03, 2016, 06:35:25 pm
Same problem from yesterday. I run the command manually and solve for some minutes.

Title: Re: Couldn't delete entry! - net cache flush
Post by: peptoniET on May 03, 2016, 07:14:52 pm
Why do the system needs to do this cron job every minute...

* * * * * root /usr/bin/net cache flush

It's in /etc/cron.d/zentyal-samba.

I MEAN: EVERY MINUTE?????????
Title: Re: Couldn't delete entry! - net cache flush
Post by: peptoniET on May 03, 2016, 07:17:15 pm
I guess we could modify the line like this

Code: [Select]
* * * * * root /usr/bin/net cache flush &>/dev/null
to get rid of the mails,

BUT: How relevant are this messages?  Could not find any info on them...

Anybody has a 4.2.2 module and check if there is this cronjob there too...?
Title: Re: Couldn't delete entry! - net cache flush
Post by: peptoniET on May 03, 2016, 07:24:07 pm
OK.  I forgot I had another server which I have not upgraded this module to 4.2.3.

THERE IS NO /etc/cron.d/zentyal-samba IN 4.2.2!!!

What kind of problem Zentyal has that it has to clear the cache EVERY MINUTE???  It's an insane method...
Title: Re: Couldn't delete entry! - net cache flush
Post by: cmenghi on May 03, 2016, 07:30:36 pm
My packages
ii  zentyal                               4.2                                 all          Zentyal - Core metapackage
ii  zentyal-antivirus                     4.2                                 all          Zentyal - Antivirus
ii  zentyal-common                        4.2                                 all          Zentyal - Common Library
ii  zentyal-core                          4.2.2                               all          Zentyal - Core
ii  zentyal-dns                           4.2.1                               all          Zentyal - DNS Server
ii  zentyal-firewall                      4.2                                 all          Zentyal - Firewall
ii  zentyal-network                       4.2.2                               all          Zentyal - Network Configuration
ii  zentyal-ntp                           4.2                                 all          Zentyal - NTP Service
ii  zentyal-objects                       4.2                                 all          Zentyal - Network Objects
ii  zentyal-samba                         4.2.3                               all          Zentyal - Domain Controller and File Sharing
ii  zentyal-services                      4.2                                 all          Zentyal - Network Services
ii  zentyal-software                      4.2                                 all          Zentyal - Software Management


In another server running Zentyal 4.0 this cron job doesn't exist!!
Title: Re: Couldn't delete entry! - net cache flush
Post by: peptoniET on May 03, 2016, 07:33:07 pm
Ok then.  This s**t was introduced by zentyal-samba 4.2.3.  >:(
Title: Re: Couldn't delete entry! - net cache flush
Post by: peptoniET on May 03, 2016, 07:34:54 pm
More about this here: https://forum.zentyal.org/index.php?topic=27113.0

But that is back to November 2015...
Title: Re: Couldn't delete entry! - net cache flush
Post by: cmenghi on May 03, 2016, 09:41:17 pm
What's happen if remove the cron entry ?
Title: Re: Couldn't delete entry! - net cache flush
Post by: peptoniET on May 04, 2016, 08:37:50 am
I would not remove this entry.  Zentyal team has put it there for some powerful reason...  you don't clean the cache every minute for nothing...
Title: Re: Couldn't delete entry! - net cache flush
Post by: cmenghi on May 04, 2016, 07:10:12 pm
This is true, sound like a temporaly patch. For now i'm deconfigure the mails for this server.
Title: Re: Couldn't delete entry! - net cache flush
Post by: peptoniET on May 05, 2016, 04:33:41 pm
I cannot afford to disable root mails, so I've gone through this solutions instead.

Code: [Select]
* * * * * root /usr/bin/net cache flush &>/dev/null
But I'm still worried about the error messages...
Title: Re: Couldn't delete entry! - net cache flush
Post by: cmenghi on May 05, 2016, 08:16:17 pm
I cannot afford to disable root mails, so I've gone through this solutions instead.

Code: [Select]
* * * * * root /usr/bin/net cache flush &>/dev/null
But I'm still worried about the error messages...

Yes, this can work.
Title: Re: Couldn't delete entry! - net cache flush
Post by: jfaria on July 25, 2016, 05:29:52 pm
I have a similar a similar situation but, in my case, machine almoust stop running, completly overloaded.

I was able to login (very slow) and I issue command ps -aux. It shows a lot (hundreds) of lines like this:

root     10123  0.0  0.0   4440     0 ?        Ss   07:55   0:00 /bin/sh -c /usr/bin/net cache flush
root     10125  0.0  0.0 321840     8 ?        S    07:55   0:00 /usr/bin/net cache flush

After a reboot everything seems to be ok again.

I decided to remove the CRON job and see what happens.

CRON runs net cache flush every minute. Somewher in time, there is a condition when the command hangs and doesn't complete and stay in memory (but system doesn't crash!). CRON continues to run every minute until no more memory available.

Mr. Zentyal, why do you need to flush the cache every minute? And why net cache flush hangs in memory?

Thank you.
Title: Re: Couldn't delete entry! - net cache flush
Post by: allitsk on October 13, 2016, 09:33:24 am
Hello @jfaria,
the same situation with lots of net cache flush happened to me . When you removed this line from cron, was it ok?

Thank you.
Title: Re: Couldn't delete entry! - net cache flush
Post by: aetcoadmin on November 01, 2016, 03:09:33 am
I was having the same problem with /usr/bin/net getting hung up and not closing.  I have zabbix installed to monitor the server, and after a few days, the memory started getting full.  I started to notice this after installing btsync to sync some shares with windows computers.

Anyway, I thought about commenting out the cron.d line.  But I figure they added it for some reason (would be nice if someone from zentyal let us know why....).  So I decided to change the line to this:
Code: [Select]
nano /etc/cron.d/zentyal-samba
* * * * * root /usr/bin/timeout 50s /usr/bin/net cache flush > /dev/null

The timeout command will only allow the net command to run for a maximum of 50 seconds.  It seems to be working for me so far. 

Note: Timeout was already installed on my machine, however, you probably want to make sure it's installed on yours first.  Also, any future zentyal upgrade will probably overwrite the change...