advplyr / audiobookshelf

Self-hosted audiobook and podcast server
https://audiobookshelf.org
GNU General Public License v3.0
6.58k stars 467 forks source link

[Bug]: Library name and the library order only temporarily saves #3079

Closed JamesDean3 closed 3 months ago

JamesDean3 commented 4 months ago

What happened?

After changing the library name and the order that the libraries show up, it will only reflect the change for a short time, then it resets back to what it was.

What did you expect to happen?

For the library name and order they are shown to stick long term and across all users and platforms.

Steps to reproduce the issue

  1. Change the Name or the order that the libraries show up.
  2. Watch them change, but then later see that they are back to what they were before, or use another user account or platform, and see that the change didn't stick

Audiobookshelf version

v2.10.1

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

No response

Additional Notes

No response

advplyr commented 4 months ago

I'm not able to reproduce this. Are you able to reproduce this every time? Can you give more exact steps to reproduce the issue?

JamesDean3 commented 4 months ago

Oddly I am unable to get it to do it now, but the first time it happened there was a decent delay.

A couple days ago I changed it over a browser on my computer and everything seemed fine, later went and used it in the app and saw that the changes weren't reflected on the app. I logged out and back in on the app and it still showed the old names.

I then went on to my computer and checked on there, and for a couple minutes it showed everything correctly with the new names and order I placed them in, I moved a few files into the library folder and ran matches and then I noticed both the names and the order went back to what they were, this time it was on my browser.

So I then went and changed them again, a few minutes later it changed back again, so I changed them again and logged out and back in, when I got back it had the old names again, I tried this a few more times, along with changing users, no luck.

When talking to my brother about it, he mentioned having this same problem (both using the same server), but he said it was a few weeks ago when he was trying. Which is why I figured it was worth posting as a bug.

Just now I changed them again and logged out and back in twice and everything seems to be working, I checked the app and it is fine on there, checked another user account on both the browser and my phone and the changes seem to be sticking, at least for now.

JamesDean3 commented 4 months ago

This morning when checking it again, everything reverted back to what they were before again. The two different library names that I changed and the order that they displayed all changed back to what they used to be.

Logging out and back in makes no again makes no difference, both the app and over the browser shows everything back the way they were, it doesn't make a lot of sense to me, after changing it last night the changes stuck through user changes and logging out and back in, besides listening to an audiobook while going to sleep using the app, nothing else was done last night

JamesDean3 commented 4 months ago

I've changed the library names back to what I want them to be again, and fixed the order once again, then I restarted the docker container, I logged out and logged back in on both the app and web version of the client, and everything seems to be staying how I want for now...

devnoname120 commented 4 months ago

I have a similar issue where the settings of my library get unexpectedly reset on a frequent basis.

image

I'm not sure yet what triggers it but it happens really frequently (at least multiple times per hour).

advplyr commented 4 months ago

If you are able to look at the database after updating the setting and then again after it resets that would help a lot. It is the libraries table which also includes the settings. I'm not sure if this is a cache issue or data is actually being reverted somehow.

devnoname120 commented 4 months ago

Will do next time it happens.

Edit: it happened again! It's too late right now so I will look into it another time. I suspect the bug might be triggered when the Schedule Automatic Library Scan CRON happens (but not when I trigger it manually).

Edit 2: this issue might be related https://github.com/advplyr/audiobookshelf/issues/2894 Edit 3: and that one might might be related too: https://github.com/advplyr/audiobookshelf/issues/3060


Here is my configuration in case it helps:

services:
  watchtower:
    image: containrrr/watchtower:1.7.1@sha256:6dd50763bbd632a83cb154d5451700530d1e44200b268a4e9488fefdfcf2b038
    restart: unless-stopped
    volumes:
      - "/run/user/1000/docker.sock:/var/run/docker.sock:ro"
    environment:
      TZ: Europe/Zurich
      # See: https://github.com/containrrr/watchtower/blob/dd54055/docs/arguments.md#filter-by-scope
      WATCHTOWER_SCOPE: "audiobookshelf"
      WATCHTOWER_POLL_INTERVAL: 21600 # 6 hours
      WATCHTOWER_CLEANUP: 1
      WATCHTOWER_INCLUDE_RESTARTING: 1
      WATCHTOWER_TIMEOUT: 30s
    labels:
      - "com.centurylinklabs.watchtower.scope=audiobookshelf"

  audiobookshelf:
    image: ghcr.io/advplyr/audiobookshelf:latest
    restart: unless-stopped
    ports:
      - "127.0.0.1:13378:80"
    volumes:
      - audiobooks:/audiobooks
      - ./podcasts:/podcasts
      - ./config:/config
      - ./metadata:/metadata
    environment:
      TZ: Europe/Zurich
    labels:
      - "com.centurylinklabs.watchtower.scope=audiobookshelf"

volumes:
  audiobooks:
    driver: rclone
    driver_opts:
      remote: 'nextcloud-local:Books/My Audio books/Complete collection'
      allow_other: 'true'
      vfs_cache_mode: off
      poll_interval: 0
advplyr commented 4 months ago

I suspect the bug might be triggered when the Schedule Automatic Library Scan CRON happens

Thanks, this helped me track it down. The cron was using the same copy of the library object that was used when initializing it so when the cron job ran it would revert. This is the same as #2894 but I don't think it is the same as #3060

devnoname120 commented 4 months ago

Great! I just tried commit 72c1407aa74b8d78cebb06a552c64d9eb19bc1ac and I confirm that it solves my issue — thanks a lot. On Jun 21, 2024 at 00:10 +0200, advplyr @.***>, wrote:

I suspect the bug might be triggered when the Schedule Automatic Library Scan CRON happens Thanks, this helped me track it down. The cron was using the same copy of the library object that was used when initializing it so when the cron job ran it would revert. This is the same as #2894 but I don't think it is the same as #3060 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

advplyr commented 3 months ago

Fixed in v2.11.0