From: Peter Staubach <staubach@redhat.com>
To: Tom H <tom-6kxvdouIZplzjhtm8Ag3mw@public.gmane.org>
Cc: nfs@lists.sourceforge.net
Subject: Re: [NFS] Stale NFS file handle error
Date: Fri, 11 Jul 2008 08:50:28 -0400 [thread overview]
Message-ID: <48775714.6090107@redhat.com> (raw)
In-Reply-To: <48774466.508-6kxvdouIZplzjhtm8Ag3mw@public.gmane.org>
Tom H wrote:
> Hi,
>
> I have been intermittently seeing a "Stale NFS file handle" error from a
> Java app we use to resize images and save them to a file on an NFS
> mounted directory.
>
> An example of the code in Java is;
>
> File outputFile = new File(outputDir, (new
> StringBuilder()).append(filePrefix).append(ifile.getName()).toString());
> BufferedImage large = ImageIO.read(inputFile);
> BufferedImage scaled = scale(large, width, height);
> ImageIO.write(scaled, "jpg", outputFile);
>
> And about once in every 10 thousand writes, it throws the following error;
>
> java.io.IOException: Stale NFS file handle
> at java.io.RandomAccessFile.close(RandomAccessFile.java:573)
> at
> javax.imageio.stream.FileImageOutputStream.close(FileImageOutputStream.java:160)
> at javax.imageio.ImageIO.write(ImageIO.java:1519)
> at com.hz.pagemill.process.ImageScaler.scale(ImageScaler.java:47)
>
> The NFS3 protocol specification defines a Stale File handle error as
> follows; (http://tools.ietf.org/html/rfc1813)
>
> NFS3ERR_STALE
> Invalid file handle. The file handle given in the
> arguments was invalid. The file referred to by that file
> handle no longer exists or access to it has been
> revoked.
>
> The way the code works prevents 2 processes creating the same file, so I
> am pretty sure that whatever is moving, renaming or deleting the file is
> not part of the java app.
>
> We are running the default nfs server with RHEL4;
> [root@aspdb01 ~]# modinfo nfsd
> filename: /lib/modules/2.6.9-55.0.9.ELsmp/kernel/fs/nfsd/nfsd.ko
> license: GPL
> author: Olaf Kirch <okir-pn4DOG8n3UYbFoVRYvo4fw@public.gmane.org>
> depends: sunrpc,exportfs,lockd,nfs_acl
> vermagic: 2.6.9-55.0.9.ELsmp SMP gcc-3.4
>
> with the following export options;
> [root@aspdb01 ~]# cat /etc/exports
> /myshareZZZ *(rw,sync,no_root_squash,no_subtree_check)
>
> (I have tried it with, and without no_subtree_check)
>
> I was hoping to get some pointers on debugging the issue.
Are you sure that you don't have two (or more) different NFS
clients working in the same directory?
The ESTALE error usually occurs when a change is made on the
server to something that a client is accessing, perhaps
directly on the server or more commonly, by a different NFS
client.
ps
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that nfs@lists.sourceforge.net is being discontinued.
Please subscribe to linux-nfs@vger.kernel.org instead.
http://vger.kernel.org/vger-lists.html#linux-nfs
next prev parent reply other threads:[~2008-07-11 12:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-11 11:30 [NFS] Stale NFS file handle error Tom H
[not found] ` <48774466.508-6kxvdouIZplzjhtm8Ag3mw@public.gmane.org>
2008-07-11 12:50 ` Peter Staubach [this message]
2008-07-11 13:23 ` Tom H
[not found] ` <48775EBC.4090008-6kxvdouIZplzjhtm8Ag3mw@public.gmane.org>
2008-07-11 13:38 ` Peter Staubach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48775714.6090107@redhat.com \
--to=staubach@redhat.com \
--cc=nfs@lists.sourceforge.net \
--cc=tom-6kxvdouIZplzjhtm8Ag3mw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox