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

Unable to load root folders #228

Closed
1 task done
fahadshery opened this issue Apr 15, 2024 · 14 comments
Closed
1 task done

Unable to load root folders #228

fahadshery opened this issue Apr 15, 2024 · 14 comments

Comments

@fahadshery
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I can see all my movies INSIDE the container.
I can also write to the /movies folder from INSIDE the container.
But I am unable to import my existing movies.
I have been using the same movies folder for few years without any issues.
This is what I see:
image

and this is the error I see when try and import:
image

Expected Behavior

Being able to import my existing movies.

Steps To Reproduce

Just spin up the docker and portainer.
Then setup using docker compose

Environment

- OS:Ubuntu
- How docker service was installed:
Official documentation

CPU architecture

x86-64

Docker creation

---
services:
  radarr:
    image: lscr.io/linuxserver/radarr:latest
    container_name: radarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - /home/user/radarr/config:/config
      - /mnt/nas/entertainment/movies:/movies #optional
      - /mnt/nas/transmission/downloads:/downloads #optional
    ports:
      - 7878:7878
    restart: unless-stopped

Container logs

{"message":"One or more errors occurred. (Resource temporarily unavailabl)","description":"System.AggregateException: One or more errors occurred. (Resource temporarily unavailabl)\n ---> System.InvalidOperationException: Resource temporarily unavailabl\n ---> Mono.Unix.UnixIOException: Resource temporarily unavailabl [EWOULDBLOCK].\n --- End of inner exception stack trace ---\n at Mono.Unix.UnixDriveInfo.Refresh(Boolean throwException)\n at Mono.Unix.UnixDriveInfo.Refresh()\n at Mono.Unix.UnixDriveInfo.get_AvailableFreeSpace()\n at NzbDrone.Mono.Disk.ProcMount.get_AvailableFreeSpace() in ./Radarr.Mono/Disk/ProcMount.cs:line 23\n at NzbDrone.Mono.Disk.DiskProvider.GetAvailableSpace(String path) in ./Radarr.Mono/Disk/DiskProvider.cs:line 53\n at NzbDrone.Core.RootFolders.RootFolderService.<>c__DisplayClass15_0.<GetDetails>b__0() in ./Radarr.Core/RootFolders/RootFolderService.cs:line 225\n at System.Threading.Tasks.Task.InnerInvoke()\n at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)\n at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)\n--- End of stack trace from previous location ---\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\n --- End of inner exception stack trace ---\n at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\n at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\n at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout)\n at NzbDrone.Core.RootFolders.RootFolderService.GetDetails(RootFolder rootFolder, Dictionary`2 moviePaths, Boolean timeout) in ./Radarr.Core/RootFolders/RootFolderService.cs:line 220\n at NzbDrone.Core.RootFolders.RootFolderService.Add(RootFolder rootFolder) in ./Radarr.Core/RootFolders/RootFolderService.cs:line 125\n at Radarr.Api.V3.RootFolders.RootFolderController.CreateRootFolder(RootFolderResource rootFolderResource) in ./Radarr.Api.V3/RootFolders/RootFolderController.cs:line 56\n at lambda_method72(Closure , Object , Object[] )\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()\n--- End of stack trace from previous location ---\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\n--- End of stack trace from previous location ---\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\n at Radarr.Http.Middleware.BufferingMiddleware.InvokeAsync(HttpContext context) in ./Radarr.Http/Middleware/BufferingMiddleware.cs:line 27\n at Radarr.Http.Middleware.IfModifiedMiddleware.InvokeAsync(HttpContext context) in ./Radarr.Http/Middleware/IfModifiedMiddleware.cs:line 40\n at Radarr.Http.Middleware.CacheHeaderMiddleware.InvokeAsync(HttpContext context) in ./Radarr.Http/Middleware/CacheHeaderMiddleware.cs:line 32\n at Radarr.Http.Middleware.StartingUpMiddleware.InvokeAsync(HttpContext context) in ./Radarr.Http/Middleware/StartingUpMiddleware.cs:line 37\n at Radarr.Http.Middleware.UrlBaseMiddleware.InvokeAsync(HttpContext context) in ./Radarr.Http/Middleware/UrlBaseMiddleware.cs:line 26\n at Radarr.Http.Middleware.VersionMiddleware.InvokeAsync(HttpContext context) in ./Radarr.Http/Middleware/VersionMiddleware.cs:line 28\n at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)\n at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)\n at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)"}
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@aptalca
Copy link
Member

aptalca commented Apr 15, 2024

I can also write to the /movies folder from INSIDE the container.

You're likely exec'ing into the container as root, but radarr runs as user abc inside, which is mapped to the PUID/PGID you set in docker arguments

@fahadshery
Copy link
Author

You're likely exec'ing into the container as root, but radarr runs as user abc inside, which is mapped to the PUID/PGID you set in docker arguments

Yes and that PUID and PGID is mapped to my user which can read/write/execute in the /movies folder.

Here is how I am mounting the cifs share:
//192.168.10.90/media /mnt/nas/media cifs uid=1000,gid=1000,credentials=/home/myuser/.smbcreds 0 0

@Mafyuh
Copy link

Mafyuh commented Apr 16, 2024

I am having same exact issue. everything still works, adding new movies, importing from download client, literally everything besides seeing root folders and importing movies manually, ive tried downgrading versions the past few weeks, and still the same. I can delete movies still from the ui. I only set up this VM about 6 weeks ago and everything was fine then. I guess i havent tried to manually import since then so I'm not sure when it started.

