nscd stops running on feisty ldap client

Asked by TheArnold

I upgraded my dapper server to feisty. By upgrading to edgy first and then upgrade edgy to feisty. The reason I did this is for open ldap 2.3. I was having a lot of memory leaks and I had to restart the server every other week to keep ldap running. During the edgy to feisty upgrade I had problems upgrading nscd. I completly removed nscd and reinstalled nscd after feisty upgrade was complete. I can start nscd and everything appears to be running untill I do /etc/init.d/nscd status to check if the service is running. And it shows that the service stops. No errors in syslog. I also enabled nscd log in nscd.conf, but nothing gets loged. If I run nscd -d I get the following error:

10177: Reloading "0" in password cache!
10177: Reloading "101" in password cache!
10177: Reloading "1000" in password cache!
10177: Reloading "hsastprinpc5685$" in password cache!
10177: Reloading "lhair" in group cache!
10177: Reloading "hsfnp02" in hosts cache!
nscd: hstcache.c:389: cache_addhst: Assertion `hst->h_addr_list[1] == ((void *)0)' failed.
Aborted (core dumped)

Any ideas?

Thanks
-Glenn

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Matt Mossholder (matt-mossholder) said :
#1

Glenn,

     According to this post:
   http://209.85.135.104/search?q=cache:Km-cVmdcTCsJ:www.mail-archive.com/debian-glibc%40lists.debian.org/msg34312.html+cache_addhst:+Assertion&hl=en&ct=clnk&cd=1&gl=us&client=firefox-a

     ...this is caused by a corrupt host cache. Clear it out using 'nscd -i hosts', or doing 'rm -f /var/db/nscd/hosts'.

    Regards,
         --Matt

Revision history for this message
TheArnold (garnold-unrealsolutions) said :
#2

Matt this did not solve my problem. But, this link gave me a work around though. I had to disable the host caching in the nscd.conf by remarking out all the entries for caching hosts. I ran the command nscd -i hosts and that did not help. I removed just the hosts db from /var/db/nscd which did not help. I removed the hosts, passwd, and groups db with hosts disabled in nscd.conf and finally nscd appears to be working and staying up. Any ideas why I can not cache the hosts with nscds?

Thanks for your help!
Glenn

Revision history for this message
Matt Mossholder (matt-mossholder) said :
#3

Glenn,
    It could be any manner of things... if you disable nscd, and use getent (e.g. getent hosts somehost.somedomain.com), does that work as expected? If it does, maybe you should consider reinstalling nscd (i.e. sudo apt-get remove --purge nscd ; sudo apt-get install nscd), and see how that goes.

Revision history for this message
TheArnold (garnold-unrealsolutions) said :
#4

Matt,

I used getent hosts with nscd disabled and it worked as expected. I removed nscd and purged it. I had to manually deleted nscd database after removal of nscd. I reinstalled nscd and it is currently running with hosts caching enabled. Earlier with the hosts disable in the nscd.conf ran for 5-10 minutes and then crashed. So, hopefully nscd will stay running tonight.

Revision history for this message
TheArnold (garnold-unrealsolutions) said :
#5

Matt,

Nscd stop after fifteen minutes of running I get the following error:

root@hsfnp02:/var/db/nscd# nscd -d
6399: Reloading "www-data" in password cache!
6399: Reloading "sshd" in password cache!
6399: Reloading "MTHCSDATA$" in password cache!
nscd: cache.c:143: cache_add: Assertion `newp->key + newp->len <= table->head->first_free' failed.
Aborted (core dumped)

Revision history for this message
Matt Mossholder (matt-mossholder) said :
#6

Glenn,
     Looks like you are not alone:

http://lists.debian.org/debian-glibc/2007/03/msg00218.html

 Is the LDAP directory you are using fairly large (the user in the link
about said his is about 10K entries). Maybe nscd's DB needs to be tuned
up to a larger size to handle caching for you...

 Not really sure what is going on, though. I have nss-ldap running
here, with nscd, and no issues. How about posting your libnss-ldap.conf
and we can try from there.

  --Matt

Revision history for this message
TheArnold (garnold-unrealsolutions) said :
#7

Matt,

My ldap directory has roughly 4000 objects in it. The size of the database is aproximate 10000000 bytes. I doubled the max-db-size and suggested-size to see if this will help.
Here is my nscd.conf with the doubled values

 enable-cache passwd yes
        positive-time-to-live passwd 600
        negative-time-to-live passwd 20
        suggested-size passwd 433
        check-files passwd yes
        persistent passwd yes
        shared passwd yes
        max-db-size passwd 63554432
        auto-propagate passwd yes

        enable-cache group yes
        positive-time-to-live group 3600
        negative-time-to-live group 60
        suggested-size group 433
        check-files group yes
        persistent group yes
        shared group yes
        max-db-size group 63554432
        auto-propagate group yes

        enable-cache hosts yes
        positive-time-to-live hosts 3600
        negative-time-to-live hosts 20
        suggested-size hosts 433
        check-files hosts yes
        persistent hosts yes
        shared hosts yes
        max-db-size hosts 63554432

I have nscd running right now with no problems, but who knows how long it will stay running. Is it possible to downgrade to edgy's version of nscd?

Here is sample of nscd code running nscd -d

9570: handle_request: request received (Version = 2) from PID 9704
9570: GETPWBYNAME (rstrassburger)
9570: Haven't found "rstrassburger" in password cache!
9570: handle_request: request received (Version = 2) from PID 9704
9570: GETPWBYNAME (RSTRASSBURGER)
9570: Haven't found "RSTRASSBURGER" in password cache!
9570: short write in cache_addpw: Broken pipe
9570: handle_request: request received (Version = 2) from PID 9704
9570: INITGROUPS (rstrassburger)
9570: Haven't found "rstrassburger" in group cache!
9570: remove GETPWBYNAME entry "rstrassburger"

Thanks
-Glenn

Revision history for this message
TheArnold (garnold-unrealsolutions) said :
#8

Here is something else I find weird about this problem. I configured a desktop to run feisty server as the ldap server using feisty server. The only difference between the desktop and my Dell Poweredge 2850 is I am running the 64-bit version on the Dell Server and 32-bit on the Desktop that is hosting my ldap server.

Revision history for this message
TheArnold (garnold-unrealsolutions) said :
#9

The 32-bit version is working fine.

Revision history for this message
Matt Mossholder (matt-mossholder) said :
#10

This is starting to sound like a bug in the 64-bit version. I suggest you register it as such. The package that contains nscd is actually the glibc package (from a source perspective), so that would be the correct place to put it. I'd also put in a back-reference to this question.

 Let me know if you need further help.

   Regards,
      --Matt

Revision history for this message
TheArnold (garnold-unrealsolutions) said :
#11

Matt,

I will open a bug ticket

Revision history for this message
Launchpad Janitor (janitor) said :
#12

This question was expired because it remained in the 'Open' state without activity for the last 15 days.