docker-calibre-web icon indicating copy to clipboard operation
docker-calibre-web copied to clipboard

[BUG] Binaries are not installed

Open igorshubovych opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

After trying to install calibre-web using linuxserver/docker-calibre-web on Synology NAS via Container Manager, the calibre binaries are not being put into bin folder.

They are not correctly built.

Probably related to #305.

Expected Behavior

No response

Steps To Reproduce

  1. Install calibre-web using Container Manager on Synology NAS.
  2. Read the logs.
  3. Ensure that calibre-web does not have binaries installed trying to use calibre-web.

Environment

- OS: Synology DSM 7.2.1-69057 Update 5 (Linux 3.10.108, )
- How docker service was installed: Synology Container Manager

CPU architecture

x86-64

Docker creation

docker-compose.yml

---
services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:latest
    container_name: calibre-web
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - DOCKER_MODS=linuxserver/mods:universal-calibre #optional
      - OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional
    volumes:
      - /volume1/docker/calibre-web/config:/config
      - /volume1/docker/calibre-web/library:/books
    ports:
      - 8083:8083
    restart: unless-stopped

Container logs

...
Setting up libdrm2:amd64 (2.4.113-2~ubuntu0.22.04.1) ...                         
Setting up libdrm-amdgpu1:amd64 (2.4.113-2~ubuntu0.22.04.1) ...                  
Setting up libdrm-nouveau2:amd64 (2.4.113-2~ubuntu0.22.04.1) ...                 
Setting up libgbm1:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...                         
Setting up libdrm-radeon1:amd64 (2.4.113-2~ubuntu0.22.04.1) ...                  
Setting up libdrm-intel1:amd64 (2.4.113-2~ubuntu0.22.04.1) ...                   
Setting up libgl1-mesa-dri:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...                 
Setting up libegl-mesa0:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...                    
Setting up libegl1:amd64 (1.4.0-1) ...                                           
Setting up libglx-mesa0:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...                    
Setting up libglx0:amd64 (1.4.0-1) ...                                           
Setting up libgl1:amd64 (1.4.0-1) ...                                            
Setting up libgl1-mesa-glx:amd64 (23.0.4-0ubuntu1~22.04.1) ...                   
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...                           
**** Installing/updating calibre ****                                            
  % Total    % Received % d   Time    Time     Time  Current                     
                                 Dload  Upload   Total   Spent    Left  Speed    
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Xfe
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0   
100  139M  100  139M    0     0  9595k      0  0:00:14  0:00:14 --:--:--  9.7M   
Failed to import PyQt module: PyQt6.QtCore with error: libQt6Core.so.6: cannot op
en shared object file: No such file or directory                                 
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 41, in main                                               
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/linux.py", line 16, in <module>                                  
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/customize/ui.py", line 28, in <module>                           
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/customize/builtins.py", line 731, in <module>                    
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/devices/kobo/driver.py", line 25, in <module>                    
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/devices/kobo/books.py", line 14, in <module>                     
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/ebooks/metadata/book/formatter.py", line 10, in <module>         
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/utils/formatter.py", line 23, in <module>                        
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/utils/formatter_functions.py", line 30, in <module>              
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/db/notes/exim.py", line 14, in <module>                          
  File "bypy-importer.py", line 279, in exec_module                              
  File "calibre/ebooks/oeb/transforms/rasterize.py", line 14, in <module>        
ImportError: cannot import name 'QBuffer' from 'qt.core' (/app/calibre/lib/calibr
e-extensions/python-lib.bypy.frozen/qt/core.pyc)                                 
[custom-init] No custom files found, skipping...                                 
[ls.io-init] done.

igorshubovych avatar Jul 25 '24 22:07 igorshubovych

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

github-actions[bot] avatar Jul 25 '24 22:07 github-actions[bot]

A human has marked this issue as invalid, this likely happened because the issue template was not used in the creation of the issue.

github-actions[bot] avatar Jul 25 '24 22:07 github-actions[bot]

