lightglitch / seekerr

Tool to add new movies to Radarr based on RSS, IMDB and Trakt lists filtering by ratings.
MIT License
60 stars 2 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #14

Closed Aerya closed 2 years ago

Aerya commented 3 years ago

Hi,

I use your Docker:

docker run -d \
--name=seekerr \
--restart always \
-v /home/aerya/docker/seekerr:/config \
--label=com.centurylinklabs.watchtower.enable=true \
lightglitch/seekerr:latest

I set it up on yesterday, it never ran.

12:00AM INF start
12:00AM INF schedule 0=now 1=2021-08-18T00:00:03.529017168Z 2=entry 3=1 4=next 5=2021-08-18T02:00:00Z
2:00AM INF wake 0=now 1=2021-08-18T02:00:00.089352495Z
2:00AM INF run 0=now 1=2021-08-18T02:00:00.089352495Z 2=entry 3=1 4=next 5=2021-08-18T04:00:00Z
2:00AM INF Accessing radarr with version 4.0.0.5219. Component=Radarr
2:00AM DBG Found Quality Profile ID for 'HD': 4 Component=Radarr
2:00AM INF Init radarr cache Component=Importer Count=149
2:00AM INF Excluded movies in radarr Component=Importer Count=533

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fd11a]

goroutine 18 [running]:
github.com/spf13/viper.(*Viper).find(0x0, 0xa9e1be, 0x6, 0x1, 0x1f4, 0x7f265df3ef70)
    /go/pkg/mod/github.com/spf13/viper@v1.8.1/viper.go:1125 +0x3a
github.com/spf13/viper.(*Viper).Get(0x0, 0xa9e1be, 0x6, 0xc000078f60, 0xc0001c4800)
    /go/pkg/mod/github.com/spf13/viper@v1.8.1/viper.go:798 +0x85
github.com/spf13/viper.(*Viper).GetStringMap(0x0, 0xa9e1be, 0x6, 0xc000078f60)
    /go/pkg/mod/github.com/spf13/viper@v1.8.1/viper.go:956 +0x3f
github.com/lightglitch/seekerr/importer.(*Importer).getListsConfigurations(0xc0002340b0, 0xc00000e768)
    /go/src/github.com/lightglitch/seekerr/importer/importer.go:93 +0x99
github.com/lightglitch/seekerr/importer.(*Importer).ProcessLists(0xc0002340b0)
    /go/src/github.com/lightglitch/seekerr/importer/importer.go:258 +0x45
github.com/lightglitch/seekerr/cmd.glob..func4(0xf41120, 0x1110c78, 0x0, 0x0)
    /go/src/github.com/lightglitch/seekerr/cmd/import.go:90 +0x505
github.com/lightglitch/seekerr/cmd.glob..func2.1()
    /go/src/github.com/lightglitch/seekerr/cmd/cron.go:55 +0x56
github.com/robfig/cron/v3.FuncJob.Run(0xc0001d64b0)
    /go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:136 +0x25
github.com/robfig/cron/v3.(*Cron).startJob.func1(0xc0001b2dc0, 0xb87cc0, 0xc0001d64b0)
    /go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:312 +0x65
created by github.com/robfig/cron/v3.(*Cron).startJob
    /go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:310 +0x73
2:00AM INF start
2:00AM INF schedule 0=now 1=2021-08-18T02:00:03.563925517Z 2=entry 3=1 4=next 5=2021-08-18T04:00:00Z
lightglitch commented 3 years ago

Forget my last comment, try to use the stable version instead of the latest please and see if it happens?

If it happens with the stable version I need to see your config file (remove secrets).

lightglitch commented 3 years ago

I have made an update with a fix for this issue but without knowing your config file I can't be sure.

Aerya commented 3 years ago

Hi,

Same issue with the (up to date) latest tag.

/ # seekerr import
5:48AM INF Accessing radarr with version 4.0.0.5219. Component=Radarr
5:48AM DBG Found Quality Profile ID for 'HD': 4 Component=Radarr
5:48AM INF Init radarr cache Component=Importer Count=211
5:48AM INF Excluded movies in radarr Component=Importer Count=533
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fcfda]

