Bug 239029 - Autofs is not looking up automountkey in ldap correctly.
Autofs is not looking up automountkey in ldap correctly.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: autofs (Show other bugs)
4.5
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeffrey Moyer
Brock Organ
: Regression
: 242071 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-04 10:59 EDT by Steve Rigler
Modified: 2010-10-22 10:44 EDT (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2007-0734
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 11:02:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Logs from ldap server when autofs tries to mount "/software/Linux" (3.67 KB, text/plain)
2007-05-04 10:59 EDT, Steve Rigler
no flags Details
Handle the return code of CHE_MISSING properly in lookup_one. (543 bytes, patch)
2007-07-23 14:14 EDT, Jeffrey Moyer
no flags Details | Diff
Fix up broken logic statement (545 bytes, patch)
2007-09-04 13:11 EDT, Jeffrey Moyer
no flags Details | Diff

  None (edit)
Description Steve Rigler 2007-05-04 10:59:28 EDT
Description of problem:
We are using ldap maps using the automountkey/automountinformation type schema.
 After upgrading to autofs-4.1.3-199.3, automount is no longer searching for
automountkey correctly.  In the ldap server logs we see automount searching for
"cn=<key>", "cn=/", and "automountkey=/", but never a search for
"automountkey=<key>".

Version-Release number of selected component (if applicable):
autofs-4.1.3-199.3

How reproducible:
Always

Steps to Reproduce:
1. Use maps in ldap with automountkey/automountinformation schema
2. Start autofs
3.
  
Actual results:
Keys are never matched, so the mount never happens successfully.

Expected results:
Automount should search for automountkey=<mountpoint>

Additional info:
Comment 1 Steve Rigler 2007-05-04 10:59:28 EDT
Created attachment 154129 [details]
Logs from ldap server when autofs tries to mount "/software/Linux"
Comment 2 Jeffrey Moyer 2007-05-04 11:35:14 EDT
Please include a debug log and a copy of your master map and the ldif for the
map in question.  Please also provide the contents of /etc/sysconfig/autofs and
the automount: line in /etc/nsswitch.conf.  You can find information about
generating debug logs from:
  http://people.redhat.com/jmoyer/

Thanks!
Comment 3 Steve Rigler 2007-05-04 11:48:44 EDT
Chalk this up as user error.

We change /etc/sysconfig/autofs to reflect the auto.master name.  I noticed that
the rpm created /etc/sysconfig/autofs.rpmnew with the primary difference being
"OLD_LDAP_LOOKUP=0".  Adding this line to /etc/sysconfig/autofs fixes our problem.

Thanks for the quick response!
Comment 4 Jeffrey Moyer 2007-05-04 11:52:55 EDT
Hmm, OLD_LDAP_LOOKUP=1 is supposed to preserve the existing behaviour!  It seems
I botched that up, but good.  I'm going to keep this bug open until I can figure
out exactly what is going on.

I'm glad it's working for you.  You should also notice a reduced load on your
ldap servers with this new package.  Enjoy!
Comment 5 Glen Dosey 2007-05-08 16:42:03 EDT
It should be noted this is not user error. It appears to be a change in default
behavior, perhaps unintentionally. Previous versions of autofs did not define
OLD_LDAP_LOOKUP in /etc/sysconfig/autofs . Specifically autofs-4.1.3-187.
Upgrading to autofs-4.1.3-199.3 introduced changes into the autofs startup
script, specifically the OLD_LDAP_LOOKUP variable which is defined to 1 in the
script, thereby enabling the (undocumented ?) --use-old-ldap-lookup option. This
option apparently disables lookups using the automount style schema and enables
lookups using only the nisMap style schema.

Will a new package be available which maintains the existing default behavior
without requiring changes to the /etc/sysconfig/autofs file ?
Comment 6 Jeffrey Moyer 2007-05-08 17:07:25 EDT
(In reply to comment #5)
> It should be noted this is not user error. It appears to be a change in default
> behavior, perhaps unintentionally.
[snip]

Let me set the story straight, here.  I know this is not a user error, and I am
investigating a fix for this problem.

I introduced a patch to reduce the load on the back-end LDAP servers:
* Wed Jan  3 2007  Jeff Moyer <jmoyer@redhat.com> - 1:4.1.3-199
- Resolves: reduce the load incurred on ldap servers (bz #210182, bz #210185)

The patch introduced the OLD_LDAP_LOOKUP variable in /etc/sysconfig/autofs TO
RETAIN BACKWARDS COMPATIBILITY.  The old behaviour was to try every schema type
for every LDAP query until an answer was returned.  This is what should still be
happening (and obviously is not) when this flag is set to 1.

Now, with the new code, we cycle through each available schma type until we find
one that works.  We then squirrel away the information on which schema works so
that we don't have to try every one in succession for future lookups.

Given that the new behaviour seems to work, it is actually preferrable to use
it.  I will, however, fix the fallback behaviour.

> Will a new package be available which maintains the existing default behavior
> without requiring changes to the /etc/sysconfig/autofs file ?

Yes, as I stated above.
Comment 7 greg matthews 2007-05-11 11:48:58 EDT
This bit us too after an up2date. Can confirm that OLD_LDAP_LOOKUP=0 gets it
working again.

Comment 8 Chris Van Hoof 2007-06-01 11:32:31 EDT
*** Bug 242071 has been marked as a duplicate of this bug. ***
Comment 10 Jeffrey Moyer 2007-07-23 14:14:11 EDT
Created attachment 159799 [details]
Handle the return code of CHE_MISSING properly in lookup_one.

This patch fixes the problem in my test environment.
Comment 12 RHEL Product and Program Management 2007-07-23 14:18:56 EDT
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.
Comment 15 Jeffrey Moyer 2007-07-24 16:02:57 EDT
A fix for this bug was committed to autofs version 4.1.3-226.
Comment 18 Jeffrey Moyer 2007-09-03 08:29:07 EDT
This patch is missing parenthesis, which changes the result of the calculation.
 It needs to be fixed.
Comment 19 Jeffrey Moyer 2007-09-04 13:11:22 EDT
Created attachment 186341 [details]
Fix up broken logic statement
Comment 22 Jeffrey Moyer 2007-09-05 14:57:57 EDT
A fix for this issue was committed to autofs version 4.1.3-231.
Comment 26 errata-xmlrpc 2007-11-15 11:02:20 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0734.html

Note You need to log in before you can comment on or make changes to this bug.