taylorbobaylor / TrailerDownloader

Downloads all missing trailers for movies in your Plex library
GNU General Public License v3.0
42 stars 10 forks source link

Value cannot be null (docker) #35

Closed VampiricAlien closed 5 months ago

VampiricAlien commented 1 year ago

One day it was working and the next it wasn't. Only shows 3 menu options. I've checked and checked movie directory, that's the right location and docker is set to access the host path and /movies.

`warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]

  Failed to determine the https port for redirect.

fail: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher[8]

  Failed to invoke hub method 'GetAllMoviesInfo'.

  System.ArgumentNullException: Value cannot be null. (Parameter 'input')

     at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)

     at System.Text.RegularExpressions.Regex.Replace(String input, String replacement)

     at TrailerDownloader.SignalRHubs.MovieHub.GetMovieFromDirectory(String movieDirectory) in /src/TrailerDownloader/SignalRHubs/MovieHub.cs:line 136

     at TrailerDownloader.SignalRHubs.MovieHub.GetAllMoviesInfo() in /src/TrailerDownloader/SignalRHubs/MovieHub.cs:line 59

     at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.ExecuteMethod(ObjectMethodExecutor methodExecutor, Hub hub, Object[] arguments)

     at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.<Invoke>g__ExecuteInvocation|18_0(DefaultHubDispatcher`1 dispatcher, ObjectMethodExecutor methodExecutor, THub hub, Object[] arguments, AsyncServiceScope scope, IHubActivator`1 hubActivator, HubConnectionContext connection, HubMethodInvocationMessage hubMethodInvocationMessage, Boolean isStreamCall)

fail: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher[8]

  Failed to invoke hub method 'GetAllMoviesInfo'.

  System.ArgumentNullException: Value cannot be null. (Parameter 'input')

     at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)

     at System.Text.RegularExpressions.Regex.Replace(String input, String replacement)

     at TrailerDownloader.SignalRHubs.MovieHub.GetMovieFromDirectory(String movieDirectory) in /src/TrailerDownloader/SignalRHubs/MovieHub.cs:line 136

     at TrailerDownloader.SignalRHubs.MovieHub.GetAllMoviesInfo() in /src/TrailerDownloader/SignalRHubs/MovieHub.cs:line 59

     at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.ExecuteMethod(ObjectMethodExecutor methodExecutor, Hub hub, Object[] arguments)

     at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.<Invoke>g__ExecuteInvocation|18_0(DefaultHubDispatcher`1 dispatcher, ObjectMethodExecutor methodExecutor, THub hub, Object[] arguments, AsyncServiceScope scope, IHubActivator`1 hubActivator, HubConnectionContext connection, HubMethodInvocationMessage hubMethodInvocationMessage, Boolean isStreamCall)

fail: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher[8]

  Failed to invoke hub method 'GetAllMoviesInfo'.

  System.ArgumentNullException: Value cannot be null. (Parameter 'input')

     at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)

     at System.Text.RegularExpressions.Regex.Replace(String input, String replacement)

     at TrailerDownloader.SignalRHubs.MovieHub.GetMovieFromDirectory(String movieDirectory) in /src/TrailerDownloader/SignalRHubs/MovieHub.cs:line 136

     at TrailerDownloader.SignalRHubs.MovieHub.GetAllMoviesInfo() in /src/TrailerDownloader/SignalRHubs/MovieHub.cs:line 59

     at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.ExecuteMethod(ObjectMethodExecutor methodExecutor, Hub hub, Object[] arguments)

     at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.<Invoke>g__ExecuteInvocation|18_0(DefaultHubDispatcher`1 dispatcher, ObjectMethodExecutor methodExecutor, THub hub, Object[] arguments, AsyncServiceScope scope, IHubActivator`1 hubActivator, HubConnectionContext connection, 

HubMethodInvocationMessage hubMethodInvocationMessage, Boolean isStreamCall)

fail: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher[8]

  Failed to invoke hub method 'GetAllMoviesInfo'.

  System.ArgumentNullException: Value cannot be null. (Parameter 'input')

     at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)

     at System.Text.RegularExpressions.Regex.Replace(String input, String replacement)

     at TrailerDownloader.SignalRHubs.MovieHub.GetMovieFromDirectory(String movieDirectory) in /src/TrailerDownloader/SignalRHubs/MovieHub.cs:line 136

     at TrailerDownloader.SignalRHubs.MovieHub.GetAllMoviesInfo() in /src/TrailerDownloader/SignalRHubs/MovieHub.cs:line 59

     at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.ExecuteMethod(ObjectMethodExecutor methodExecutor, Hub hub, Object[] arguments)

     at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.<Invoke>g__ExecuteInvocation|18_0(DefaultHubDispatcher`1 dispatcher, ObjectMethodExecutor methodExecutor, THub hub, Object[] arguments, AsyncServiceScope scope, IHubActivator`1 hubActivator, HubConnectionContext connection, HubMethodInvocationMessage hubMethodInvocationMessage, Boolean isStreamCall)`
taylorbobaylor commented 7 months ago

Hey @VampiricAlien - Can you try with the latest release and let me know if you're still having issues?

VampiricAlien commented 7 months ago

exec /usr/bin/dotnet: exec format error

The new update doesn't seem to support amd64?

taylorbobaylor commented 7 months ago

