inveniosoftware / troubleshooting

DEPRECATED - Use the forum instead:
https://invenio-talk.web.cern.ch
5 stars 4 forks source link

invenio 1.2, python permission denied #26

Open Atisom opened 6 years ago

Atisom commented 6 years ago

Dear Invenio Team,

I installed the invenio 1.2 from your git repository. (I use Ubuntu 14.04 LTS)

When I try to submit a document, I get "OSError: [Errno 13] Permission denied (subprocess.py:1327:_execute_child)" error. I attached the full message of this exception.

I checked the permissions, but I think these are properly:

# ls -ld /opt/invenio
drwxr-xr-x 7 www-data www-data 4096 Dec  4 00:01 /opt/invenio

# ls -la /opt/invenio/var/tmp/conversion8a5CTx/
total 10512
drwx------  2 www-data www-data    4096 Dec  4 09:27 .
drwxr-xr-x 12 www-data www-data   12288 Dec  4 09:27 ..
-rw-r--r--  1 www-data www-data  423131 Dec  4 09:27 input.pdf
-rw-r--r--  1 www-data www-data 6607779 Dec  4 09:27 input.ps
-rw-r--r--  1 www-data www-data 1829077 Dec  4 09:27 ISOCoatedsb.icc
-rw-r--r--  1 www-data www-data 1875855 

Dec  4 09:27 output_file.pdf
-rw-r--r--  1 www-data www-data    1430 Dec  4 09:27 PDFA_def.ps

Could you help me, please?

Thanks, Attila

ps: I tried to send an email to info@invenio-software.org, but I got error message (550 5.1.1 User unknown)

Exception (subprocess.py 1327 _executechild) at http .txt Exception (websubmit_file_converter.py 511 convertfile) at http .txt

lnielsen commented 6 years ago

Looks like missing permissions on the submission directory. @tiborsimko or @egabancho do you have any ideas?

We did receive the email so it's strange that you got an error back.

Atisom commented 6 years ago

Dear lnielsen,

I ran this command:

# chmod 777 /opt/invenio -R
# ls -ld /opt/invenio/var/data/files/
drwxrwxrwx 3 www-data www-data 4096 Dec  4 19:44 /opt/invenio/var/data/files/

This wasn't solve the problem:

2017-12-04 19:44:36 -> InvenioWebSubmitFileConverterError: Unexpected error when converting from /opt/invenio/var/data/files/g0/112/content.pdf;1 to .pdf;pdfa (<type 'exceptions.OSError'>): [Errno 13] Permission denied (websubmit_file_converter.py:511:convert_file)

** Traceback details 

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/invenio/websubmit_functions/Shared_Functions.py", line 96, in createRelatedFormats
    newpath = convert_file(path, output_format=aformat)
  File "/usr/local/lib/python2.7/dist-packages/invenio/websubmit_file_converter.py", line 511, in convert_file
    raise InvenioWebSubmitFileConverterError("Unexpected error when converting from %s to %s (%s): %s" % (input_file, output_ext, type(err), err))
InvenioWebSubmitFileConverterError: Unexpected error when converting from /opt/invenio/var/data/files/g0/112/content.pdf;1 to .pdf;pdfa (<type 'exceptions.OSError'>): [Errno 13] Permission denied
tiborsimko commented 6 years ago

@Atisom The PDF-to-PDFA conversion is using OpenOffice behind the scenes. This runs using unoconv under the with CFG_OPENOFFICE_USER identity. By default this is set to user nobody for additional security. You will have to set up the permissions to user nobody as indicated in the INSTALL file:

$ sudo -u www-data /opt/invenio/bin/inveniocfg --check-openoffice

for example:

# grant Apache user the nobody user rights for OpenOffice integration:
$ echo "www-data  ALL=(nobody) NOPASSWD: ALL" | $sudo tee /etc/sudoers.d/www-data
$ sudo chmod o-r /etc/sudoers.d/www-data

see the example provisioning script https://github.com/inveniosoftware/invenio/blob/maint-1.2/scripts/provision-web.sh#L118-L120

P.S. Note that if you don't need the PDFA conversion on your system, you can amend the conversion configuration rules to switch it off. You can achieve this by configuring CFG_BIBDOCFILE_DESIRED_CONVERSIONS in your invenio-local.conf.