xthursdayx / yacreaderlibrary-server-docker

Docker image running a headless version of YACReaderLibraryServer 📦

Home Page:https://hub.docker.com/r/xthursdayx/yacreaderlibrary-server-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Only the first of multiple libraries can be browsed

j-syn opened this issue · comments


Expected Behavior

I should be able to add multiple libraries and browse all of them.

Current Behavior

Currently, if you add multiple libraries they will all be displayed on your YACReaderLibraryServer homepage, but only the first one can be browsed. Clicking the others does nothing. Whichever library is listed first when you type YACReaderLibraryServer list-libraries is the only library that will work. Removing this library then allows you to browse the next one, since it is now the first library in the list.

Steps to Reproduce

  1. Create multiple libraries. e.g.:
YACReaderLibraryServer add-library "Comic Books and Graphic Novels" /comics
YACReaderLibraryServer add-library "Comic Strip Collections" /funnypages
YACReaderLibraryServer add-library "Magazines" /magazines
  1. Now browse to your YacReaderLibraryServer homepage. All three libraries are listed, in the order they were added.
  2. Click on the first Library in the list. You will be able to browse the comic books within, no problem.
  3. Click on the other Libraries in the list. Clicking them will do nothing. You can not browse them.
  4. Now delete the first Library. e.g.:
YACReaderLibraryServer remove-library "Comic Books and Graphic Novels"
  1. Now browse to your YACReaderLibraryServer homepage. Only the two remaining libraries are listed, still in the order they were first added.
  2. Click on the first Library in the list. It did not used to be the first Library in the list, and you could not browse it. But it is now the first Library in the list. You can now browse the comic books within, no problem.
  3. Click on the next Library in the list. Clicking it will do nothing. You can not browse it

Environment

This was done on Synology, using the fix described here

Command used to create docker container (run/create/compose/screenshot)

version: "3"
services:
  image: xthursdayx/yacreaderlibrary-server-docker:unarr
  container_name: YACReaderLibraryServer
  healthcheck:
    test: curl -f http://localhost:8080/ || exit 1
  mem_limit: 4g
  cpu_shares: 192
  security_opt:
    - no-new-privileges:true
  restart: unless-stopped
  ports: 
    - 8080:8080
  volumes:
    - "/volume1/docker/yaclibraryserver:/config"
    - "/volume1/music/My Media/Comics and Comic Strips/Comics Sorted:/comics"
    - "/volum1/music/My Media/Comics and Comic Strips/Comic Strip Collections:/funnypages"
    - "/volume1/music/My Media/Magazines:/magazines"
  environment:
    PUID: 1024
    PGID: 100
    TZ: America/New_York

Followed by:

apt-get update
apt-get install binutils
strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
YACReaderLibraryServer add-library "Comic Books and Graphic Novels" /comics
YACReaderLibraryServer add-library "Comic Strip Collections" /funnypages
YACReaderLibraryServer add-library "Magazines" /magazines

All volumes and directories are populated with comic books and are readable. All volumes have worked with other YACReaderLibraryServer docker images in the past (e.g. Mullion/yacreaderlibraryserver). All volumes and Libraries work great if they are actively the top Library on the homepage. Forcibly removing and adding the Libraries to change the order they are in prove that they all work, provided they are the first Library in the list. Thus, this does not appear to be a permissions problem.

Is this a Synology-specific bug or something related to this package? Has anyone else gotten multiple libraries to work in the current version?

Ahhhhhhh shoot. I feel like an absolute idiot. Sorry. I swear I reproduced 4 times in a darned row, within clean installs, but now I can't. I apologize. Sometimes we all shoot ourselves in the foot and yet for the life of us we don't even realize there's a gun in our hand. Still not 100% sure what the problem was, but since it's gone and I (the originator) can't reproduce, I'm going to close and call it some sort of weird personal glitch.

I'll keep playing and trying to make this happen again. If I can't, then nevermind, please ignore. If I can, I'll reproduce it 5 times in a row this time before coming here with a bug. Ugh. I think I had some leftover yaclibraryserver config files lying around from a half-decade-old install that were screwing with the library setup.

Darn. I was right, just slightly wrong steps to reproduce and recognize. There definitely appears no way to have multiple libraries.

Step 1

Delete every possible old .yacreaderlibraryserver file. This includes deleting any existing config directory and any .yacreaderlibrary directories that exist inside your library folders. This allows for a clean install. Remove any existing installed docker images of this. We want to start clean!

Step 2

Install this docker. Create a new library inside it with YACReaderLibraryServer create-library "My First Library name" /path/to/some/comics/files. Wait, this step can take a while, depending on how many files are in there.

Step 3

Browse to your YACReaderLibraryServer instance. You will see the library you created and you will be able to browse it.

Step 4

Go back and create a second library inside this docker with YACReaderLibraryServer create-library "My Second Library Name" /different/path/to/other/comics/files. Wait, this step can take a while, depending on how many files are in there.

Step 5

Browse to your YACReaderLibraryServer instance. You will see both libraries now. However, only the first library that you created can be browsed. Clicking on the other library does nothing.

Step 6

Go back and remove the working library ("My First Library Name") with `YACReaderLibraryServer remove-library "My First Library Name". Browse to your YACReaderLibraryServer instance. You will only see the second library you created. Clicking on it will do nothing.

Step 7

Start all over. Go back to Step 1 and delete everything. Only this time create "My Second Library Name" FIRST before you create "My First Library Name".

Step 8

Browse to your YACReaderLibraryServer instance. Try clicking on the libraries. You will see *only the first library you create will ever work. There does not appear to be a way to ever get additional libraries to work or a replacement library to work.

Summary

This should work. Multiple libraries work fine in YACReaderLibraryServer itself, and they works on other docker images, so it appears to be a this-docker-image specific problem (unless this image is using a different, somehow broken YACReaderLibraryServer version than the other docker images are). Every user who installs this and creates one and only one library should experience no issues. Anyone who installs this and creates multiple libraries, or who someday remove their primary library and try to add a different one to replace it will probably end up with a broken YACReaderLibraryServer install.

I've tried over and over, and this bug is infinitely repeatable for me. Can anyone else confirm if they've managed multiple libraries somehow?

Current temporary and ugly workaround

Previously, to add multiple libraries one would do:

YACReaderLibraryServer create-library "Comic Books and Graphic Novels" /comics
YACReaderLibraryServer create-library "Comic Strip Collections" /funnypages
YACReaderLibraryServer create-library "Magazines" /magazines

For now, a workaround is to use symlinks to fake YACReaderLibraryServer into thinking that all your libraries are just one big library:

mkdir /comicslibrary
cd /comicslibrary
ln -s /comics
ln -s /funnypages
ln -s /magazines
YACReaderLibraryServer create-library "Everything Everywhere All At Once" /comicslibrary

Now all your libraries are browseable within the larger faked library. It doesn't fix the underlying problem, but it at least lets you use this image with multiple libraries.

Thanks for your work troubleshooting this issue @j-syn
.

I'm wondering if this is an upstream issue to be address with the YACReader devs? There shouldn't be any reason I can see that would prevent this dockerized version of YACReader Library Server from hosting multiple libraries if they same feature was working correctly with the base program.

I'll open up an issue with them to see what they think and report back.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.