Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

login failed with go runtime error #27

Closed
hekmon opened this issue May 1, 2022 · 3 comments
Closed

login failed with go runtime error #27

hekmon opened this issue May 1, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@hekmon
Copy link
Contributor

hekmon commented May 1, 2022

[debug] Executing `login` command with 2 arg(s)
[debug] Logging in via credentials
[err] interface conversion: interface {} is nil, not map[string]interface {}: goroutine 1 [running]:
runtime/debug.Stack()
	/opt/homebrew/Cellar/go/1.18.1/libexec/src/runtime/debug/stack.go:24 +0x68
github.com/ByteDream/crunchyroll-go/cmd/crunchyroll-go/cmd.Execute.func1()

By poking around in the code, I found out that login queries where denied (most likely by cloudflare) with 429 Too Many Requests and returned body was empty, preventing the casting of non present values.

I will send you a PR handling such cases.

@bytedream
Copy link
Member

Thanks for investigating and hunting down the error!
It was already reported in #14 before but I closed it since the author didn't respond to my further questions and I could not reproduce it, so I thought the error were only temporary / with the last comment in mind, a VPN or proxy error.

bytedream added a commit that referenced this issue May 1, 2022
Silent login fail error handling (#27)
@bytedream
Copy link
Member

Did you use your "normal" internet connection or some kind of vpn or proxy?

@bytedream bytedream added bug Something isn't working cli labels May 1, 2022
@hekmon
Copy link
Contributor Author

hekmon commented May 1, 2022

Yes, 100% vanilla direct connection. Actually I think the rate limiting occurred before that:

  • the last ep of season download batch failed: the error told me that I was not logged in
  • tried to login: failed with runtime error

You know the rest of the story :) I suspect the rate limiting was the reason of the ep failure but maybe the downloader code part interpreted the fails as a not logged in situation... At least with the PR, user will try to login again and he will have the actual HTTP code (for logging in). I think the same enhancement of error handling could be done on the downloader part too. At least now, no more runtime panic !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants