Schaka / janitorr

Cleans your Radarr, Sonarr, Jellyseerr and Jellyfin before you run out of space
GNU General Public License v3.0
313 stars 7 forks source link

500 Internal Server Error - Unrecognized Guid Format #47

Closed kylehandy123 closed 3 months ago

kylehandy123 commented 3 months ago

Hi, I have Janitorr running via Unraid and it can access the media directory, as well as create the libraries in Emby for Movies & Tv deleting soon. The problem I am now running into is the title, receiving an 500 Internal Server Error - Unrecognized Guid Format. Here is the log:

. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _ | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v3.2.4)

2024-07-13T18:20:02.274-04:00 INFO 1 --- [ main] c.g.s.janitorr.JanitorrApplicationKt : Starting AOT-processed JanitorrApplicationKt using Java 21.0.3 with PID 1 (/workspace/com.github.schaka.janitorr.JanitorrApplicationKt started by cnb in /workspace) 2024-07-13T18:20:02.274-04:00 INFO 1 --- [ main] c.g.s.janitorr.JanitorrApplicationKt : No active profile set, falling back to 1 default profile: "default" 2024-07-13T18:20:02.322-04:00 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8978 (http) 2024-07-13T18:20:02.323-04:00 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2024-07-13T18:20:02.323-04:00 INFO 1 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.19] 2024-07-13T18:20:02.336-04:00 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2024-07-13T18:20:02.336-04:00 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 62 ms 2024-07-13T18:20:02.528-04:00 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8978 (http) with context path '' 2024-07-13T18:20:02.529-04:00 INFO 1 --- [ main] c.g.s.janitorr.JanitorrApplicationKt : Started JanitorrApplicationKt in 0.276 seconds (process running for 0.286) 2024-07-13T18:20:14.542-04:00 INFO 1 --- [ scheduling-1] c.g.s.j.mediaserver.MediaServerService : Can't find original season folder - no links to create /media/media/tv/Prison Break/Season 4 2024-07-13T18:20:14.543-04:00 INFO 1 --- [ scheduling-1] c.g.s.j.mediaserver.MediaServerService : Can't find original season folder - no links to create /media/media/tv/Prison Break/Season 5 2024-07-13T18:20:16.602-04:00 INFO 1 --- [ scheduling-1] c.g.s.j.s.sonarr.SonarrRestService : Dry run - not deleting any TV shows without files or monitoring 2024-07-13T18:20:25.009-04:00 INFO 1 --- [ scheduling-1] c.g.s.j.s.sonarr.SonarrRestService : Dry run - not deleting any TV shows without files or monitoring 2024-07-13T18:20:25.358-04:00 ERROR 1 --- [ scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task

feign.FeignException$InternalServerError: [500 Internal Server Error] during [POST] to [http://192.168.1.201:8096/emby/Library/VirtualFolders/Paths?refreshLibrary=true] [MediaServerClient#addPathToLibrary(AddPathRequest,boolean)]: [Unrecognized Guid format.] at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:103) ~[na:na] at feign.InvocationContext.decodeError(InvocationContext.java:126) ~[na:na] at feign.InvocationContext.proceed(InvocationContext.java:72) ~[na:na] at feign.ResponseHandler.handleResponse(ResponseHandler.java:63) ~[na:na] at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:114) ~[na:na] at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:70) ~[na:na] at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:99) ~[na:na] at jdk.proxy4/jdk.proxy4.$Proxy47.addPathToLibrary(Unknown Source) ~[na:na] at com.github.schaka.janitorr.mediaserver.MediaServerClient$DefaultImpls.addPathToLibrary$default(MediaServerClient.kt:25) ~[na:na] at com.github.schaka.janitorr.mediaserver.AbstractMediaServerRestService.updateLeavingSoon(AbstractMediaServerRestService.kt:217) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at com.github.schaka.janitorr.cleanup.AbstractCleanupSchedule.deleteTvShows(AbstractCleanupSchedule.kt:103) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at com.github.schaka.janitorr.cleanup.AbstractCleanupSchedule$scheduleDelete$2.invoke(AbstractCleanupSchedule.kt:49) ~[na:na] at com.github.schaka.janitorr.cleanup.AbstractCleanupSchedule$scheduleDelete$2.invoke(AbstractCleanupSchedule.kt:49) ~[na:na] at com.github.schaka.janitorr.cleanup.AbstractCleanupSchedule.cleanupMediaType(AbstractCleanupSchedule.kt:76) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at com.github.schaka.janitorr.cleanup.AbstractCleanupSchedule.scheduleDelete(AbstractCleanupSchedule.kt:49) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at com.github.schaka.janitorr.cleanup.TagBasedCleanupSchedule.runSchedule(TagBasedCleanupSchedule.kt:52) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at java.base@21.0.3/java.lang.reflect.Method.invoke(Method.java:580) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:351) ~[na:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765) ~[na:na] at org.springframework.cache.interceptor.CacheInterceptor.lambda$invoke$0(CacheInterceptor.java:64) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:416) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.cache.interceptor.CacheAspectSupport.evaluate(CacheAspectSupport.java:545) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:433) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:395) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:74) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765) ~[na:na] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:717) ~[na:na] at com.github.schaka.janitorr.cleanup.TagBasedCleanupSchedule$$SpringCGLIB$$0.runSchedule() ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at java.base@21.0.3/java.lang.reflect.Method.invoke(Method.java:580) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130) ~[na:na] at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124) ~[na:na] at io.micrometer.observation.Observation.observe(Observation.java:499) ~[com.github.schaka.janitorr.JanitorrApplicationKt:1.12.4] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124) ~[na:na] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[com.github.schaka.janitorr.JanitorrApplicationKt:6.1.5] at java.base@21.0.3/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[na:na] at java.base@21.0.3/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at java.base@21.0.3/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na] at java.base@21.0.3/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at java.base@21.0.3/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na] at java.base@21.0.3/java.lang.Thread.runWith(Thread.java:1596) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at java.base@21.0.3/java.lang.VirtualThread.run(VirtualThread.java:309) ~[com.github.schaka.janitorr.JanitorrApplicationKt:na] at java.base@21.0.3/java.lang.VirtualThread$VThreadContinuation$1.run(VirtualThread.java:190) ~[na:na]`

Included here is my application.yml file, the directories names are edited to match my Emby installation as well as my folder structure, which seems to be working fine given the creation of the libraries in Emby, as well as the log above showing that it read a TV series "Prison Break".

`server: port: 8978

File system access (same mapping as Sonarr, Radarr and Jellyfin) is required to delete TV shows by season and create "Leaving Soon" collections in Jellyfin

Currently, Jellyfin does not support an easy way to add only a few seasons or movies to a collection, we need access to temporary symlinks

Additionally, checks to prevent deletion on currently still seeding media currently require file system access as well

file-system: access: true validate-seeding: true # validates seeding by checking if the original file exists and skips deletion - turning this off will send a delete to the *arrs even if a torrent may still be active leaving-soon-dir: "/media/media/leaving-soon" # A directory this container can write to and Jellyfin can find under the same path - this will contain new folders with symlinks to files for Jellyfin's "Leaving Soon" collections from-scratch: true # Clean up entire "Leaving Soon" directory and rebuild from scratch - this can help with clearing orphaned data - turning this off can save resources (less writes to drive) free-space-check-dir: "/media" # This is the default directory Janitorr uses to check how much space is left on your drives. By default, it checks the entire root - you may point it at a specific folder

application: dry-run: true whole-tv-show: false # activating this will treat as a whole show as recently download/watched from a single episode, rather than that episode's season - shows will be deleted as a whole whole-show-seeding-check: false # Turning this off, disables the seeding check entirely if whole-tv-show is enabled. Activating this check will keep a whole TV show if any season is still seeding (requires file access). leaving-soon: 14d # 14 days before a movie is deleted, it gets added to a "Leaving Soon" type collection (i.e. movies that are 76 to 89 days old) exclusion-tag: "janitorr_keep" # Set this tag to your movies or TV shows in the *arrs to exclude media from being cleaned up

media-deletion: enabled: true movie-expiration:

Percentage of free disk space to expiration time - if the highest given number is not reached, nothing will be deleted

  # If filesystem access is not given, disk percentage can't be determined. As a result, Janitorr will always choose the largest expiration time.
  20: 15d # 15 days
  30: 30d # 1 month - if a movie's files on your system are older than this, they will be deleted
  40: 60d # 2 months
  50: 90d # 3 months
season-expiration:
  20: 15d # 15 days
  30: 20d # 20 days - if a season's files on your system are older than this, they will be deleted
  40: 60d # 2 months
  50: 120d # 4 months

tag-based-deletion: enabled: true minimum-free-disk-percent: 50 schedules:

clients: sonarr: enabled: true url: "http://192.168.1.201:8989" api-key: "" delete-empty-shows: true # If a show that was "touched" by Janitorr contains no files and has no monitored seasons at all, it will get deleted as part of orphan cleanup radarr: enabled: true url: "http://192.168.1.201:7878" api-key: ""

You can only choose one out of Jellyfin or Emby.

User login is only needed if deletion is enabled.

jellyfin: enabled: false url: "http://localhost:8096" api-key: "*****" username: Janitorr password: janitorr delete: false # Jellyfin setup is required for JellyStat. However, if you don't want Janitorr to send delete requests to the Jellyfin API, disable it here

You can only choose one out of Jellyfin or Emby. Emby support is secondary.

User login is only needed if deletion is enabled.

emby: enabled: true url: "http://192.168.1.201:8096" api-key: "" username: password: delete: true # Emby setup is required for JellyStat. However, if you don't want Janitorr to send delete requests to the Emby API, disable it here jellyseerr: enabled: true url: "http://192.168.1.201:5055" api-key: "" match-server: false # Enable if you have several Radarr/Sonarr instances set up in Jellyseerr. Janitorr will match them by the host+port supplied in their respective config settings. jellystat: enabled: true whole-tv-show: false # Enabling this will make Jellystat consider TV shows as a whole if any episode of any season has been watched url: "http://192.168.1.201:3007" api-key: "*****"`

Schaka commented 3 months ago

Can you please fix the formatting? For the log, you can upload it as a file if you want.

I suspect Emby changed how it accepts requests and doesn't allow for null anymore. I'll have to investigate. But I need better, readable formatting, please

Schaka commented 3 months ago

You can try the latest develop image and let me know if it's resolved. My testing capabilities for Emby are very limited.

kylehandy123 commented 3 months ago

Hey there! Apologies on the delay, here are my log and application files. I will try the develop branch in the meantime and let you know what I find from it. I don't use Github all to often so I apologize if these files aren't of use or the correct format, but when opened in VS code they appear to be formatted properly. Thank you again! application.txt Log.txt

kylehandy123 commented 3 months ago

Attempted to use the :develop image, the following log is my output in console. I'm not sure if this is a problem on my end, or in the develop image. Log.txt

hacshacdgacs commented 3 months ago

Just adding in my two cents on this. With the latest develop image and with an emby server my application is running fine. I'll attach a copy of my config as well. application - copy.txt

Schaka commented 3 months ago

Closing this then. The fix will be in the next official release version (probably 1.5). Until then, please use the develop image.

@kylehandy123 you're missing required fields in your application.yml

It seems either your Emby version or your Janitorr were are/were outdated and/or mismatched. In my limited testing before pushing to develop, Emby seemed to at least accept requests properly and hachacdgacs testing seems to confirm this.