mirror of
https://github.com/tubearchivist/tubearchivist-jf.git
synced 2026-03-24 05:26:49 +00:00
[GH-ISSUE #10] On 1st run: TimeoutError and on 2nd run: FileExistsError #8
Labels
No labels
duplicate
enhancement
help wanted
help wanted
invalid
pull-request
question
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tubearchivist/tubearchivist-jf#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cryodream on GitHub (Aug 16, 2023).
Original GitHub issue: https://github.com/tubearchivist/tubearchivist-jf/issues/10
I tried testing out this TA and Jellyfin integration. I am running docker containers on unraid.
A brand new TubeArchivist v0.4.0 with only 3 videos.
A dedicated Jellyfin 10.8.10 (from hotio).
On the first run I get timeout error on creating a season folder, even though it actually gets created:
On the second run I get file exists error, when it finds that previously created folder:
Files before running the script:

And after:

Huh... 🤪 Is this a file permissions problem, something else, or a bug?
@bbilly1 commented on GitHub (Aug 16, 2023):
I've added a short limitations section to the readme here:
https://github.com/tubearchivist/tubearchivist-jf#limitations
But ultimately as the error message says, JF doesn't pickup the temporary season folder created and the extension will eventually give up.
@cryodream commented on GitHub (Aug 16, 2023):
So does this mean, that
tubearchivist-jfcreates the season folder asrootand thenjellyfindoes not see it? Or am I misunderstanding something?If yes, how can I force
tubearchivist-jfto usenobody:users?Or do I have to run
jellyfinasroot?@bbilly1 commented on GitHub (Aug 16, 2023):
this is only tested as in the example compose file on regular Ubuntu server. there it doesn't need any permission changes.
not sure about unraid though.
please help with making this compatible by making a PR.
@cryodream commented on GitHub (Aug 16, 2023):
As a temporary solution, I've managed to make it work by running a separate jellyfin container as
root.Just FYI, delete/remove the
PUIDandPGIDenv variables from your jellyfin'sdocker-compose.yamlor in my case - jellyfin's CA template (unraid).@bbilly1 sorry, I've got too little experience with both python and docker to be able to make a PR.
@bbilly1 commented on GitHub (Aug 17, 2023):
would chmod 777 work on that temporary season folder 2023? would that allow JF to find the folder?
@birdwing commented on GitHub (Aug 30, 2023):
I believe so. I had a similar issue.
I have Tubearchivist running in a docker container, with the /youtube folder being mounted to the local filesystem, rather than a docker Volume.
After I setup Tubearchivist I finally got around to setting up portainer. So Tubearchivist-jf and Jellyfin are running inside of Portainer, and Tubearchivist is running outside of portainer. I ended up creating a NFS share of the /youtube folder so that portainer could access it (through a NFS volume inside portainer).
I had permission issues until I ran a recursive chmod command on the /youtube folder:
I then ran into the issue that I was using the HOST_UID and HOST_GID environment variables for tubearchivist, so the chmod was short lived. I removed the HOST_UID and HOST_GID so that Tubearchivist was using the container user. Re-ran the chmod command, and all has worked well.
So I believe that chmod 777 would work. I ran it recursively on the entire /youtube directory, and have had no issues since.
I think as long as tubearchivist isn't configured to use a host user (HOST_UID and HOST_GID) and the /youtube folder is mounted instead of used as a volume, then chmod works.
@birdwing commented on GitHub (Aug 30, 2023):
I take back everything I just said.....
I just had a permissions issue. Seems like TA marks all videos as Owned by the container user, or the specified Host user (even if HOST_UID and HOST_GID are blank) this breaks the permissions and prevents the files from being modified by the tubearchivist-jf container.
It seems like the issue is the permissions that Tubearchivist itself assigns the files that are downloaded.
I am getting permission issues on Tubearchivist-jf, not jellyfin.
Jellyfin can see the files, however Tubearchivist-jf does not have permission to create the temporary season folders inside of the /youtube folder managed by Tubearchivist itself.
Is there a way to have Tubearchivist create it's folders and files with more open permissions?
@birdwing commented on GitHub (Aug 30, 2023):
Just confirmed.
I have HOST_UID and HOST_GID disabled. I set the /youtube to be owned by nobody, and chmod 777.
Tubearchivist downloaded a new video for a new channel:
And that new directory (3rd from top) was created as owned by root without full permissions.
Running
python main.pyon Tubearchivist-jf gives me this error:So the issue is Tubearchivist-jf can't create the necessary directories for Jellyfin to read because the permissions that TA puts in by default are too strict.
Those permissions only work if all the docker containers are running on the same host, this means that it is currently impossible to mount the TA directory to a NFS, or any other external source (or in my case my own stupidity of having some docker containers inside portainer and others outside portainer)
@birdwing commented on GitHub (Aug 30, 2023):
I should just finish my testing before posting, but I did get the NFS to work.
In the /etc/exports file for NFS you have to set the "no_root_squash" option for the NFS share
The no_root_squash option is what allows the tubearchivist-jf "root user" to access the files created by the tubearchivist "root user" across an NFS.
So I have found that in my case:
Allows both Jellyfin and tubearchivist-jf to properly access the folders and files.
@numkem commented on GitHub (Oct 3, 2023):
I've opened a PR that fixes the
FileExistsErrorand addresses another issue I found when trying to find a season.@bbilly1 commented on GitHub (Oct 18, 2023):
new release v0.1.2 handles the FileExistsError. Additionally temporary folders are created with umask 777 now, solving permission problems, at least in some cases.
If you need more control under what user this runs, you might want to use the standalone installation instead.