[RC3] Permission denied: '/filestore'

Bug #320126 reported by Christophe CHAUVET
2
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Server revno: 1632
Addons revno: 2146

On a new server, after install all dependencies
- openerp-server is launch by a specific user "oerp" as single user (no admin role)
- create new database with service profile, add logo on company wizard
- log in with admin
- go to Financial Management -> Invoices
- select the only invoice and click on "Invoice" to print it.
This message appear.

--------------8<---------------8<-------------
Traceback (most recent call last):
  File "/home/oerp/openerp/openerp/server/bin/service/web_services.py", line 585, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/home/oerp/openerp/openerp/server/bin/report/report_sxw.py", line 638, in create
    }, context=context
  File "/home/oerp/openerp/stable/server/bin/addons/document/document.py", line 645, in create
    result = super(document_file,self).create(cr, uid, vals, context)
  File "/home/oerp/openerp/stable/server/bin/addons/base/ir/ir_attachment.py", line 80, in create
    return super(ir_attachment, self).create(cr, uid, values, *args, **kwargs)
  File "/home/oerp/openerp/openerp/server/bin/osv/orm.py", line 2396, in create
    self._columns[field].set(cr, self, id_new, field, vals[field], user, context)
  File "/home/oerp/openerp/openerp/server/bin/osv/fields.py", line 639, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)
  File "/home/oerp/openerp/stable/server/bin/addons/document/document.py", line 512, in _data_set
    os.makedirs(path)
  File "/usr/lib/python2.5/os.py", line 164, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.5/os.py", line 171, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/filestore'
--------------8<---------------8<-------------

Distribution: Ubuntu
Version: 8.04 (hardy)
Python 2.5.2

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

If you install document management module, you must have write access on the filesystem to use reports and attachments.

Changed in openobject-server:
status: New → Invalid
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

ok but why install it on /filestore and not on server/bin/filestore
I don't want to launch my server with root account to create the path filestore on /

Changed in openobject-server:
status: Invalid → New
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

A good method is ti put this path on the config file

[option]
filestore=/home/oerp/filestore

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

I think it's not a good solution, because if you lose the config file, your filestore will be wrong.

So I prefer to use a symlink to a directory, no need to change the config file.

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

It's not in /, it's in the server directory: os.path.join(os.getcwd(), "filestore", cr.dbname)

Changed in openobject-server:
status: New → Invalid
Revision history for this message
Christophe Simonis (OpenERP) (kangol) wrote :

In fact, it may.
os.getcwd() depend from where the script is called.

mbp-chris:tmp chris$ cat bug320126.py
#!/usr/bin/python
import os
print os.getcwd()

mbp-chris:tmp chris$ ./bug320126.py
/private/tmp
mbp-chris:tmp chris$ mkdir foo
mbp-chris:tmp chris$ cd foo/
mbp-chris:foo chris$ ../bug320126.py
/private/tmp/foo
mbp-chris:foo chris$

Revision history for this message
Christophe Simonis (OpenERP) (kangol) wrote :

fixed

Changed in openobject-server:
status: Invalid → Fix Released
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Ok i understand

My server is configure as a production server, i create a spécifique user, and adapt an initd script to launch OpenERP Server with invoke-rc.d command.

That's why it try to install in /

Thanks for the fix.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.