Post full logs, starting before our ascii logo.

Roxedus avatar Jul 25 '24 22:07 Roxedus

I can't replicate it: https://github.com/linuxserver/docker-calibre-web/issues/305#issuecomment-2251580119

aptalca avatar Jul 25 '24 23:07 aptalca

I suspect this is the 3.x kernel / qt6 ABI issue and as such there's no real solution for it.

thespad avatar Jul 26 '24 00:07 thespad

I am also seeing this happen on 4.4.302+ on a synology (Linux spacelab 4.4.302+ #69057 SMP Fri Jan 12 17:02:28 CST 2024 x86_64 GNU/Linux synology_geminilake_920+), so I don't think it's limited to 3.x kernels. What's interesting is that I have no issues running linuxserver/calibre, only DOCKER_MODS=linuxserver/mods:universal-calibre on calibre-web

Re-running /etc/s6-overlay/s6-rc.d/init-mod-universal-calibre-add-package/run shows libnss3 libxdamage1 in /mod-repo-packages-to-install.list, but /etc/s6-overlay/s6-rc.d/init-mods-package-install/run installs no new packages, and thus /etc/s6-overlay/s6-rc.d/init-mod-universal-calibre-setup/run fails -- those appear to be red herrings.

between both containers, the md5 for libQt6Core.so.6 is the same

3cc8104fd1a5f4d1bdaa687afd3f5ec6  /app/calibre/lib/libQt6Core.so.6
3cc8104fd1a5f4d1bdaa687afd3f5ec6  /opt/calibre/lib/libQt6Core.so.6

segiddins avatar Aug 24 '24 15:08 segiddins

I'm also seeing this on Linux Synology 4.4.302+ #69057 SMP Fri Jan 12 17:02:28 CST 2024 x86_64 GNU/Linux synology_geminilake_920+

Leading to a 404 when downloading a book, and this in the log:

[2024-08-28 15:58:29,582] ERROR {cps.embed_helper:47} Metadata embedder encountered an error: Failed to import PyQt module: PyQt6.QtCore with error: libQt6Core.so.6: cannot open shared object file: No such file or directory
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 41, in main
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/db/cli/main.py", line 11, in <module>
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/db/legacy.py", line 16, in <module>
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/db/backend.py", line 72, in <module>
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/utils/formatter_functions.py", line 30, in <module>
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/db/notes/exim.py", line 14, in <module>
  File "bypy-importer.py", line 279, in exec_module
  File "calibre/ebooks/oeb/transforms/rasterize.py", line 14, in <module>
ImportError: cannot import name 'QBuffer' from 'qt.core' (/app/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/core.pyc)

sargunv avatar Aug 28 '24 23:08 sargunv

And here's a full log as requested earlier in the thread: calibre-web-log.txt

sargunv avatar Aug 29 '24 07:08 sargunv

Hello, i have the same issue on OS Synology DSM 7.2.1-69057 Update 5 Linux 4.4.302+ #69057 SMP Fri Jan 12 17:02:28 CST 2024 x86_64 GNU/Linux synology_geminilake_220+ using DOCKER_MODS=linuxserver/mods:universal-calibre on calibre-web.

Installation done using portainer and docker-compose file

services:
  calibre-web:
    image: linuxserver/calibre-web:latest
    container_name: calibre-web
    environment:
      - PUID=1026
      - PGID=100
      - TZ=Europe/Paris
      - DOCKER_MODS=linuxserver/mods:universal-calibre
    volumes:
      - /volume2/docker/calibre-web:/config
      - /volume2/ebooks/calibre:/books
    ports:
      - 8083:8083
    restart: unless-stopped

Logs are here : logs calibre-web.txt

loli71 avatar Sep 04 '24 13:09 loli71

I hate to be that guy, but we're not going to spend time troubleshooting issues on kernels that have been end of life for over 2 years (referring to the 4.4 kernel crowd in here, the 3.2 kernel has been EOL for 6 years). My suggestion is that you revert to an older version until you find one that works and pin it, harass your hardware manufacturer to provide reasonable updates to their software, or find a container that caters to out of date systems like this.

To be clear, some of our containers will work fine on out of date end of life stuff, some won't, it's not something we go out of our way to make happen, though with that said, if there is a way to support these old kernels without negatively impacting other users, we would definitely look at a user provided PR.

drizuid avatar Sep 07 '24 00:09 drizuid

@drizuid understood. should I close the issue?

igorshubovych avatar Sep 07 '24 00:09 igorshubovych

Let's see if @thespad has any thoughts first, he's more knowledgeable about these issues than I am.

drizuid avatar Sep 07 '24 00:09 drizuid

I have the same issue in Synology. I even rollbacked to 0.6.21-ls274 but I got the same problem. Binaries are not available in container.

I think that it could be due to some recent Ubuntu updates, because my previous 0.6.22 container was working fine one week ago until I updated to 0.6.23 tag.

gpa090 avatar Sep 07 '24 07:09 gpa090

I have the same issue in Synology. I even rollbacked to 0.6.21-ls274 but I got the same problem. Binaries are not available in container.

I think that it could be due to some recent Ubuntu updates, because my previous 0.6.22 container was working fine one week ago until I updated to 0.6.23 tag.

without you posting a kernel version that isn't older than 4.19, there is nothing for us to help you with. If your kernel is older than 4.19, you need to try older versions until it works, restore a backup, or ask your vendor to resolve the kernel issue.

I am now assuming the binaries being discussed are from the docker mod though, you can look through https://hub.docker.com/r/linuxserver/mods/tags?page_size=&ordering=&name=universal-calibre and find a version of the mob predating the rebase. Perhaps linuxserver/mods:universal-calibre-7b0888969d9198caddb42c03cb17c35caa05d00e

drizuid avatar Sep 07 '24 14:09 drizuid

without you posting a kernel version that isn't older than 4.19, there is nothing for us to help you with. If your kernel is older than 4.19, you need to try older versions until it works, restore a backup, or ask your vendor to resolve the kernel issue.

I am now assuming the binaries being discussed are from the docker mod though, you can look through https://hub.docker.com/r/linuxserver/mods/tags?page_size=&ordering=&name=universal-calibre and find a version of the mob predating the rebase. Perhaps linuxserver/mods:universal-calibre-7b0888969d9198caddb42c03cb17c35caa05d00e

My current kernel version is Linux synology 4.4.302+ #69057 SMP Fri Jan 12 17:02:28 CST 2024 x86_64 GNU/Linux synology_geminilake_920+. Synology DSM 7.2.1-69057 Update 5. I have no pending updates in my device.

I will try another calibre-web release and docker mod version and report back.

gpa090 avatar Sep 07 '24 15:09 gpa090

is Linux synology 4.4.302+

This is the issue, this kernel has been end of life for over 2 years, as applications are updated and their base os layers in containers are updated, things that haven't been supported in 2+ years are going to have issues. The best way to maintain support is to not upgrade unless you know it will work, if you don't know, run a NEW container under a new name and test, if it doesn't work, pin your version and never upgrade again (much like your vendor has done with your kernel)

drizuid avatar Sep 07 '24 19:09 drizuid

I have the same issue in Synology. I even rollbacked to 0.6.21-ls274 but I got the same problem. Binaries are not available in container. I think that it could be due to some recent Ubuntu updates, because my previous 0.6.22 container was working fine one week ago until I updated to 0.6.23 tag.

without you posting a kernel version that isn't older than 4.19, there is nothing for us to help you with. If your kernel is older than 4.19, you need to try older versions until it works, restore a backup, or ask your vendor to resolve the kernel issue.

I am now assuming the binaries being discussed are from the docker mod though, you can look through https://hub.docker.com/r/linuxserver/mods/tags?page_size=&ordering=&name=universal-calibre and find a version of the mob predating the rebase. Perhaps linuxserver/mods:universal-calibre-7b0888969d9198caddb42c03cb17c35caa05d00e

I'm not sure this is possible. This mod downloads the binaries from the calibre release assets and it appears only the latest release makes these available.

https://github.com/kovidgoyal/calibre/releases

ianmetcalf avatar Sep 11 '24 03:09 ianmetcalf

I tried few older versions (for calibre web and for binaries) and it is not working. Is it possible somehow to add mod for legacy versions of kernel ?

cuksi avatar Sep 11 '24 05:09 cuksi

I tried few older versions (for calibre web and for binaries) and it is not working. Is it possible somehow to add mod for legacy versions of kernel ?

As @ianmetcalf said, This mod (what ever is the version of the mod) download the binaries from the calibre release assets in github and it appears only the latest release makes these available.

So as a workaround, if you want to install an old version of the caliber binaries, you can use the "Custom Scripts" solution in caliber-web to install the dependencies and binaries with the desired version (mostly like it's done in the mod in fact).

For synology, it should look like this:

  • create a new custom-files directory in the caliber-web docker directory (example /volume1/docker/calibre-web/custom-files)
  • add the new volume (/volume1/docker/calibre-web/custom-files:/custom-cont-init.d:ro)
  • add the following script named caliber.sh in /volume1/docker/calibre-web/custom-files/
    calibre.sh.txt

Be careful of the End Of Line of the script on the synology, it should be Linux EOL (LF) and it is actually windows EOL (CR LF) in my txt attachment.

You can choose the version of the calibre binaries by modifying CALIBRE_RELEASE="v7.16.0" at the top of the script. This script downloads calibre binaries from https://download.calibre-ebook.com/ instead of https://github.com/kovidgoyal/calibre/releases/download/ and installs all mandatory packages exactly like in original mod. It works perfectly for me on my synology 220+ with DSM 7.2.1-69057 Update 5 Linux 4.4.302+.

loli71 avatar Sep 11 '24 07:09 loli71

The mod is versioned, you can just use an older tag from this list if you need an older version of the calibre binary itself.

Note that this won't change the versions of the depedencies as they're installed at runtime.

thespad avatar Sep 11 '24 08:09 thespad

The mod is versioned, you can just use an older tag from this list if you need an older version of the calibre binary itself.

Note that this won't change the versions of the depedencies as they're installed at runtime.

@thespad: As ianmetcalf said, this mod (what ever is the versioned version of the mod) download the binaries from the calibre release assets in github and it appears only the latest release makes the binaries available, for old version, only source code are available. So using "DOCKER_MODS=linuxserver/mods:universal-calibre-v7.16.0" is not working for example as calibre-7.16.0-x86_64.txz is not available on https://github.com/kovidgoyal/calibre/releases/tag/v7.16.0

loli71 avatar Sep 11 '24 08:09 loli71

@loli71 Which version do you use in your script ? I tried all to 7.6.0 and still no convert button

cuksi avatar Sep 11 '24 09:09 cuksi

i'm using the version that is in the script I posted: v7.16.0 image

loli71 avatar Sep 11 '24 09:09 loli71

I tried both ideas but nothing is working still no convert button, On my Synology NAS which is using Linux 4.4.302+ I went all the way to 6.13 Calibre version, and still no button for Convert formats. All ways same error when I add path to Calibre Web field Basic Configuration->External binaries->Path to Calibre Binaries : /usr/bin/ Error message: Missing calibre binaries: ebook-convert, calibredb, Missing executable permissions: ebook-convert, calibredb

cuksi avatar Sep 11 '24 09:09 cuksi

Oh, right, we do the download at runtime because the binaries are huge. Apologies I had forgotten.

Completely mad that they're stripping the release artifacts from old GH releases though.

thespad avatar Sep 11 '24 09:09 thespad

I have pinned this issue. If you encounter this issue, please follow the guidance from @loli71 here: https://github.com/linuxserver/docker-calibre-web/issues/306#issuecomment-2342923994

This is not something linuxserver.io can or will fix. We expect our containers to be run on non-end-of-life hardware and while it may work sometimes, we do not put in any special effort to support outdated systems. At this point, with a solution provided above and this being out of scope for our support, I will prepare to close this in the next couple of days, but I will leave it pinned for reference.

drizuid avatar Sep 11 '24 11:09 drizuid

I tried both ideas but nothing is working still no convert button, On my Synology NAS which is using Linux 4.4.302+ I went all the way to 6.13 Calibre version, and still no button for Convert formats. All ways same error when I add path to Calibre Web field Basic Configuration->External binaries->Path to Calibre Binaries : /usr/bin/ Error message: Missing calibre binaries: ebook-convert, calibredb, Missing executable permissions: ebook-convert, calibredb

@cuksi : check your docker logs when you launch your container, you should be able to see if the calibre binaries are well downloaded and installed. You can also do exec bash into you container after up and running to check if you have symlinks for the binaries in /usr/bin/

loli71 avatar Sep 11 '24 18:09 loli71

I tried few older versions (for calibre web and for binaries) and it is not working. Is it possible somehow to add mod for legacy versions of kernel ?

As @ianmetcalf said, This mod (what ever is the version of the mod) download the binaries from the calibre release assets in github and it appears only the latest release makes these available.

So as a workaround, if you want to install an old version of the caliber binaries, you can use the "Custom Scripts" solution in caliber-web to install the dependencies and binaries with the desired version (mostly like it's done in the mod in fact).

For synology, it should look like this:

  • create a new custom-files directory in the caliber-web docker directory (example /volume1/docker/calibre-web/custom-files)
  • add the new volume (/volume1/docker/calibre-web/custom-files:/custom-cont-init.d:ro)
  • add the following script named caliber.sh in /volume1/docker/calibre-web/custom-files/ calibre.sh.txt

You can choose the version of the calibre binaries by modifying CALIBRE_RELEASE="v7.16.0" at the top of the script. This script downloads calibre binaries from https://download.calibre-ebook.com/ instead of https://github.com/kovidgoyal/calibre/releases/download/ and installs all mandatory packages exactly like in original mod. It works perfectly for me on my synology 220+ with DSM 7.2.1-69057 Update 5 Linux 4.4.302+.

It works like a charm! I used your script, only changed endlines to LF, and launched this compose.yaml file:

version: "3"
services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:0.6.22-ls280
    container_name: calibre-web
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Madrid
      - DOCKER_MODS=linuxserver/mods:universal-calibre
      - OAUTHLIB_RELAX_TOKEN_SCOPE=1
    volumes:
      - /volume1/docker/calibre-web:/config
      - /volume1/media/books:/books
      - /volume1/docker/calibre-web3/custom-files:/custom-cont-init.d:ro
    ports:
      - 8083:8083
    network_mode: synobridge
    restart: unless-stopped

Symlinks are correctly created. I'm now fixing my main calibre with this configuration.

Thank you very much!

gpa090 avatar Sep 11 '24 18:09 gpa090

@loli71 will check now, just restarted container and set version 7.16

@gpa090 what did you change exactly ? LF instead of what ?

cuksi avatar Sep 11 '24 18:09 cuksi

I got this from log, I think something needs to be changed in script: [custom-init] calibre.sh.txt: exited 2 /custom-cont-init.d/calibre.sh.txt: line 88:     elif [ "$(uname -m)" == "aarch64" ]; then /custom-cont-init.d/calibre.sh.txt: line 88: syntax error near unexpected token elif' /custom-cont-init.d/calibre.sh.txt: line 4: $'\r': command not found /custom-cont-init.d/calibre.sh.txt: line 2: $'\r': command not found [custom-init] calibre.sh.txt: executing...

@loli71 I entered usr/bin but I am not sure which files I need to find.

cuksi avatar Sep 11 '24 18:09 cuksi