Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using unoconvert inside docker container #44

Closed
lpwxyz opened this issue Jan 23, 2024 · 4 comments
Closed

Problem using unoconvert inside docker container #44

lpwxyz opened this issue Jan 23, 2024 · 4 comments

Comments

@lpwxyz
Copy link

lpwxyz commented Jan 23, 2024

Hi

I have a issue running unoconvert inside the docker container.

Running container

image

Listing files inside the mounted volume

image

Command and error

worker@33a3416026b7:~$ unoconvert /data/teste.odt /data/teste.pdf
INFO:unoserver:Starting unoconverter.
INFO:unoserver:Opening /data/teste.odt
INFO:unoserver:Exporting to /data/teste.pdf
INFO:unoserver:Using writer_pdf_Export export filter
Traceback (most recent call last):
  File "/usr/bin/unoconvert", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/unoserver/converter.py", line 340, in main
    result = converter.convert(
             ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/unoserver/converter.py", line 267, in convert
    document.storeToURL(export_path, output_props)
unoserver.converter.com.sun.star.io.IOException: SfxBaseModel::impl_store <file:///data/teste.pdf> failed: 0x507(Error Area:Io Class:Access Code:7) at /home/buildozer/aports/community/libreoffice/src/libreoffice-7.5.5.2/sfx2/source/doc/sfxbasemodel.cxx:3213 at /home/buildozer/aports/community/libreoffice/src/libreoffice-7.5.5.2/sfx2/source/doc/sfxbasemodel.cxx:1789

What am I doing wrong?

@jimisola
Copy link
Member

jimisola commented Jan 25, 2024

I'll try to see if I can reproduce. Just to confirm - the container has the correct permissions for the mounted volume?

Please try the following commands (what output do you get):

/data $ id
/data touch test.txt
/data $ ls -la

Also, check the README regarding using option -z/-Z if you are using SELinux.

Do you get the same error if don't enter the container but convert directly from command line?

@lpwxyz
Copy link
Author

lpwxyz commented Jan 25, 2024

worker@262a0ac796ca:/data$ id
uid=100(worker) gid=101(worker) groups=101(worker)
worker@262a0ac796ca:/data$ ls -la
total 152
drwxr-xr-x    1 1001     985            144 Jan 23 18:36 .
drwxr-xr-x    1 root     root           154 Jan 25 20:13 ..
drwxr-xr-x    1 1001     985            138 Jan 23 18:23 .git
drwxr-xr-x    1 1001     985             46 Jan 23 18:23 .github
-rw-r--r--    1 1001     985           2093 Jan 23 18:23 Dockerfile
-rw-r--r--    1 1001     985           1064 Jan 23 18:23 LICENSE
-rw-r--r--    1 1001     985           1526 Jan 23 18:23 README.md
drwxr-xr-x    1 1001     985             20 Jan 23 18:23 build-context
-rw-r--r--    1 1001     985         129428 Jan 23 18:31 teste.odt
-rw-r--r--    1 1001     985           9028 Jan 23 18:36 testedois.odt

@jimisola
Copy link
Member

It seems that the docker container does not have write access to that directory.

For a quick fix do chmod a+w . outside of the container (standing in the same directory).

Alternatives are:

  1. change the owner of the directory (and files) to the docker user.
  2. add the docker user to the group that owns the directory and the files in it.

@lpwxyz
Copy link
Author

lpwxyz commented Jan 25, 2024

Thanks, it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants