permissions problem writing file from External Method?
My Zope v2.6.2 ExternalMethod is giving me an error when I try to open a file for writing. Error: Module /home/zope/Zope/Extensions/notifyAdt.py, line 88, in seqPut IOError: [Errno 13] Permission denied: '/home/lii/logs/notifyAdtSeq.txt' That line of code: sf = open(path+seqFile,'w') (Since this code is also run outside Zope I just use a little file to hold a single value that I want to persist over time - it gets incremented each time.) I think I've made the file as available as possible. -rwxrwxrwx 1 lii lii 1 Oct 27 13:39 notifyAdtSeq.txt Any idea what's going wrong here?
Bill Seitz wrote:
My Zope v2.6.2 ExternalMethod is giving me an error when I try to open a file for writing.
Error: Module /home/zope/Zope/Extensions/notifyAdt.py, line 88, in seqPut IOError: [Errno 13] Permission denied: '/home/lii/logs/notifyAdtSeq.txt'
That line of code: sf = open(path+seqFile,'w')
(Since this code is also run outside Zope I just use a little file to hold a single value that I want to persist over time - it gets incremented each time.)
I think I've made the file as available as possible. -rwxrwxrwx 1 lii lii 1 Oct 27 13:39 notifyAdtSeq.txt
I'm guessing that the user as whom Zope is running needs to have write access to the directory where the 'open' takes place (but that is just a guess). Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
I've checked that * zope is running as user=zope (which is the sole member of group=zope) * the attributes of the folder I'm trying to write into are: drwxrwxrwx 2 lii lii 4096 Oct 28 09:41 logs Shouldn't that be fine? Tres Seaver wrote:
Bill Seitz wrote:
My Zope v2.6.2 ExternalMethod is giving me an error when I try to open a file for writing.
Error: Module /home/zope/Zope/Extensions/notifyAdt.py, line 88, in seqPut IOError: [Errno 13] Permission denied: '/home/lii/logs/notifyAdtSeq.txt'
That line of code: sf = open(path+seqFile,'w')
(Since this code is also run outside Zope I just use a little file to hold a single value that I want to persist over time - it gets incremented each time.)
I think I've made the file as available as possible. -rwxrwxrwx 1 lii lii 1 Oct 27 13:39 notifyAdtSeq.txt
I'm guessing that the user as whom Zope is running needs to have write access to the directory where the 'open' takes place (but that is just a guess).
Tres.
Bill Seitz wrote:
I've checked that * zope is running as user=zope (which is the sole member of group=zope) * the attributes of the folder I'm trying to write into are: drwxrwxrwx 2 lii lii 4096 Oct 28 09:41 logs
Shouldn't that be fine?
Try the following: # su - zope $ touch /home/lii/logs/notifyAdtSeq.txt If that fails, then I would look at '/home/lii', and ensure that the zope user has execute on that directory (the user needs that permission to be able to traverse a directory). If that *doesn't* fail, then I am out of ideas. An OS-level permission error is the only thing which explains the traceback you saw. Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
It smells like the issue was with restrictive permissions on the higher-level folders. One I loosened that up a little, things started working. thx Tres Seaver wrote:
Bill Seitz wrote:
I've checked that * zope is running as user=zope (which is the sole member of group=zope) * the attributes of the folder I'm trying to write into are: drwxrwxrwx 2 lii lii 4096 Oct 28 09:41 logs
Shouldn't that be fine?
Try the following:
# su - zope $ touch /home/lii/logs/notifyAdtSeq.txt
If that fails, then I would look at '/home/lii', and ensure that the zope user has execute on that directory (the user needs that permission to be able to traverse a directory).
If that *doesn't* fail, then I am out of ideas. An OS-level permission error is the only thing which explains the traceback you saw.
Tres.
participants (2)
-
Bill Seitz -
Tres Seaver