1827280 Members
2864 Online
109717 Solutions
New Discussion

file lock error

 
SOLVED
Go to solution
Lars Blumenthal
Advisor

file lock error

Good Morning,
we have trouble saving files from HPUX 11 (with Catia or a simple test prog) over NFS on a Windows XP Client with Services for Unix running.
Other applications or a normal cp works fine.
AFAIK depends the problem on file locking (rpc.lockd), that's seems to be different on HPUX. Saving files with Catia/SUN on the windows machine works!
Logfile from rpc.lockd (HP)
----cut----
/usr/sbin/rpc.lockd
/usr/sbin/rpc.lockd: Succesful bind to P.Port
10.09 13:51:05 tc51 pid=899 /usr/sbin/rpc.lockd
/usr/sbin/rpc.lockd: unknown lock return: 9
10.09 14:15:06 tc51 pid=899 /usr/sbin/rpc.lockd
Note ::: Last 1 Messages Repeated 73 times (sum total)

----cut----

Logfile SfU:
----cut----
10-08-2003 12:47:11 LOCK FAILURE 10.233.16.51 \DosDevices\C:\Home\hugo\HUGO.model
10-08-2003 12:47:31 LOCK FAILURE 10.233.16.51 \DosDevices\C:\Home\hugo\HUGO.model
10-08-2003 12:47:51 LOCK FAILURE 10.233.16.51 \DosDevices\C:\Home\hugo\HUGO.model
10-08-2003 12:48:11 LOCK FAILURE 10.233.16.51 \DosDevices\C:\Home\hugo\HUGO.model
10-08-2003 12:48:31 LOCK FAILURE 10.233.16.51 \DosDevices\C:\Home\hugo\HUGO.model
10-08-2003 12:49:50 LOCK FAILURE 10.233.16.51 \DosDevices\C:\Home\hugo\test.model
10-08-2003 12:50:00 LOCK FAILURE 10.233.16.51 \DosDevices\C:\Home\hugo\test.model
10-08-2003 12:50:10 LOCK FAILURE 10.233.16.51 \DosDevices\C:\Home\hugo\test.model
----cut----

thx for help
12 REPLIES 12
Massimo Bianchi
Honored Contributor

Re: file lock error

Hi,
apart from a good NFS/ONC patch, i suggest you to check the kernel parameter nflocks, it could very well be a problem of nflock table full.

Massimo
Steven E. Protter
Exalted Contributor

Re: file lock error

Massimo's suggestion is excellent.

Is it possible that the file in question actually is locked by another user?

That would explain the behavior. Or a second copy of the same program running.

If its a kernel problem, other attempts to open and lock files should also fail.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kent Ostby
Honored Contributor

Re: file lock error

"/usr/sbin/rpc.lockd: unknown lock return: 9
"

Not sure what version of HP-UX or NFS you are running, but this essentially means that the protocal on one machine is returning a lock status ("9") that is unknown to the system where the error message is appearing.

So this is a protocol or version mismatch in NFS. A patch of rpc.lockd and NFS may help this out.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Lars Blumenthal
Advisor

Re: file lock error

