TypeError: 'NoneType' on every kind of file upload

Bug #1101621 reported by Yurif
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

When I try to upload a file I get an error. It doesn't matter where I upload it. When I for example try to upload a file as mail attachment an error shows up in the upper right corner, when I try to attach a file via the document management system module it's just loading forever and nothing happens.

The error in the errorlog hover is always nearly the same:

2013-01-18 23:29:27,689 60122 ERROR openerp_db openerp.addons.document.content_index: Cannot index file Test_PDF.pdf (None).
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/document/content_index.py", line 181, in doIndex
    res = (mime, fobj.indexContent(content,filename,fname or realfname) )
  File "/usr/lib/pymodules/python2.7/openerp/addons/document/content_index.py", line 90, in indexContent
    res = self._doIndexFile(rfname)
  File "/usr/lib/pymodules/python2.7/openerp/addons/document/std_index.py", line 169, in _doIndexFile
    pop = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
2013-01-18 23:29:27,690 60122 ERROR openerp_db openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/addons/document/document.py", line 121, in create
    vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None)
  File "/usr/lib/pymodules/python2.7/openerp/addons/document/document.py", line 132, in _index
    mime, icont = cntIndex.doIndex(data, datas_fname, file_type or None, None)
TypeError: 'NoneType' object is not iterable
2013-01-18 23:29:27,691 60122 ERROR openerp_db openerp.netsvc: 'NoneType' object is not iterable
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 289, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 169, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 123, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 179, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 166, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/addons/document/document.py", line 121, in create
    vals['file_type'], vals['index_content'] = self._index(cr, uid, vals['datas'].decode('base64'), vals.get('datas_fname', False), None)
  File "/usr/lib/pymodules/python2.7/openerp/addons/document/document.py", line 132, in _index
    mime, icont = cntIndex.doIndex(data, datas_fname, file_type or None, None)
TypeError: 'NoneType' object is not iterable
2013-01-18 23:29:27,693 60122 INFO openerp_db werkzeug: 10.0.10.4 - - [18/Jan/2013 23:29:27] "POST /web/binary/upload_attachment HTTP/1.1" 200 -

The upload itself looks like it would work. In Chrome I see the progress for the file upload on the bottom left corner behaving normally and at 100% the openERP error shows up.

My first guess would be there are some file permissions missing but I don't really know were to start looking (my only try so far was to give the openerp user full access to /usr/lib/pymodules/python2.7/openerp/ and all subdirectories and that didn't change anything).
I installed openERP (7.0-20130118-002240) via apt-get from the repository at http://nightly.openerp.com/7.0/nightly/deb/ which was very painless but maybe is responsible for this.

Sorry if this bug report should be at the wrong place here.. I wasn't very sure where to put it.

Revision history for this message
Yurif (yurif) wrote :

Oh, I forgot to mention that my server is a Ubuntu Server 12.04.1 (GNU/Linux 3.2.0-34-generic x86_64).

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Yurif,

You would need to install poppler-utils!

Thanks.

Revision history for this message
Yurif (yurif) wrote :

Thanks for the super fast reply! Problem solved :d

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Welcome Yurif!

Feel free to post your questions!

Revision history for this message
Onur Başer - openerp.biz.tr (onur-bit) wrote :

Thank you! I got the same problem with Openerp 7.0.
Now it works!
Best Regards.

Revision history for this message
Alan Paul Stadnik (alan-8) wrote :

Hi,
I thing that I got the same or similar problem, but it's not fixable with installing popper-utils.
At time it's impossible to attache a file to massages or prducts etc.

I'm running a Ubuntu 12.04 system with openerp 7.0 (trunk 04.02.2013)

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.