goroutine 1 [running]:
github.com/spf13/viper.(*Viper).find(0x0, 0xaa1297, 0x6, 0x0, 0xa6f420, 0xc000302360)
        /go/pkg/mod/github.com/spf13/viper@v1.8.1/viper.go:1125 +0x3a
github.com/spf13/viper.(*Viper).IsSet(0x0, 0xaa1297, 0x6, 0xb)
        /go/pkg/mod/github.com/spf13/viper@v1.8.1/viper.go:1296 +0x5c
github.com/lightglitch/seekerr/importer.(*Importer).getListsConfigurations(0xc00032c000, 0xc0000b0750)
        /go/src/github.com/lightglitch/seekerr/importer/importer.go:93 +0x6a
github.com/lightglitch/seekerr/importer.(*Importer).ProcessLists(0xc00032c000)
        /go/src/github.com/lightglitch/seekerr/importer/importer.go:267 +0x45
github.com/lightglitch/seekerr/cmd.glob..func4(0xf44ea0, 0x1114cb8, 0x0, 0x0)
        /go/src/github.com/lightglitch/seekerr/cmd/import.go:90 +0x505
github.com/spf13/cobra.(*Command).execute(0xf44ea0, 0x1114cb8, 0x0, 0x0, 0xf44ea0, 0x1114cb8)
        /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xf453a0, 0xc000000180, 0x200000003, 0xc000000180)
        /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
github.com/lightglitch/seekerr/cmd.Execute()
        /go/src/github.com/lightglitch/seekerr/cmd/root.go:50 +0x31
main.main()
        /go/src/github.com/lightglitch/seekerr/main.go:27 +0x25

Here's my config file:

logger:
  level: debug
  timeFormat: ""
  color: true
  human: true
  file: "var/log/seekerr.%Y%m%d.log"

cron: "0 */2 * * *"

services:
  resty:
    debug: false
    timeout: 20s
    retry: 0
    retryWaitTime: 1s
    retryMaxWaitTime: 10s

  trakt:
    apiKey: "xxx"

  omdb:
    apiKey: "xxx"

  guessIt:
    type: "command" # webservice
    path: "guessit"

  radarr:
    url: "xxx/"
    apiKey: "xxx"
    rootFolder: "/downloads/PRE/Films/"
    quality: "HD"
    minimumAvailability: "predb"
    monitored: true
    searchForMovie: true

importer:
  revision: false
  filter:
    limit: 50
    exclude:
      - 'CountRatings < 2 || Runtime < 20 || ImdbVotes < 1000 || Year > Now().Year()'
      - 'Ratings.Imdb != 0 && Ratings.Imdb < 7'
      - 'Ratings.Metacritic != 0 && Ratings.Metacritic < 70'
      - 'Ratings.RottenTomatoes != 0 && Ratings.RottenTomatoes < 75'
    revision:
      - 'CountRatings < 2 || Runtime < 20 || ImdbVotes < 1000 || Year > Now().Year()'
      - 'Ratings.Imdb != 0 && Ratings.Imdb < 6.5'
      - 'Ratings.Metacritic != 0 && Ratings.Metacritic < 60'
      - 'Ratings.RottenTomatoes != 0 && Ratings.RottenTomatoes < 65'

  lists:
    imdb:
      type: "imdb"
      url: "https://www.imdb.com/list/ls016522954/?sort=list_order,asc&st_dt=&mode=detail&page=1&title_type=movie&user_rating=6.0%2C&ref_=ttls_ref_rt_usr"

    traktTrending:
      type: "trakt"
      url: "trakt://movies/trending"

    traktPublic:
      type: "trakt"
      url: "https://trakt.tv/users/movistapp/lists/now-playing?sort=rank,asc"
lightglitch commented 3 years ago

I will test it as soon as possible.

lightglitch commented 3 years ago

I'm struggling to replicate your issue. I just did a test using your configuration file in the latest docker and when execute "seekerr import" inside the docker works just fine. Does this happens using the release version from here https://github.com/lightglitch/seekerr/releases, without using the docker?

Aerya commented 3 years ago

Yeap it works out of the box (Linux build).