@VampiricAlien sorry about that..... Try this one here. Port listening inside the app needs to be 8080 now FYI.

VampiricAlien commented 7 months ago

@taylorbobaylor I was able to test the new image out, thanks for correcting that. Most of the movie posters displayed but downloading for me doesn't work. I got access denied to the path. The container has the same permissions as the movies. When one fails, it stops trying to download others.

Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]

      Failed to determine the https port for redirect.

info: TrailerDownloader.SignalRHubs.MovieHub[0]

      No movie found in directory: '/movies/test'

I don't have that set as the path.

VampiricAlien commented 5 months ago

@taylorbobaylor The following error happens when trying to download a trailer. The trailer file doesn't exist.

Error downloading trailer
Access to the path '/movies/movie-trailer.mp4' is denied.
TrailerDownloader.SignalRHubs.MovieHub[0]
taylorbobaylor commented 5 months ago

Hey @VampiricAlien can you pull the latest image and let me know if that works for you?

VampiricAlien commented 5 months ago

No longer working, can no longer get past first page.

Your application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively you may wish to switch to the Development environment.

         at Microsoft.AspNetCore.SpaServices.SpaDefaultPageMiddleware.<>c__DisplayClass0_0.<Attach>b__1(HttpContext context, RequestDelegate next)

         at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)

         at Microsoft.AspNetCore.SpaServices.SpaDefaultPageMiddleware.<>c__DisplayClass0_0.<Attach>b__0(HttpContext context, RequestDelegate next)

         at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)

         at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)

         at Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware.Invoke(HttpContext context)

         at Microsoft.AspNetCore.HttpsPolicy.HstsMiddleware.Invoke(HttpContext context)

         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.HandleException(HttpContext context, ExceptionDispatchInfo edi)

fail: Microsoft.AspNetCore.Server.Kestrel[13]

      Connection id "0HN41QQNNUNIG", Request id "0HN41QQNNUNIG:00000006": An unhandled exception was thrown by the application.

      System.UnauthorizedAccessException: Access to the path '/app/config.json' is denied.

       ---> System.IO.IOException: Permission denied

         --- End of inner exception stack trace ---

         at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)

         at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)

         at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)

         at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)

         at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)

         at TrailerDownloader.Repositories.ConfigRepository.SaveConfig(Config configs) in /src/TrailerDownloader/Repositories/ConfigRepository.cs:line 29

         at TrailerDownloader.Controllers.ConfigController.Post(Config configs) in /src/TrailerDownloader/Controllers/ConfigController.cs:line 29

         at lambda_method13(Closure, Object, Object[])

         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)

         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()

         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)

         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()

      --- End of stack trace from previous location ---

         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)

         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)

         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()

      --- End of stack trace from previous location ---

         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)

         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)

         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()

      --- End of stack trace from previous location ---

         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)

         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)

         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.HandleException(HttpContext context, ExceptionDispatchInfo edi)

         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
taylorbobaylor commented 5 months ago

Hmmmmmm.... I'm running it fine on my Synology setup..... Can you share you docker-compose or docker run command you're using? Did you clear out your config.json? Can you if you didn't?

VampiricAlien commented 5 months ago

For some reason the folder is empty.

On start up

warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]

      Storing keys in a directory '/home/app/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning

info: Microsoft.Hosting.Lifetime[14]

      Now listening on: http://[::]:8080

info: Microsoft.Hosting.Lifetime[0]

      Application started. Press Ctrl+C to shut down.

info: Microsoft.Hosting.Lifetime[0]

      Hosting environment: Production

info: Microsoft.Hosting.Lifetime[0]

      Content root path: /app

Is there a config file to download?

taylorbobaylor commented 5 months ago

No looks like it started up fine now. Can you share the command you're using to start the container? Or the section in the docker-compose?

VampiricAlien commented 5 months ago
docker run -d \
  --name=movie-trailer-downloader \
  -p 6767:8080 \
  -v /path/to/movies:/movies \
  taylorbobaylor/movie-trailer-downloader

starts up fine but once I press submit I get the error System.UnauthorizedAccessException: Access to the path '/app/config.json' is denied. sane error I posted before.

taylorbobaylor commented 5 months ago

Did you do a docker pull of the latest image before?

VampiricAlien commented 5 months ago

The one updated today? yes.

f55737780db7 updated 3 hours ago

taylorbobaylor commented 5 months ago

Yeah.... I'm not sure... It's like the user you're running the container under doesn't haver permissions to create files or something.... Can you try running as root user or something to see if that does something?

I can't replicate the issue locally it seems.

VampiricAlien commented 5 months ago

Success! downloads trailer, however the quality isn't good. 720P but looks SD?

taylorbobaylor commented 5 months ago

Nice, glad you got it working!

It's downloading the highest quality one available on youtube that it's getting from TMDB API. https://github.com/taylorbobaylor/TrailerDownloader/blob/3b617849bb0a0e7bcbe9d83d2361dbfb0126c233/TrailerDownloader/SignalRHubs/MovieHub.cs#L189

Is it okay to close this issue now?

VampiricAlien commented 5 months ago

@taylorbobaylor Thank you very much for your help. I believe the error was that I had mapped it to a folder.

taylorbobaylor commented 5 months ago

Awesome, glad it's working for you!!! Look out for some updates in the future. Going to make a major refactor 😊