thx for response
Unfortunately my problem is still there :-(
- latest nfs/onc patches are installed
- latest lockd patches are installed
- increased nflocks to 400 (good choice?)
- the prog do not run twice an the same time
- the file is not lock by any another user/process

any other ideas?

thx
lars
Todd Whitcher
Esteemed Contributor
Solution

Re: file lock error

Hello,
I have attached a simple locking program you can use to test outside of your application on the HPUX NFS client.

* Compile this program on the nfs client using :
*
* cc locktest.c -o locktest
*
* Then run the executable passing the name of a file that
* is located on your nfs server, such as:
*
* ./locktest /nfs/server/testfile
*
* If file locking is working correctly, the output will look like:
*
* Open OK
* Locking...OK
*
* If you do not see the "OK" after the "Locking..." then you have
* a file locking problem. The typical symptom would be that the program
* will not complete, but will just hang afetr the "Locking...".

Example:
./locktest /HAdumps/testlock
Open OK
Locking...OK

If this works you have to dig further into your application, if this fails you have a general locking issue.

First of all, 99% of locking issues come down to name resolution problems. Make sure the XP server resolves the HP forward and reverse addresses the same way the HP resolves ( FQHN or Short names ). IF there is a mismatch the locking protocol on the NFS server will typically fail to allow the lock.

If the name resolution is correct then the next step is to debug with a network trace and debug logging on rpc.lockd and rpc.statd on the HP client and the XP server.

NOTE: I'd suggest if the locktest program fails you contact HP Support to assist with the debug of your lock issue.

DEBUGGING LOCK PROBLEMS:

On the HP you can "toggle" debug on via the SIGUSR2 signal ( kill -17 ) to the PID of the running rpc.lockd & rpc.statd, toggle it off w/ the same signal.

For a network trace you can use something like ethereal or netmon on the XP and use nettl on the HP side. You would want to capture the network traffic on both sides for the best results

For the HP side you can do this:

Start nettl tracing at IP layer:
# /usr/sbin/nettl -tn pduin pduout -e ns_ls_ip -s 1024 -tm 99999 -f out_file

Reproduce the lock failure, use the
lockprogram for example.

#./locktest /nfs/server/testfile

Stop your trace

# /usr/sbin/nettl -tf -e all

This is going to create a out_file.TRCXXX file which you can view with the netfmt command.

Create a filter file:

# cat filter_file
filter rpcdirection call
filter rpcdirection reply

Then format it out

# /usr/sbin/netfmt -Nnlf out_file.TRCXXX -c filter > trace.out

You can view the trace.out and look for lock issues.

Hope this helps,

Todd
Lars Blumenthal
Advisor

Re: file lock error

The result:
A patch from Microsoft was needed an it just works well with Win2000.
At the end it is an error in the NLM (Network Lock Mananger) between HPUX and Windows

thx for your help

Lars
Kohei Mochizuki
New Member

Re: file lock error

I have the same problem.
My PC is Windows 2000 Professional(Service Pack 4).
Please Tell me the number of the patch that works well windows 2000.

Best Reagrds.
Kohei Mochizuki
G.J.Laanstra
New Member

Re: file lock error

Hello there,

I've stumbled on the same problem,
Lars could you tell me, how to get the patch for Network Lock Mananger ?

I've tried the SFU v3.5, the problem stay's.........

thx,

Geert Jan Laanstra
Kohei Mochizuki
New Member

Re: file lock error

Hello,

I've solved this problem.
I received Microsoft Professional Support.
This service is fare-paying services.
At first, I got a hotfix(Patch) from microsoft, however the error wasn't solved by the hotfix. Next, I got the instruction to change a registry. The registry is to avoid the file lock mandatorily. Hereby, I was able to open a file on my application, though the application had a error internally.
Please contact Microsoft about the detail.
Lars Blumenthal
Advisor

Re: file lock error

Hello Geert,

Kohei is right!
You must have a service contract with Microsoft.
Unfortunately I have just the patch for SfU3.0.

Good Luck :-)

Lars
G.J.Laanstra
New Member

Re: file lock error

Dear Lars,

Could you send me the patch for V3.0 as well ? That would help me.....
I've asked one of our IT people to get the one for V3.5.

I've also tested a competative product :
Hummingbird NFS Server

It looks like this one works okay (for now)

thx, ;-)

Geert Jan Laanstra
G.J.Laanstra
New Member

Re: file lock error

Hello,

It looks like that the patch is already included in version V3.5.
After installing the only thing i had to do was to deactivate the EnableSMBLocking entry, see KB328858.
For SFU V3.0 you'll need the additional hotfix 329072.

SFU V3.5 works fine now........

thx

Geert Jan Laanstra