5:39AM INF Finish processing lists. Added=6 Approved=6 Component=Importer

lightglitch commented 3 years ago

How about the docker:stable version? Can you try it?

Aerya commented 3 years ago

Same bug:

docker run -d \
> --name=seekerr \
> --restart always \
> -v /home/aerya/docker/seekerr:/config \
> --label=com.centurylinklabs.watchtower.enable=true \
> lightglitch/seekerr:stable
Unable to find image 'lightglitch/seekerr:stable' locally
stable: Pulling from lightglitch/seekerr
540db60ca938: Already exists 
a7ad1a75a999: Pull complete 
37ce6546d5dd: Pull complete 
ec9e91bed5a2: Pull complete 
ecb9463b81f8: Pull complete 
28e1926426f0: Pull complete 
92855caaeac2: Pull complete 
66dd1983c583: Pull complete 
cf8def98b1cb: Pull complete 
8c9392c296ae: Pull complete 
Digest: sha256:ad17ad68b18424556db39a61e2a1bf5525647837ee6cc00dcfa99be3f778aef0
Status: Downloaded newer image for lightglitch/seekerr:stable
f8cd57589dd05a1ac991abef34339fc9c807ddf065b27ef5d06c015229603ea0
/ # seekerr import
1:48PM INF Accessing radarr with version 4.0.0.5219. Component=Radarr
1:48PM DBG Found Quality Profile ID for 'HD': 4 Component=Radarr
1:48PM INF Init radarr cache Component=Importer Count=180
1:48PM INF Excluded movies in radarr Component=Importer Count=575
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fc877]

goroutine 1 [running]:
github.com/spf13/viper.(*Viper).find(0x0, 0xa9e5f4, 0x6, 0x1, 0x1f4, 0x7f18755128f0)
        /go/pkg/mod/github.com/spf13/viper@v1.7.1/viper.go:1027 +0x37
github.com/spf13/viper.(*Viper).Get(0x0, 0xa9e5f4, 0x6, 0xc0000921e0, 0xc0000ac200)
        /go/pkg/mod/github.com/spf13/viper@v1.7.1/viper.go:728 +0x85
github.com/spf13/viper.(*Viper).GetStringMap(0x0, 0xa9e5f4, 0x6, 0xc0000921e0)
        /go/pkg/mod/github.com/spf13/viper@v1.7.1/viper.go:871 +0x3f
github.com/lightglitch/seekerr/importer.(*Importer).getListsConfigurations(0xc0003ac000, 0xc000128750)
        /go/src/github.com/lightglitch/seekerr/importer/importer.go:93 +0x99
github.com/lightglitch/seekerr/importer.(*Importer).ProcessLists(0xc0003ac000)
        /go/src/github.com/lightglitch/seekerr/importer/importer.go:258 +0x45
github.com/lightglitch/seekerr/cmd.glob..func4(0xf3ef20, 0x110eee8, 0x0, 0x0)
        /go/src/github.com/lightglitch/seekerr/cmd/import.go:90 +0x505
github.com/spf13/cobra.(*Command).execute(0xf3ef20, 0x110eee8, 0x0, 0x0, 0xf3ef20, 0x110eee8)
        /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xf3f420, 0xc000000180, 0x200000003, 0xc000000180)
        /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
github.com/lightglitch/seekerr/cmd.Execute()
        /go/src/github.com/lightglitch/seekerr/cmd/root.go:50 +0x31
main.main()
        /go/src/github.com/lightglitch/seekerr/main.go:27 +0x25
/ # 
lightglitch commented 3 years ago

I don't understand what's happening in your case. I just tested the dockers, like you did, on docker desktop for windows and in my unraid server with your configuration file and I'm unable to replicate your issue.

Can you provide the operating system version and platform you are running?

Aerya commented 3 years ago

Dedicated server: Linux Sweetbox 5.8.0-63-generic #71-Ubuntu SMP Tue Jul 13 15:59:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux & Docker version 20.10.7, build f0df350

I don't understand neither cause this docker shouldn't be related to the main OS. Thank you for your time (and work for Seekerr). Don't lost your time with this issue, I use it directly without Docker atm and it works fine.

lightglitch commented 3 years ago

