Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker not downloading #1137

Open
ducamagnifico opened this issue Feb 11, 2025 · 33 comments
Open

Docker not downloading #1137

ducamagnifico opened this issue Feb 11, 2025 · 33 comments
Labels
bug Something isn't working

Comments

@ducamagnifico
Copy link

Hi!
As of last night, my docker instance on unraid server no longer downloads from either my audible US or my audible Italy. It's only been about 12 hours, but I don't think, fingers crossed, I triggered anything on the Italian audible by downloading too much. To be on the safe side, I just added a few books to my American account and restarted the libation container. Although it saw the books, it errored out.
I changed the sleep time beforehand to 25 minutes from the 30. Thinking that this could have been a contributing factor, I changed it back to 30, but no change in results.
I've re-installed the libation docker and copied over fresh settings.json and AccountsSettings.json from my Arch linux desktop 11.6.4-1, with the same results. The desktop is working, just not the docker.
I know this is not officially supported, so I understand if you are unable to do anything about it. I just thought you should be aware and run it by you in case you had a suggestion.
Thank you so much and I'm attaching the log file(sorry the first part is cut off due to the long length. It did show it saw the books and attempted to download them.
Ducato

LibationCrash.log

@ducamagnifico ducamagnifico added the bug Something isn't working label Feb 11, 2025
@wtanksleyjr
Copy link
Contributor

wtanksleyjr commented Feb 11, 2025 via email

@ducamagnifico
Copy link
Author

Thanks for getting back so quickly! I am running the libation docker on unraid 7, through the GUI. I did have to give full read/write privileges to owner/group/other once again after my re-install(the logs had reminded me). I had not changed the permissions when it stopped uploading. I did not use docker compose, but rather used the docker file in the unraid repository:

Application Type Docker
Categories MediaApp:Books, Tools:Utilities
Added May 9, 2024
Downloads More than 50,000
Repository rmcrackan/libation:latest
DockerHub Stars: 1
Last Update: Jan 7, 2025

I leave it checked always on and to run every 30 minutes(default).
I searched the appdata folder but didn't see a .yml file, only these 3:

root@Tower /m/u/a/Libation# ls -a
./ ../ AccountsSettings.json LibationContext.db Settings.json

Sorry, my knowledge of docker containers is limited, so if you can point me to where I might find the .yml file, I will be more than happy to assist :-)

@wtanksleyjr
Copy link
Contributor

wtanksleyjr commented Feb 11, 2025 via email

@ducamagnifico
Copy link
Author

Thanks once again for the really quick response! I appreciate you! I have to run to dinner, so this may have to wait until the morning, but I will follow what you just wrote me and promise to get back with the results straight away!

@ducamagnifico
Copy link
Author

ducamagnifico commented Feb 13, 2025