My fstab for mounting:
//ip/share-name/Media /data/media cifs username=username,password=password,uid=1000,gid=1000,auto,nofail 0 0
Ive tried re-running some permissions commands:
sudo chown -R $USER:$USER /data
sudo chmod -R a=,a+rX,u+w,g+w /data
My PUID/PGID are set same as above docker compose. I'm just mapping /data:/data

I am getting the same exact error message as well.

Docker version 26.0.1, build d260a54
Ubuntu 22.04.4

EDIT: Updated to Ubuntu 24 with docker version 26.1.0 and its fixd

@alexneth
Copy link

I have also encountered this issue. Updating to Ubuntu 24 and docker 26.1.0 like mentioned by Mafyuh above, did not work for me. The only way I managed to get this to work was to set both PUID and PGID to 0.

@thespad
Copy link
Member

thespad commented May 20, 2024

That means you have permissions issues, which you're bypassing by having radarr run as root, which we neither recommend, or support.

@LinuxServer-CI
Copy link
Contributor

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

@danthonywalker
Copy link

danthonywalker commented Jul 11, 2024

I am getting a similar error, except trying to add a root folder says it has invalid permissions.
My compose:

  radarr:
    image: lscr.io/linuxserver/radarr:5.7.0.8882-ls228
    container_name: radarr
    restart: unless-stopped
    environment:
      PUID: ${RADARR_PUID}
      PGID: ${PGID}
      UMASK: ${UMASK}
      TZ: ${TZ}
    networks:
      - proxy
    volumes:
      - radarr:/config
      - data:/data

When I try adding a root folder:

Unable to add root folder

    Folder '/data/media/movies/' is not writable by user 'abc'

Yet, /data/media/movies has the following permissions:

truenas1# ls -ld movies
drwxrwxr-x  2 nobody  arr  2 Jul 10 17:20 movies

The arr group is the same as ${PGID}, confirmed by the logs:

───────────────────────────────────────

GID/UID

───────────────────────────────────────

User UID:    10023

User GID:    90075961

The container sees the permissions as such:

drwxrwxr-x 2 nobody abc 2 Jul 10 17:20 movies/

Which if abc is mapped to the PUID/PGID then this should be fine.

So I'm unsure what to do...

@sonicd007
Copy link

sonicd007 commented Aug 8, 2024

I'm running into the same issue. abc user has 1000 as PID and GID and I confirm the directory has the same permissions from within the container but abc is unable to write to the directory.

radarr:
    image: lscr.io/linuxserver/radarr:latest
    container_name: radarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /media/sonicd007/Media/radarr/data:/config
      - /media/sonicd007/Media/media/movies:/media/movies #optional
      - /media/sonicd007/Media/media/tv:/media/tv #optional
      - /media/sonicd007/Media/download-client-downloads:/downloads #optional
    ports:
      - 7878:7878
    restart: unless-stopped
abc@b6e819d93d3b:/media$ ls -la
total 28
drwxr-xr-x 1 root root 4096 Aug  8 12:41 .
drwxr-xr-x 1 root root 4096 Aug  8 12:41 ..
drwxr-xr-x 2 root root 4096 Jul 27 13:31 cdrom
drwxr-xr-x 2 root root 4096 Jul 27 13:31 floppy
drwxr-xr-x 2 root root 4096 Aug  8 12:41 movies
drwxr-xr-x 2 root root 4096 Aug  8 12:41 tv
drwxr-xr-x 2 root root 4096 Jul 27 13:31 usb
abc@b6e819d93d3b:/media$ cd movies
abc@b6e819d93d3b:/media/movies$ touch test
touch: cannot touch 'test': Permission denied
abc@b6e819d93d3b:/media/movies$ id
uid=1000(abc) gid=1000(users) groups=1000(users)

@j0nnymoe
Copy link
Member

j0nnymoe commented Aug 8, 2024

Assuming this is a USB drive, it's mounted as root, the device needs to be mounted and the folders need to be owned by the uid/gid you're using.

@sonicd007
Copy link

I was able to resolve the issue on my end by changing the docker container's directory mapping to /data/media instead of /media. I think since /media is already a directory in Linux this may have been causing issues with the mount. Once changed, the /data directory is owned by root but the subdirectories are owned by user abc and thus I can write/read to those directories.

The mounted media is an nvme disk drive on the host machine just fyi.

So two ways to solve this, either change the mount directory within the docker container or docker exec -it radarr /bin/bash and chown the directory you want chown abc:abc /media.

A third alternative might be to create your own image based off the radarr image where you can do the chown command there so it's automated but I would say just change the mounting directory on the container.

@sonicd007
Copy link

Nevermind, I thought that solution worked but it didn't. I still have to chown the directory for it to work

@sonicd007
Copy link

sonicd007 commented Aug 8, 2024

Last update, I think the issue is that within docker compose the abc user will only have access to the mounted directory NOT the entire path to the mounted directory. I had to change my volumes like so

volumes:
      - /media/sonicd007/Media/radarr/data:/config
      - /media/sonicd007/Media/media/:/data/media/
      - /media/sonicd007/Media/media/download-client-downloads:/downloads #optional
      # - /media/sonicd007/Media/media/movies:/data/media/movies #optional
      # - /media/sonicd007/Media/media/tv:/data/media/tv #optional

Doing this lets user abc access the /data/media root directory for the general media setup settings and then I can add the movies and tv directory under the libraries section of radarr. This seems to work for me.

@j0nnymoe
Copy link
Member

j0nnymoe commented Aug 8, 2024

It just sounds like your ownership of the folders isn't setup correctly if you're needing to chown.

@thespad thespad closed this as completed Aug 11, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

9 participants