flathub / com.calibre_ebook.calibre

https://flathub.org/apps/details/com.calibre_ebook.calibre
14 stars 14 forks source link

Calibre doesn't open due to missing shared object file #225

Closed diazbastian closed 3 months ago

diazbastian commented 3 months ago

Hi. I recently updated Calibre flatpak and when I tried to open it nothing happened. When I ran it from the terminal using flatpak run com.calibre_ebook.calibre I got the following error:

Traceback (most recent call last):
  File "runpy.py", line 198, in _run_module_as_main
  File "runpy.py", line 88, in _run_code
  File "site.py", line 47, in <module>
  File "site.py", line 43, in main
  File "calibre/gui_launch.py", line 74, in calibre
  File "calibre/gui2/main.py", line 548, in main
  File "calibre/gui2/main.py", line 560, in run_main
  File "calibre/gui2/main.py", line 398, in run_gui
  File "calibre/gui2/main.py", line 408, in run_gui_
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/gui2/ui.py", line 50, in <module>
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/gui2/init.py", line 37, in <module>
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/gui2/library/alternate_views.py", line 18, in <module>
  File "bypy-importer.py", line 279, in exec_module
  File "PIL/Image.py", line 82, in <module>
  File "bypy-importer.py", line 127, in create_module
ImportError: libdeflate.so.0: cannot open shared object file: No such file or directory

OS: Fedora Workstation 40 (GNOME 46 Wayland) Calibre version 7.17.0 (stable branch) commit b104ce4b98130ad6f5c2a93ed3074f5643a1e4403e29a411a90a152f516813cd Runtime: org.freedesktop.Platform/x86_64/23.08

mihailim commented 3 months ago

Confirming, same behavior on Ubuntu 24.04 (unsurprisingly, since Flatpak :D) under X11 and Wayland. None of the various packaged binaries from /app/bin seem to work since they all attempt to load that library.

For people who depend on it and/or are in a hurry and not in a position to wait until it's fixed: You can temporarily roll back to the previous build (happens to be of 7.16.0) which doesn't exhibit the problem via:

flatpak update --commit=98ac19e4d201d9b449eba04058734f95823a4d7698e173615dad2065a9ed5841 com.calibre_ebook.calibre

You can prevent autoupdates by masking the package:

flatpak --user mask com.calibre_ebook.calibre

Omit --user if you're operating on the system installation, of course. And remember to unmask it once it's fixed and you want it to update again, via

flatpak --user mask --remove com.calibre_ebook.calibre

If you're not comfortable with the command line, you could also use https://flathub.org/apps/io.github.flattool.Warehouse to downgrade com.calibre_ebook.calibre.

rag2 commented 3 months ago

Also confirming same behaviour in Ubuntu 18.04 ESM (don't ask why!) Thanks to @mihailim for the fix. Much appreciated. I confirm that the fix above works, in this case with the addition of a sudo prefix.

ghisvail commented 3 months ago

Looks like there has been a change in the dependency chain since version 7.17.0. It was working fine before on 7.16.0

Pinging @kovidgoyal to check whether the solution is expected to be on our end, or upstream.

ghisvail commented 3 months ago

Meanwhile, users should temporarily revert to the previous Flatpak revision using this set of instructions.

Erick555 commented 3 months ago

yeah, the problem is libtiff.so.6 links to libdeflate.so.0 but the latter isn't included in calibre tarball which makes calibre not self-contained anymore.

igor2x commented 3 months ago

I have reverted back to previous version like described in second post and Calibre works again.

Is there some reason manifest file com.calibre_ebook.calibre.yaml isn't reverted back to previous working commit and flatpak created with previous working version. We can't expect all users are tech savvy and working with terminal.

ghisvail commented 3 months ago

@igor2x because if you dared to look at the list of PRs, you'd have seen someone actually provided a fix for it...

ghisvail commented 3 months ago

Fixed by @Erick555, reported upstream here.

mihailim commented 3 months ago

Fixed upstream as well in https://github.com/kovidgoyal/calibre/commit/a25c767de3e2a799c24e35fb669e5e90062184f9 -- the next release will ship the libdeflate .so. 4eec555 will probably need to be reverted for that build.

Erick555 commented 3 months ago

It should be reverted although it's not urgent as not reverting is harmless for users - flatpak will have just two copies of same library.