I also don't understand what's happening. If you have time build the docker image yourself and test it to see if still happens.

The solution for now is to use the release executable.

lightglitch commented 3 years ago

One last test, check the latest docker build. The errors of parsing the configuration file were not shown, now we should see the exact problem.

Aerya commented 3 years ago

The "new" Docker:latest don't start, it's a boot loop.

docker logs seekerr
panic: nil

goroutine 1 [running]:
github.com/lightglitch/seekerr/cmd.initConfig()
    /go/src/github.com/lightglitch/seekerr/cmd/root.go:92 +0x3b7
github.com/lightglitch/seekerr/cmd.glob..func1(0xf45120, 0x1114cb8, 0x0, 0x0)
    /go/src/github.com/lightglitch/seekerr/cmd/cron.go:40 +0x25
github.com/spf13/cobra.(*Command).execute(0xf45120, 0x1114cb8, 0x0, 0x0, 0xf45120, 0x1114cb8)
    /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:849 +0x4ef
github.com/spf13/cobra.(*Command).ExecuteC(0xf453a0, 0xc000000180, 0x200000003, 0xc000000180)
    /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
    /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
github.com/lightglitch/seekerr/cmd.Execute()
    /go/src/github.com/lightglitch/seekerr/cmd/root.go:50 +0x31
main.main()
    /go/src/github.com/lightglitch/seekerr/main.go:27 +0x25
panic: nil
lightglitch commented 3 years ago

I reverted the change because I made a mistake. But from those logs looks like you don't have any error parsing the file, I'm out of ideas.

Aerya commented 3 years ago

I don't have time atm to build my own Docker. Don't worry, your tool is a cool one and it works perfectly using the provided .deb :) Thanks again for your time!

Dracon09 commented 3 years ago

Hi,

I'm getting the same error;

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x8ba42f]

Unraid 6.9.2 Docker lightglitch/seekerr:latest

seekerr.yaml

:: --------------------------------------------------------------------------------------------

logger: level: trace # panic,fatal,error,warn,info,debug,trace timeFormat: "" # golang time format color: true # active color on console human: true # store file log as human readable file: "var/log/seekerr.%Y%m%d.log" # %Y%m%d is used for rotation. leave empty to disable file log

cron: " /2 *"

services: resty: debug: false timeout: 20s #golang duration retry: 0 # zero for no retries retryWaitTime: 1s retryMaxWaitTime: 10s

trakt: apiKey: "xxx"

omdb: apiKey: "xxx"

guessIt: type: "command" # webservice path: "guessit"

radarr: url: "http://192.168.0.36:7879/" apiKey: "xxx" rootFolder: "/media/Movies/" quality: "Bluray" minimumAvailability: "inCinemas" monitored: true searchForMovie: false

importer: revision: false filter: limit: 25 # limit the movies to process on each list

lists: rarbg: type: "rss" # rss | trakt | imdb url: "https://rarbgprx.org/rssdd_magnet.php?category=54" guessIt: true

:: ----------------------------------------------------------------------------------------------------------

Console command

/ # seekerr import Using config file: /config/seekerr.yaml 8:17PM INF Accessing radarr with version 4.0.0.5226. Component=Radarr panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x8ba42f]

goroutine 1 [running]: github.com/lightglitch/seekerr/importer.(Importer).initCache(0xc0000b3080) /go/src/github.com/lightglitch/seekerr/importer/importer.go:76 +0xaf github.com/lightglitch/seekerr/importer.NewImporter(0xc000166d80, 0xf66160, 0xc00013cb60, 0xc0001525a0, 0xc0000104b0, 0xc000154e00, 0x0) /go/src/github.com/lightglitch/seekerr/importer/importer.go:55 +0x39b github.com/lightglitch/seekerr/cmd.glob..func4(0xf44ea0, 0x1114cb8, 0x0, 0x0) /go/src/github.com/lightglitch/seekerr/cmd/import.go:85 +0x4b2 github.com/spf13/cobra.(Command).execute(0xf44ea0, 0x1114cb8, 0x0, 0x0, 0xf44ea0, 0x1114cb8) /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2 github.com/spf13/cobra.(Command).ExecuteC(0xf453a0, 0xc000000180, 0x200000003, 0xc000000180) /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375 github.com/spf13/cobra.(Command).Execute(...) /go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902 github.com/lightglitch/seekerr/cmd.Execute() /go/src/github.com/lightglitch/seekerr/cmd/root.go:50 +0x31 main.main() /go/src/github.com/lightglitch/seekerr/main.go:27 +0x25 / #

