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

runtime error: index out of range #56

Open
Macrox14 opened this issue Apr 29, 2021 · 7 comments
Open

runtime error: index out of range #56

Macrox14 opened this issue Apr 29, 2021 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Macrox14
Copy link

Hi, I am getting this error only with Series with the new agent Plex TV Series

2021/04/29 02:40:05 Webhook call for df7b47b066922fabdacace9d920e50ee
2021/04/29 02:40:05 http: panic serving 192.168.1.4:57940: runtime error: index out of range
goroutine 110 [running]:
net/http.(*conn).serve.func1(0x28a66c0)
        /usr/local/go/src/net/http/server.go:1769 +0xf0
panic(0x3eb3b0, 0x7ab7d8)
        /usr/local/go/src/runtime/panic.go:522 +0x1a0
github.com/xanderstrike/goplaxt/lib/trakt.findEpisode(0x291c240, 0xa, 0x101, 0x1, 0x28b85c0, 0x3a, 0x291c108, 0x8, 0x291c2cc, 0x4, ...)
        /go/src/github.com/xanderstrike/goplaxt/lib/trakt/main.go:85 +0x594
github.com/xanderstrike/goplaxt/lib/trakt.HandleShow(0x291c240, 0xa, 0x101, 0x1, 0x28b85c0, 0x3a, 0x291c108, 0x8, 0x291c2cc, 0x4, ...)
        /go/src/github.com/xanderstrike/goplaxt/lib/trakt/main.go:59 +0x74
github.com/xanderstrike/goplaxt/lib/trakt.Handle(0x291c240, 0xa, 0x101, 0x1, 0x28b85c0, 0x3a, 0x291c108, 0x8, 0x291c2cc, 0x4, ...)
        /go/src/github.com/xanderstrike/goplaxt/lib/trakt/main.go:47 +0x118
main.api(0x4da560, 0x28801b0, 0x28aa380)
        /go/src/github.com/xanderstrike/goplaxt/main.go:104 +0x598
net/http.HandlerFunc.ServeHTTP(0x45bb98, 0x4da560, 0x28801b0, 0x28aa380)
        /usr/local/go/src/net/http/server.go:1995 +0x34
main.allowedHostsHandler.func1.1(0x4da560, 0x28801b0, 0x28aa380)
        /go/src/github.com/xanderstrike/goplaxt/main.go:135 +0x26c
net/http.HandlerFunc.ServeHTTP(0x2920220, 0x4da560, 0x28801b0, 0x28aa380)
        /usr/local/go/src/net/http/server.go:1995 +0x34
github.com/gorilla/handlers.ProxyHeaders.func1(0x4da560, 0x28801b0, 0x28aa380)
        /go/pkg/mod/github.com/gorilla/[email protected]/proxy_headers.go:59 +0xf0
net/http.HandlerFunc.ServeHTTP(0x2924030, 0x4da560, 0x28801b0, 0x28aa380)
        /usr/local/go/src/net/http/server.go:1995 +0x34
github.com/gorilla/mux.(*Router).ServeHTTP(0x28a67e0, 0x4da560, 0x28801b0, 0x28aa000)
        /go/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 +0xb0
net/http.serverHandler.ServeHTTP(0x28aa280, 0x4da560, 0x28801b0, 0x28aa000)
        /usr/local/go/src/net/http/server.go:2774 +0x88
net/http.(*conn).serve(0x28a66c0, 0x4dac20, 0x2920040)
        /usr/local/go/src/net/http/server.go:1878 +0x7e4
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2884 +0x298

I am using the last version of Plaxt

@nserrano10
Copy link

Same issue here.

2021/05/22 12:44:16 Webhook call for 6f8db6e59efa6c78ab3754ee11c0b7bd
2021/05/22 12:44:16 Finding episode with new Plex TV agent
2021/05/22 12:44:16 http: panic serving 172.17.0.1:45078: runtime error: index out of range
goroutine 50 [running]:
net/http.(*conn).serve.func1(0xc000142460)
/usr/local/go/src/net/http/server.go:1769 +0x139
panic(0x8606e0, 0xcc5cc0)
/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/xanderstrike/goplaxt/lib/trakt.findEpisode(0xc00048dcf0, 0xa, 0x101, 0x1, 0xc00038ee80, 0x3a, 0xc00048dd00, 0xa, 0xc00048dd30, 0
x4, ...)
/go/src/github.com/xanderstrike/goplaxt/lib/trakt/main.go:118 +0xcf1
github.com/xanderstrike/goplaxt/lib/trakt.HandleShow(0xc00048dcf0, 0xa, 0x101, 0x1, 0xc00038ee80, 0x3a, 0xc00048dd00, 0xa, 0xc00048dd30, 0x
4, ...)
/go/src/github.com/xanderstrike/goplaxt/lib/trakt/main.go:62 +0xde
github.com/xanderstrike/goplaxt/lib/trakt.Handle(0xc00048dcf0, 0xa, 0x101, 0x1, 0xc00038ee80, 0x3a, 0xc00048dd00, 0xa, 0xc00048dd30, 0x4, .
..)
/go/src/github.com/xanderstrike/goplaxt/lib/trakt/main.go:49 +0x14f
main.api(0x985ce0, 0xc0004660e0, 0xc000094c00)
/go/src/github.com/xanderstrike/goplaxt/main.go:104 +0x759
net/http.HandlerFunc.ServeHTTP(0x901b78, 0x985ce0, 0xc0004660e0, 0xc000094c00)
/usr/local/go/src/net/http/server.go:1995 +0x44
github.com/gorilla/handlers.ProxyHeaders.func1(0x985ce0, 0xc0004660e0, 0xc000094c00)
/go/pkg/mod/github.com/gorilla/[email protected]/proxy_headers.go:59 +0x10d
net/http.HandlerFunc.ServeHTTP(0xc0004844c0, 0x985ce0, 0xc0004660e0, 0xc000094c00)
/usr/local/go/src/net/http/server.go:1995 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0000960c0, 0x985ce0, 0xc0004660e0, 0xc000094900)
/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 +0xe3
net/http.serverHandler.ServeHTTP(0xc00006cc30, 0x985ce0, 0xc0004660e0, 0xc000094900)
/usr/local/go/src/net/http/server.go:2774 +0xa8
net/http.(*conn).serve(0xc000142460, 0x986860, 0xc0000566c0)
/usr/local/go/src/net/http/server.go:1878 +0x851
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2884 +0x2f4

@XanderStrike XanderStrike added bug Something isn't working help wanted Extra attention is needed labels May 24, 2021
@XanderStrike
Copy link
Owner

Looking at the logs on the hosted instance this seems related to the Plex TV Agent, I don't have bandwidth to dig into it right now, but it might be helpful if you could share what episode of what show is causing the error? Also does it consistently happen with one episode and not another?

@CorentinB no pressure at all but have you seen any of these errors since implementing support for the new agent?

@nserrano10
Copy link

Ran a test with the episodes i got that error from and now it worked. I had just recently upgraded to the new agent so maybe it was still refreshing all the metadata. I will keep an eye and report back if i see this issue again.

Another question: If i marked on plex an episode as watched, will it mark it on trakt?

@XanderStrike
Copy link
Owner

Interesting yeah it could be that it didn't have the IDs populated yet.

Unfortunately Plex doesn't send us anything when you check off an episode, so no Trakt won't find out about it. We just get play, pause, and stop events.

@nserrano10
Copy link

Ran some more tests and yesterday got the error with American Idol S19 E19 and Restaurant Impossible S19 E1

@geaston95
Copy link

Any updates on this issue? I'm also noticing the same error on certain episodes.

@ColinHebert
Copy link

ColinHebert commented Mar 3, 2023

FWIW, this happens when the search on trakt (using https://api.trakt.tv/search/%s/%s?type=episode) doesn't return any results. This can happen if the episode's TVDB ID isn't found on trakt.
Trakt uses TMDB as the source of truth, so if the episode in question in TMDB doesn't have a reference to the TVDB episode ID; it will fail:
Screen Shot 2023-03-04 at 09 16 41

This could be fixed with doing lookups with different sources when one fails (not just TVDB iD, but TMDB ID, etc.).
Preferably https://github.com/XanderStrike/goplaxt/blob/master/lib/trakt/main.go#L114-L116 would also check wether the reply is not empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants