openzim / nautilus

Turns a collection of documents into a browsable ZIM file
GNU General Public License v3.0
19 stars 14 forks source link

Libmagic failing in 1.2.0 version #78

Closed kelson42 closed 1 month ago

kelson42 commented 1 month ago
Traceback (most recent call last):
  File "/usr/local/bin/nautiluszim", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nautiluszim/entrypoint.py", line 158, in main
    from nautiluszim.scraper import Nautilus
  File "/usr/local/lib/python3.11/site-packages/nautiluszim/scraper.py", line 20, in <module>
    from zimscraperlib.zim.creator import Creator
  File "/usr/local/lib/python3.11/site-packages/zimscraperlib/zim/__init__.py", line 15, in <module>
    from zimscraperlib.zim.creator import Creator
  File "/usr/local/lib/python3.11/site-packages/zimscraperlib/zim/creator.py", line 36, in <module>
    from zimscraperlib.filesystem import (
  File "/usr/local/lib/python3.11/site-packages/zimscraperlib/filesystem.py", line 13, in <module>
    import magic
  File "/usr/local/lib/python3.11/site-packages/magic/__init__.py", line 209, in <module>
    libmagic = loader.load_lib()
               ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/magic/loader.py", line 49, in load_lib
    raise ImportError('failed to find libmagic.  Check your installation')
ImportError: failed to find libmagic.  Check your installation

at https://farm.openzim.org/pipeline/2b40e3df-0070-4500-8da2-474a7624059a/debug

kelson42 commented 1 month ago

Looks like a regression to me, all scrapes impacted. This is an opprtunity to setup unit trsting and at least test that this conversion works fine. Once done, would be easier to extend.

rgaudin commented 1 month ago

Unit testing would not help, it's not a code issue. It's a Dockerfile issue. We changed base image and unfortunately that strong requirement was included in non-slim image but not declared so switching to slim had it missing. End-to-end test would have been able to catch it.

rgaudin commented 1 month ago

Reran that recipe and it succeeded with 1.2.1. All recipes changed to 1.2.1 but I didn't schedule anything else