Dracon09 commented 3 years ago

Any chance you have something extra turned on in the "Nerd Pack" plugin for this to work?

Dracon09 commented 3 years ago

Getting same error on a Windows 10 box;

seekerr_1.0.2_Windows-64bit

C:\Users\xxxxxx\Downloads\seekerr_1.0.2_Windows-64bit>seekerr import Using config file: C:\Users\xxxxxxx\Downloads\seekerr_1.0.2_Windows-64bit\config\seekerr.yaml ←[90m8:47PM←[0m ←[32mINF←[0m Accessing radarr with version 4.0.0.5226. ←[36mComponent=←[0mRadarr panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x8 pc=0x6a48d9]

goroutine 1 [running]: github.com/lightglitch/seekerr/importer.(Importer).initCache(0xc00013ae70) /home/runner/work/seekerr/seekerr/importer/importer.go:76 +0xb9 github.com/lightglitch/seekerr/importer.NewImporter(0xc000109200, 0xd5dd40, 0xc000117a00, 0xc0000581b0, 0xc000104438, 0xc0001f5b90, 0x0) /home/runner/work/seekerr/seekerr/importer/importer.go:55 +0x3bb github.com/lightglitch/seekerr/cmd.glob..func4(0xd3ca80, 0xf22138, 0x0, 0x0) /home/runner/work/seekerr/seekerr/cmd/import.go:85 +0x4b8 github.com/spf13/cobra.(Command).execute(0xd3ca80, 0xf22138, 0x0, 0x0, 0xd3ca80, 0xf22138) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2 github.com/spf13/cobra.(Command).ExecuteC(0xd3cf80, 0xd5e5e0, 0x0, 0xc000043f78) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375 github.com/spf13/cobra.(Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902 github.com/lightglitch/seekerr/cmd.Execute() /home/runner/work/seekerr/seekerr/cmd/root.go:50 +0x38 main.main() /home/runner/work/seekerr/seekerr/main.go:27 +0x27

lightglitch commented 3 years ago

@Dracon09 you issue is a little different, it has to do with radarr error handling. Test the latest version please.

Dracon09 commented 3 years ago

my docker on UnRaid was with lastest

lightglitch/seekerr:latest

lightglitch commented 3 years ago

@Dracon09 I have made a new version with a fix since then.

Dracon09 commented 3 years ago

Thanks, new build is working;

/ # seekerr version seekerr v1.0.3 linux/amd64 BuildDate: unknown/ #

lightglitch commented 2 years ago

@Aerya Closing this, when you can provide some more feedback open the issue again.

hdchieh commented 9 months ago

@Aerya Closing this, when you can provide some more feedback open the issue again.

It happens when processing movies like this.

hdchieh commented 9 months ago

@Aerya Closing this, when you can provide some more feedback open the issue again.

It happens when processing movies like this.

https://www.omdbapi.com/?i=tt2891972&apikey

{"Title":"Homo faber","Year":"2013","Rated":"N/A","Released":"03 May 2013","Runtime":"N/A","Genre":"Drama","Director":"Raffaele Totaro","Writer":"Raffaele Totaro","Actors":"Raffaele Totaro, Henry Bartolini","Plot":"N/A","Language":"Italian","Country":"Italy","Awards":"N/A","Poster":"https://m.media-amazon.com/images/M/MV5BNDczMjY3MmYtYmI5MS00M2Q1LWExODktYTIyNjdmYjg4MzAwL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyMTQ3Njg3MQ@@._V1_SX300.jpg","Ratings":[],"Metascore":"N/A","imdbRating":"N/A","imdbVotes":"N/A","imdbID":"tt2891972","Type":"movie","DVD":"N/A","BoxOffice":"N/A","Production":"N/A","Website":"N/A","Response":"True"}