Bug 462266

Summary: autofs with map file auto.nis not working, error: automount master_error: syntax error while parsing map
Product: Red Hat Enterprise Linux 4 Reporter: Ian Kent <ikent>
Component: autofs5Assignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 4.7CC: ikent, jmoyer, kvolny, mgahagan
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-18 20:30:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Kent 2008-09-15 03:14:22 UTC
+++ This bug was initially created as a clone of Bug #435960 +++

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080208 Fedora/2.0.0.12-1.fc8 Firefox/2.0.0.12

Description of problem:
I have clean installation of Rhel 5.1 tor testing, I have setup autofs to mount home folders for nisusers. When I name my map file auto.nis (as I used to do in Rhel 5) I'm getting error in /var/log/messages "automount[3141]: master_error: syntax error while parsing map" when i restart autofs service.
After changing name of map file to anything else (auto.home, auto.guests, auto.direct, auto.agob, auto.fazula, ... I have tried coule of them) It is working, except auto.nis
After changing back to auto.nis it stop working agin.
And of course I restarted autofs service after changing configs.
For testing purposes firewalls and selinux is off on server and clients.

It is not big deal but i have spend 3days to figure out that this is the problem, I didn't expect this to be a issue as it was working in Rhel5.
Please can you reproduce and confirm that it actually is a BUG? I will appreciate it. Thanks

My /etc/auto.master contain:
/misc   /etc/auto.misc
/net    -hosts
/nishome        /etc/auto.home --timeout 60
+auto.master

/etc/auto.nis contain:
*       -rw,soft,intr   192.168.122.1:/nishome/&

I have copied other map files with different names from auto.nis so they are exactly the same.

#ls -la /etc/auto.*

-rw-r--r-- 1 root root   42 Mar  3 10:32 /etc/auto.agob
-rw-r--r-- 1 root root  112 Feb 29 18:47 /etc/auto.direct
-rw-r--r-- 1 root root   42 Mar  3 10:37 /etc/auto.fazula
-rw-r--r-- 1 root root   42 Mar  3 10:29 /etc/auto.guests
-rw-r--r-- 1 root root   42 Mar  4 17:35 /etc/auto.home
-rw-r--r-- 1 root root   83 Mar  4 17:46 /etc/auto.master
-rw-r--r-- 1 root root  581 Sep 25 16:20 /etc/auto.misc
-rwxr-xr-x 1 root root 1292 Sep 25 16:20 /etc/auto.net
-rw-r--r-- 1 root root   42 Feb 29 18:17 /etc/auto.nis
-rwxr-xr-x 1 root root  715 Sep 25 16:20 /etc/auto.smb





Version-Release number of selected component (if applicable):
autofs-5.0.1-0.rc2.55

How reproducible:
Always


Steps to Reproduce:
1. change name of the map file to auto.nis
2. restart autofs service
3. 

Actual Results:
when logging in wwith nisuser, home folder is not mounted 

Expected Results:
mount the folders when nisuser log in

Additional info:
client is Rhel 5.1 installed from DVD with ho updates,
error message in /var/log/messages is: automount[3141]: master_error: syntax error while parsing map

/etc/auto.master contain:
/misc   /etc/auto.misc
/net    -hosts
/nishome        /etc/auto.home --timeout 60
+auto.master

/etc/auto.nis contain:
*       -rw,soft,intr   192.168.122.1:/nishome/&

--- Additional comment from jmoyer on 2008-03-04 12:34:34 EDT ---

Your master map doesn't reference auto.nis at all, so I cannot follow your
problem description.  I tried to reproduce this locally (replacing the /nishome
/etc/auto.home with the map /etc/auto.nis), but without success.

Note that you should apply all available kernel updates, as the 5.1 kernel has a
bug with autofs that keeps it from mounting on first access.

After you've updated your kernel, please collect debugging information as
outlined on the following web pages:
  http://people.redhat.com/jmoyer/

Thanks.

--- Additional comment from gmatus on 2008-03-04 13:35:29 EDT ---

hi sorry,

I copied the auto.master after i have edited and tried with auto.home which worked.

Please tried it this way

it should be 

/etc/auto.master contain:
/misc   /etc/auto.misc
/net    -hosts
/nishome        /etc/auto.nis --timeout 60
+auto.master

thanks
Matus

--- Additional comment from jmoyer on 2008-03-04 13:42:39 EDT ---

(In reply to comment #2)
> hi sorry,
> 
> I copied the auto.master after i have edited and tried with auto.home which
worked.
> 
> Please tried it this way
> 
> it should be 
> 
> /etc/auto.master contain:
> /nishome        /etc/auto.nis --timeout 60

As I mentioned, I already did try it this way and it worked for me.  Now please
provide the information I requested in comment #1.

Thanks.

--- Additional comment from gmatus on 2008-03-04 13:56:27 EDT ---

sorry again, bit tired and didn't read your post properly

I cannot upgrade kernel as this environment is for training purposes and I don't
have redhat subscription.
Also need to confirm that as bug if you can. 

This message I got after enabling debug logging

Mar  4 19:51:24 station1 automount[4028]: Starting automounter version
5.0.1-0.rc2.55, master map auto.master
Mar  4 19:51:24 station1 automount[4028]: using kernel protocol version 5.00
Mar  4 19:51:24 station1 automount[4028]: master_error: syntax error while
parsing map.
Mar  4 19:51:24 station1 automount[4028]: master_notify: syntax error in map
near [ bogus option ]
Mar  4 19:51:24 station1 automount[4028]: lookup_read_master: lookup(yp): read
of master map auto.master failed: Internal NIS error
Mar  4 19:51:24 station1 automount[4028]: lookup_read_master: lookup(file):
failed to read included master map auto.master

Thanks

--- Additional comment from jmoyer on 2008-03-04 14:17:57 EDT ---

(In reply to comment #4)
> I cannot upgrade kernel as this environment is for training purposes and I don't
> have redhat subscription.
> Also need to confirm that as bug if you can. 

I'm not sure what you're asking.  You will definitely run into problems with the
5.1 kernel.

> This message I got after enabling debug logging
> 
> Mar  4 19:51:24 station1 automount[4028]: Starting automounter version
> 5.0.1-0.rc2.55, master map auto.master
> Mar  4 19:51:24 station1 automount[4028]: using kernel protocol version 5.00
> Mar  4 19:51:24 station1 automount[4028]: master_error: syntax error while
> parsing map.
> Mar  4 19:51:24 station1 automount[4028]: master_notify: syntax error in map
> near [ bogus option ]

Yeah, okay, I reproduced it.  It is barfing on "--timeout 60".  You can work
around this by specifying "--timeout=60".  This was fixed in:

* Wed Oct 24 2007 Ian Kent <ikent> - 5.0.1-0.rc2.56
- Bug 332181: [RHEL4] autofs initscript doesn't support '--timeout' with whitespace

So updating autofs will fix this issue.

*** This bug has been marked as a duplicate of 332181 ***

--- Additional comment from gmatus on 2008-03-04 14:37:25 EDT ---

hi, 
but even with specifying --timeout=60 still can not mount folders at all, if I'm
using map file with name auto.nis, but changing name to auto.something and
changing map file to auto.something in auto.master than the mounting is working
(at second time but working)
I know that is not big issue, but need to find out if this is known behavior of
Autofs5.0.1-0.rc2.55

Mar  4 20:22:33 station1 automount[4146]: Starting automounter version
5.0.1-0.rc2.55, master map auto.master
Mar  4 20:22:33 station1 automount[4146]: using kernel protocol version 5.00
Mar  4 20:22:33 station1 automount[4146]: lookup_read_master: lookup(yp): read
of master map auto.master failed: Internal NIS error
Mar  4 20:22:33 station1 automount[4146]: lookup_read_master: lookup(file):
failed to read included master map auto.master
Mar  4 20:22:33 station1 automount[4146]: mounted indirect mount on /misc with
timeout 300, freq 75 seconds
Mar  4 20:22:33 station1 automount[4146]: ghosting enabled
Mar  4 20:22:33 station1 automount[4146]: mounted indirect mount on /net with
timeout 300, freq 75 seconds
Mar  4 20:22:33 station1 automount[4146]: ghosting enabled
Mar  4 20:22:33 station1 automount[4146]: lookup_read_map: lookup(yp): read of
map /nishome failed: Request arguments bad
Mar  4 20:22:33 station1 automount[4146]: mount_autofs_indirect: failed to read
map for /nishome
Mar  4 20:22:33 station1 automount[4146]: handle_mounts: mount of /nishome failed!
Mar  4 20:22:33 station1 automount[4146]: master_do_mount: failed to startup mount
Mar  4 20:25:28 station1 automount[4146]: lookup_read_master: lookup(yp): read
of master map auto.master failed: Internal NIS error
Mar  4 20:25:28 station1 automount[4146]: lookup_read_master: lookup(file):
failed to read included master map auto.master
Mar  4 20:25:28 station1 automount[4146]: lookup_read_map: lookup(yp): read of
map /nishome failed: Request arguments bad
Mar  4 20:25:28 station1 automount[4146]: mount_autofs_indirect: failed to read
map for /nishome
Mar  4 20:25:28 station1 automount[4146]: handle_mounts: mount of /nishome failed!
Mar  4 20:25:28 station1 automount[4146]: master_do_mount: failed to startup mount 

--- Additional comment from jmoyer on 2008-03-04 14:57:40 EDT ---

OK, then we're looking at more than one problem.

Sure enough, the automount daemon thinks that the map source is nis when it is
actually a file map.  Hmm, updating to a newer version of autofs shows this in
the debug logs:

Mar  4 14:36:15 sig11 automount[21623]: lookup_nss_read_map: reading map nis
/etc/auto.--timeout=60

Sorry it took me so long to come around.  It's probably a bug in the tokenizer.
 Ian probably can identify it pretty quickly.

--- Additional comment from ikent on 2008-03-04 21:29:01 EDT ---

Yep, quite likely.
I'll have a look soon as I can.

Ian


--- Additional comment from ikent on 2008-03-05 23:00:15 EDT ---

Created an attachment (id=296991)
Patch to prevent tokenizer getting confused with map type in map name

I think this is reasonable since the map type and the
multi map separator "must" be preceded by white space.

I'll need to do more testing but the patch is here
in case anyone else is able to test it. It may not
apply cleanly to older revisions so if it is needed
and there is any confusion I'll produce one for the
revision needed.

Ian


--- Additional comment from ikent on 2008-03-05 23:06:11 EDT ---

Created an attachment (id=296992)
Correction for the map type in map name patch

Oops!

--- Additional comment from ikent on 2008-03-05 23:12:34 EDT ---

Created an attachment (id=296994)
And another correction

Crikey!

--- Additional comment from ikent on 2008-03-29 23:52:16 EDT ---

Created an attachment (id=299606)
Patch to prevent tokenizer getting confused with map type in map name

Yet another try at getting this right.

--- Additional comment from pm-rhel on 2008-06-02 16:15:53 EDT ---

This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 1 RHEL Program Management 2008-09-24 20:24:33 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 6 errata-xmlrpc 2009-05-18 20:30:55 UTC
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 therefore 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-2009-1010.html