Okay, I wanted to try several things before getting back to you.
I've enabled full read/write permissions not only for all Libation files, but for my audiobook folder on unraid 7.
It would appear that doing these things, which I'll explain below, allows me consistently to download exactly one audiobook at a time (out of many added to the Plus catalog). After downloading one audiobook, it consistently throws the repeated error:
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[[System.ValueTuple3[[Microsoft.EntityFrameworkCore.EntityState, Microsoft.EntityFrameworkCore, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.EntityFrameworkCore.EntityState, Microsoft.EntityFrameworkCore, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Boolean, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode1<System.ValueTuple3<Microsoft.EntityFrameworkCore.EntityState,Microsoft.EntityFrameworkCore.EntityState,Boolean>>, System.Func2<Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode1<System.ValueTuple3<Microsoft.EntityFrameworkCore.EntityState,Microsoft.EntityFrameworkCore.EntityState,Boolean>>,Boolean>)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph(Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry, Microsoft.EntityFrameworkCore.EntityState, Microsoft.EntityFrameworkCore.EntityState, Boolean)
at Microsoft.EntityFrameworkCore.DbContext.SetEntityState(Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry, Microsoft.EntityFrameworkCore.EntityState)
at Microsoft.EntityFrameworkCore.DbContext.SetEntityState[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon, Microsoft.EntityFrameworkCore.EntityState)
at ApplicationServices.LibraryCommands.updateUserDefinedItem(System.Collections.Generic.IEnumerable1<DataLayer.LibraryBook>, System.Action1<DataLayer.UserDefinedItem>)
at System.Threading.Tasks.Task`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
/libation/liberate.sh: line 114: 66 Aborted /libation/LibationCli liberate

I have 2 audible accounts, one in the U.S. and one in Italy. The desktop Libation downloads without problem from both accounts.
I have done a fresh intall of the Libation docker and copied over the AccountsSettings.json and Settings.json and still had the error.
I then went into the desktop Libation and unchecked the Italy account and then freshly copied over the 2 files to the docker and restarted docker Libation.
I then unchecked the U.S. account and re-checked the Italy account then then copied the 2 files and restarted docker..
I then re-checked the U.S. account so both were checked and copied the 2 files and restarted docker.

It is a bit baffling for me, with my limited knowledge, but I am consistently getting exactly one book before erroring out on the docker.
I really have no explanation. The docker had been working brilliantly for me for the last couple of months.

As a stopgap, I'll just use the desktop Libation, then compress the file and use Tailscale to send it to the Unraid server.

I don't know if I'm overlooking something, and once again I know you don't officially support the docker, I just wanted you to know the steps I've taken and your work is very much appreciated!
Ducato

@wtanksleyjr
Copy link
Contributor

wtanksleyjr commented Feb 13, 2025 via email

@ducamagnifico
Copy link
Author

ducamagnifico commented Feb 13, 2025

Yes, although I did it through their GUI. Owner(User)/Group/Other are all set to read + write, which is the highest level offered. The only thing I didn't keep was the container in "privileged" mode(though I even tried that one time). Privileged for docker would allow full access to all other containers, a security risk. Having said that, I even gave that a shot as well just to see if it would make a difference, which it didn't, so I removed privileged. But all the files within Libation I have full chmod u+rw -R.

@ducamagnifico
Copy link
Author

I forgot to mention one thing. The docker is not remembering the one book it will download, so on subsequent attempts it tries the same book again, even though it's already in the downolad folder(which I gave full read/write permissions to owner/group/user as well. I have to go into the desktop Libation and click "Set to downloaded" and then re-copy the files to the docker for it to not try that one book anymore and it will then move on to the next book and allow one download only, still trying on subsequent attempts once again to download the same book, and the cycle repeats. I have made sure that I have set the audiobooks folder correctly within docker.
I will continue to persevere, trying new things as I think of them! :-D

@ducamagnifico
Copy link
Author

I just copied from Unraid the Libation appdata folder permissions so you could see it:

AccountsSettings.json root -rw-rw-rw- 11.9 KB 2025-02-13 06:17 cache ...
LibationContext.db UNKNOWN -rw-rw-rw- 12.8 MB 2025-02-13 07:40 cache ...
Settings.json root -rw-rw-rw- 1.90 KB 2025-02-13 06:17 cache ...

@wtanksleyjr
Copy link
Contributor

wtanksleyjr commented Feb 13, 2025 via email

@ducamagnifico
Copy link
Author

Sorry, you and I were writing at the same time!
I just copied from Unraid the Libation appdata folder permissions so you could see it:

AccountsSettings.json root -rw-rw-rw- 11.9 KB 2025-02-13 06:17 cache ...
LibationContext.db UNKNOWN -rw-rw-rw- 12.8 MB 2025-02-13 07:40 cache ...
Settings.json root -rw-rw-rw- 1.90 KB 2025-02-13 06:17 cache ...
wtanksleyjr

@ducamagnifico
Copy link
Author

The strange thing though is that it does write exactly one audiobook at a time and immediately shows up in my audiobookshelf.
I'll continue trying...

@ducamagnifico
Copy link
Author

ducamagnifico commented Feb 13, 2025

That means Libation can't write to the database - clearly it can read it,
so it's in the right place, but it can't change it when done.

This is absolutely a user permissions issue, that page I gave you should
document the chown command, but you need to find which user you are (the
page recommends a command, I think it's id).

I will take another look and try manually on the command line....and Thank You!

@wtanksleyjr
Copy link
Contributor

wtanksleyjr commented Feb 13, 2025 via email

@ducamagnifico
Copy link
Author

ducamagnifico commented Feb 13, 2025

Right now I am running as root:
root@Tower:~# id
uid=0(root) gid=0(root) groups=0(root)

Yes, I've just tried all Libation files even as root owner, while trying to figure out where unraid actually stores the docker files so that I can use the terminal(I know where the appdata is, I just don't yet know which file holds the actual container yet, but I am investigating). In the meantime I am running as root.
Unraid offers 2 choices, "nobody" and "root" for file ownership. Previously, I had the default , "nobody". Nobody obviously is safer with limited permissions. I've been fooling with switching these between nobody and root to see if it makes a difference, but so far it hasn't . I've even changed the Libation appdata container to root temporarily, but again without effect.
I am scratching my head though as to why I am able to write exactly one book, but no more.

@ducamagnifico
Copy link
Author

ducamagnifico commented Feb 13, 2025

AccountsSettings.json	nobody	-rw-rw-rw-	11.9 KB	2025-02-13 06:17	cache	...
	LibationContext.db	nobody	-rw-rw-rw-	12.8 MB	2025-02-13 08:06	cache	...
	Settings.json	nobody	-rw-rw-rw-	1.90 KB	2025-02-13 06:17	cache	

Changed owner back to limited and will continue perservering. Thanks once again!

@wtanksleyjr
Copy link
Contributor

wtanksleyjr commented Feb 13, 2025 via email

@ducamagnifico
Copy link
Author

ducamagnifico commented Feb 13, 2025

Aaaahhhh....I wouldn't have known that about the single file...that's why you're the expert!

I even brought the appdata back to nobody ownership.

Here are 4 screenshots, 2 of the actual edit file for libation docker(it was too long for one) and one of the appdata file for libation. The data structure to reach it is /mnt/user/appdata/Libation.

Thanks so much for the help. You've always been great to me, but I know you're busy so I don't want to monopolize your time!

Image
Image
Image
Image

@wtanksleyjr
Copy link
Contributor

wtanksleyjr commented Feb 13, 2025 via email

@CLHatch
Copy link
Contributor

CLHatch commented Feb 13, 2025

From what I'm reading, there may be a way to bypass this completely. Apparently there is a "Docker Compose" plugin for unraid. Using that, you should be able to "roll your own" install of Libation using Docker Compose, and specify the user in the compose file.

@ducamagnifico
Copy link
Author

Thanks once again for a great suggestion! Once I have some info I won't hesitate to pass it on to you. The open source community is awesome that way, helping each other.
I may be able to figure this out myself(just unfortunately not being well-versed in docker, a little slowly). There is an unraid terminal that I use all the time, just for things I know a little better :-) Tommorow, I'm going to try to peel away the onion a bit to see where the actual container lies so that I can cd into it and effect the ownership change, or at least try to. If that proves a bit challenging, I'll definitely reach out to the Unraid team/developer with your suggestions. Once again, I can't thank you enough and I'll definitely reach back out to you when I have more info!

@ducamagnifico
Copy link
Author

From what I'm reading, there may be a way to bypass this completely. Apparently there is a "Docker Compose" plugin for unraid. Using that, you should be able to "roll your own" install of Libation using Docker Compose, and specify the user in the compose file.

Yes, there is a docker compose and I've used it twice, following instructions. Again, I'm not expert in docker, but if someone gives me instructions, I'm pretty damn good at following them :-D
I'll look into that route as well. Tnanks!

@wtanksleyjr
Copy link
Contributor

wtanksleyjr commented Feb 13, 2025 via email

@ducamagnifico
Copy link
Author

Oh, that's good to know. I'll peruse the docs as well.

@CLHatch
Copy link
Contributor

CLHatch commented Feb 13, 2025

Yes, I think we have an example docker-compose file somewhere in the docs,
and if pressed I might be able to figure out how to set its user.

The format for that is just user: 1000:1000.

@ducamagnifico
Copy link
Author

I did see that in the page you sent me

@bentrop
Copy link

bentrop commented Feb 15, 2025

I just ran into this issue myself and already wrote to the original template author on the Unraid forums about the breaking changes. Let's hope it will be fixed shortly.

A quick and dirty workaround to somehow get it working again until the Unraid template has been fixed is to add "-u 99:100" under "Extra Parameters" in the Docker's config on Unraid (likely requires "Advanced View" to be turned on). But that still writes files with an incorrect UMASK. So, not great ...

@ducamagnifico
Copy link
Author

ducamagnifico commented Feb 15, 2025

I just ran into this issue myself and already wrote to the original template author on the Unraid forums about the breaking changes. Let's hope it will be fixed shortly.

A quick and dirty workaround to somehow get it working again until the Unraid template has been fixed is to add "-u 99:100" under "Extra Parameters" in the Docker's config on Unraid (likely requires "Advanced View" to be turned on). But that still writes files with an incorrect UMASK. So, not great ...

Thank you very much. I was going to write the template author myself this evening, but you beat me to the punch!
Thank you for giving me the quick and dirty work around. I was fooling with extra parameters to try to change ownership, but I didn't do it correctly, so I'm glad you posted how to do it properly.
Thanks once again for a stopgap, but great measure!
Follow up:
Implemented your changes, but unfortunately they didn't work for me. Still only getting the first book before throwing errors.
Thank you though and I'm glad it's working on your end.

@nwithan8
Copy link

Unraid template author here, thanks @bentrop for pinging me about this on the forums. I'm working on updating the template for the user:group fix you mentioned, but yeah, still going to run into the UMASK issue. Wondering if @rmcrackan has any insight into the UMASK used by the in-container user and if there could be a way to override that via an environmental variable?

@wtanksleyjr
Copy link
Contributor

Wow, that's terrifying. I wonder why we've never hit this with any of the other Linux installs?

@bentrop
Copy link

bentrop commented Feb 17, 2025

Implemented your changes, but unfortunately they didn't work for me. Still only getting the first book before throwing errors.

Did you fix the ownership of your config files/folders? Once that mess had been cleaned up and corrected, Libatian is working like it should for me, except for the UMASK issue. That's minor-ish: data downloaded via libation is stored read-only for share access users, should be rw in order to follow Unraid App standards.

Wow, that's terrifying.

Unraid does a bunch of things differently and isn't just another Linux distribution. I wouldn't exactly call its security top-notch - that's certainly not its focus, and it certainly makes a bunch of security trade-offs for convenience (and some organically grown sub-optimums), but "terrifying" is a bit of a stretch.

The default docker user is generally nobody:x:99:100:nobody, and files are generally umasked to allow r/w-access by share access users. That's secure enough for what Unraid does.

@rmcrackan
Copy link
Owner

@nwithan8 Thanks for joining the conversation. I'm afraid I'm not going to be much help. I know basically nothing about docker. All of the docker-related files in this repo were written by others.

The upshot about this being a community driven feature is that I'll be happy to look at your PRs also if you have suggestions. I'm happy to provide docker unofficially and I love how far it's come without needing me at all -- just users helping other users.

@ducamagnifico
Copy link
Author

Implemented your changes, but unfortunately they didn't work for me. Still only getting the first book before throwing errors.

Did you fix the ownership of your config files/folders? Once that mess had been cleaned up and corrected, Libatian is working like it should for me, except for the UMASK issue. That's minor-ish: data downloaded via libation is stored read-only for share access users, should be rw in order to follow Unraid App standards.

Yes. I can confirm that ownership is nobody(even tried as root) and user/group/other are all -rw.

Still getting the Microsoft.EntityFrameworkCore.DbContext errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants