[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-17 Thread Frank Thommen

Frank Thommen added the comment:

strace gives me the error:

  unlink(/mnt/tmpu817xz) = -1 EIO (Input/output error)

But after escalating the issue to our server vendor it turned out that the 
problem lies in the filesystem option nbmand.  If this option is set to on 
- which it seems to be by default on our zfs filesystems - and the filesystem 
is exported and mounted with NFS v4, then tempfile.TemporaryFile fails:

[...]
V4 Call (Reply In 167) RENAME From: tmpr0OaMb To: .nfs0027af65
V4 Reply (Call In 166) RENAME Status: NFS4ERR_FILE_OPEN
[...]

I assume that this is nothing Python can check for and therefore not a Python 
problem.

Not sure what the policy is: Can I set the ticket to solved myself?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-17 Thread STINNER Victor

STINNER Victor added the comment:

   unlink(/mnt/tmpu817xz) = -1 EIO (Input/output error)

If a system call can fail with EIO, I guess that not only Python is affected, 
by *any* program. So I don't see why Python should have a special case for 
broken filesystems.

I close the issue as not a bug.

--
resolution:  - not a bug
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-10 Thread STINNER Victor

STINNER Victor added the comment:

 It becomes then still a Python problem, as tempfile.TemporaryFile is not 
 generally usable any more.

Well, it looks like you are the first one to complain, whereas the module is at 
least 10 years old. So it looks more like an issue in your setup (as you 
wrote), than a bug in Python.

Which syscalls fails with errno 5? Can you run your example with strace to 
identify the syscall?

*If* a patch should be written, we need to identify which Python line should be 
modified.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-09 Thread Frank Thommen

Frank Thommen added the comment:

It might be an issue of strict ACL mapping 
(http://wiki.linux-nfs.org/wiki/index.php/ACLs) is implemented.  On our ZFS 
based NFS v4 server this is the case, on CentOS based NFS v4 servers this 
doesn't seem to be implemented/enforced.

It becomes then still a Python problem, as tempfile.TemporaryFile is not 
generally usable any more.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-02 Thread Frank Thommen

New submission from Frank Thommen:

Hi,

tempfile.TemporaryFile fails on NFS v4 filesystems.

Assume the following mounts:

$ mount
[...]
psi:/volumes/vol1 on /mnt/nfsv4 type nfs4 (rw,addr=xx.xx.xx.xx)
psi:/volumes/vol1 on /mnt/nfsv3 type nfs (rw,addr=xx.xx.xx.xx)
[...]
$

and the following script testtmpfile.py:

---
#! env python

import tempfile

def _is_writable_dir_unnamed(p):
try:
t = tempfile.TemporaryFile(dir=p)
t.write('1')
t.close()
except OSError: return False
else: return True


def _is_writable_dir_named(p):
try:
t = tempfile.NamedTemporaryFile(dir=p)
t.write('1')
t.close()
except OSError: return False
else: return True



if not _is_writable_dir_unnamed(.):
print (unnamed) . is not writable
else:
   print (unnamed) OK


if not _is_writable_dir_named(.):
print (named) . is not writable
else:
   print (named) OK
---


Then you'll find the following behaviour:

$ pwd
/mnt/nfsv4
$ /g/software/bin/python-2.7 /tmp/testtmpfile.py 
(unnamed) . is not writable
(named) OK
$

$ pwd
/mnt/nfsv3
$ /g/software/bin/python-2.7 /tmp/testtmpfile.py 
(unnamed) OK
(named) OK
$

Additionally in the failing case, a - writable - temporary file named tmp* is 
left in the directory.

Observed on CentOS 5.10 with kernel 2.6.18-371.11.1.el5 and on CentOS 6.5 with 
kernel 2.6.32-431.23.3.el6.x86_64.

The problem appears with Python 2.4, 2.6 and 2.7.


Cheers
frank

--
messages: 226271
nosy: drosera
priority: normal
severity: normal
status: open
title: tempfile.TemporaryFile fails on NFS v4 filesystems
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-02 Thread R. David Murray

R. David Murray added the comment:

What is the actual OSError raised?

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-02 Thread Frank Thommen

Frank Thommen added the comment:

errno:5
strerror: Input/output error

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-02 Thread STINNER Victor

STINNER Victor added the comment:

I tried on my Fedora 20 (Linux, kernel 3.14.8-200.fc20.x86_64) and I'm unable 
to reproduce the issue.

$ sudo mkdir /test
$ sudo chown haypo: /test
$ echo /test *(rw)  /etc/exports
$ sudo exportfs -af
$ sudo mount -t nfs localhost:/test nfs
$ cat  x.py
copy/paste the code from the first message of this issue
$ python x.py
(unnamed) OK
(named) OK
$ mount|grep nfs
localhost:/test on /home/haypo/nfs type nfs4 
(rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp6,port=0,timeo=600,retrans=2,sec=sys,clientaddr=::1,local_lock=none,addr=::1)
$ python -V
Python 2.7.5

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22326] tempfile.TemporaryFile fails on NFS v4 filesystems

2014-09-02 Thread Frank Thommen

Frank Thommen added the comment:

Agreed.  If I export from CentOS and mount on CentOS (local or remote) it seems 
to work.  So this is probably due to our specific fileserver setup or a problem 
of the underlying filesystem (zfs).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22326
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com