rmcrackan / Libation

Libation: Liberate your Library
GNU General Public License v3.0
2.86k stars 154 forks source link

Error every time - no changes #1049

Open Teapotsing opened 4 days ago

Teapotsing commented 4 days ago

After changing nothing I’m unable to download new books, I’ve checked all settings but get the error message every time

picture attached

Running windows 10 ![Uploading IMG_2031.jpeg…]()

rmcrackan commented 4 days ago

Sorry, the image didn't come through. Can you attach your log file?

sarg3nt commented 4 days ago

I'm also getting error downloading as of recently. No config changes on my end either.

I just purchase a couple new books this morning and they are not downloading.

Note: The aliens, robots and elevating black voices books always fail and have been doing so for a LONG time. I don't even remember purchasing them to be honest, so not sure where they came from but I'd ignore them as I doubt they are the problem.

LibationCli v11.5.5
ERROR
=====
Microsoft.EntityFrameworkCore.DbUpdateException
Message: An error occurred while saving the entity changes. See the inner
exception for details.
Stack Trace:
   at
   Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(I
   RelationalConnection connection)
   at
   Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerab
   le`1 commandBatches, IRelationalConnection connection)
   at
   Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChange
   s(IList`1 entriesToSave)
   at
   Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChange
   s(StateManager stateManager, Boolean acceptAllChangesOnSuccess)
   at
   Microsoft.EntityFrameworkCore.Storage.NonRetryingExecutionStrategy.Execute[TS
   tate,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at
   Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChange
   s(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean
   acceptAllChangesOnSuccess)
   at ApplicationServices.LibraryCommands.SaveContext(LibationContext context)
   in /Source/ApplicationServices/LibraryCommands.cs:line 342

   at ApplicationServices.LibraryCommands.SaveContext(LibationContext context)
   in /Source/ApplicationServices/LibraryCommands.cs:line 353
   at ApplicationServices.LibraryCommands.importIntoDbAsync(List`1 importItems)
   in /Source/ApplicationServices/LibraryCommands.cs:line 327
   at ApplicationServices.LibraryCommands.ImportAccountAsync(Func`2
   apiExtendedfunc, Account[] accounts) in
   /Source/ApplicationServices/LibraryCommands.cs:line 144
   at LibationCli.ScanOptions.ProcessAsync() in
   /Source/LibationCli/Options/ScanOptions.cs:line 35
   at LibationCli.OptionsBase.Run() in
   /Source/LibationCli/Options/_OptionsBase.cs:line 15

scan Usage:

  --help               Display this help screen.

  Accounts (pos. 0)    Optional: user ID or nicknames of accounts to scan.

Error processing book. Skipping. This book will be tried again on next attempt. For options of skipping or marking as error, retry with main Libation app.. See log for more details.
Error processing book. Skipping. This book will be tried again on next attempt. For options of skipping or marking as error, retry with main Libation app.. See log for more details.
Error processing book. Skipping. This book will be tried again on next attempt. For options of skipping or marking as error, retry with main Libation app.. See log for more details.
2024-11-20 11:53:07 info: initializing libation
2024-11-20 11:53:07 info: loading AccountsSettings.json
2024-11-20 11:53:07 info: loading Settings.json
2024-11-20 11:53:07 info: loading settings
2024-11-20 11:53:07 info: setting Books to /data
2024-11-20 11:53:07 info: setting InProgress to /tmp
2024-11-20 11:53:07 info: loading database
2024-11-20 11:53:07 info: database found at /config/LibationContext.db
2024-11-20 11:53:07 info: running every 30m
2024-11-20 11:53:07 info: scanning accounts
Scanning Audible library. This may take a few minutes.
2024-11-20 11:53:24 info: liberating books
DownloadDecryptBook Begin: 05/15/2020 [B088G1N76W] Ep. 4: Aliens!
DownloadDecryptBook Completed: 05/15/2020 [B088G1N76W] Ep. 4: Aliens!
DownloadDecryptBook Begin: 05/15/2020 [B088G39G8G] Ep. 3: Robots & Artificial Intelligence
DownloadDecryptBook Completed: 05/15/2020 [B088G39G8G] Ep. 3: Robots & Artificial Intelligence
DownloadDecryptBook Begin: 05/15/2020 [B088GSYJMP] Ep. 2: Elevating Black Voices
DownloadDecryptBook Completed: 05/15/2020 [B088GSYJMP] Ep. 2: Elevating Black Voices
Done. All books have been processed
rmcrackan commented 4 days ago

It looks like it's having issues writing to the database. Can you attach your actual log file?

Also, can you try via the graphic user interface and see if it still fails?

The folder with the log files and the database file (LibationContext.db), is there some software possibly locking files in that? Like a file sync'ing service like dropbox/gdrive/icloud?

sarg3nt commented 3 days ago

@rmcrackan I use the Docker image and didn't realize the latest pulled pre-releases versions and looks like there are some breaking changes. https://github.com/rmcrackan/Libation/blob/master/Documentation/Docker.md I know relying on latest is bad practice. I was being lazy. :) Reverting to 11.1.0 fixed it. Should we be trying to run the pre-release version or would you recommend against it?

Sorry no logs. I couldn't find them in the data folder I have mounted for the container. There were a bunch of old logs but no new ones. Now that I've reverted I see new log files being generated though. I'm guessing if I add the user:group perms the Docker.md file mentioned the latest version would work. I can try that but am wondering what your recommendation would be, should we run pre-release? If your recommendation is to not run pre-release you probably want to change your pipeline to not tag pre-release images as latest.

rmcrackan commented 3 days ago

Should we be trying to run the pre-release version or would you recommend against it?

They're usually safe, but y'know -- they're pre-release for a reason.

Also, officially docker is unsupported. I want to get it right but I don't use docker and I offer it only as a convenience. I didn't write any of the docker stuff; other people did. So I'm not sure what sets it to 'latest' or in what way I should change it. I'll ask those folks if they know the cure. (It's unsupported, but I'd like it to be correct if I can help it.)

sarg3nt commented 3 days ago

Fixing the file permissions fixed the issues with latest version. Just an FYI to everyone. I just did a chown -R 1001:1001 <my libation data folder> and chown -R 1001:1001 <my book data folder> and that fixed it.

pixil98 commented 3 days ago

As the author of the docker changes, they should be ready to use. I've been running them in my production deployment for a few weeks now and haven't had any problems. I'm not sure what goes into whether a release of Libation is flagged as a pre-release or not, but I expect we should not be tagging images as latest for pre-releases. Looking at the pipeline, it doesn't have any knowledge of whether it's a pre-release or not. It would require some changes and likely need to key off of something in the tag name.

With all that said, is there a better way we could have released this that would have not broken your deployments? It seems like any breaking change would have been a problem when using the latest tag. If we hadn't built the latest tag now, this would eventually make it into the next full release and cause a breaking change with the latest tag then.

@rmcrackan do you follow Semantic Versioning when making releases? Maybe it should have been a major version bump to indicate that there was breaking change. This wouldn't have helped with the latest tag though. The semver spec also covers what a pre-release version should look like. The pipeline could be updated to check that and handle it differently.

rmcrackan commented 3 days ago

Every release gets its version from here:

https://github.com/rmcrackan/Libation/blob/eadf7cff79308b80ba19c332871c3c237521eca7/Source/AppScaffolding/AppScaffolding.csproj#L5

I don't use the hyphen stuff for pre-releases because unfortunately, the full release vs pre-release step can only happen directly on github. It's separate from my build process. I start a build and after it's entirely successful, I have to go to github where it's a "draft". Then I choose how to handle the draft: release, pre-release, or discard. I actually like it because it can be a pre-release until I feel like flipping the switch and make the same one a full release without needing another cycle. Or, as has happened before, if there's something wrong with a release I can turn it back into a pre-release so the auto-updater won't grab it.

Teapotsing commented 1 day ago

Sorry, the image didn't come through. Can you attach your log file?

IMG_2031

sorry! It’s just this for every book at the moment, I’m not at all techy so it might be me

rmcrackan commented 1 day ago

Since it looks like you’re using Windows, the log files are probably in C:\Users\[username]\Libation. Please attached the latest log file to this ticket.

I am about to be out of town for a while so no rush. And I’ll look at your log when I return.