godeezer / lib

Deezer API implementation in Go
ISC License
5 stars 3 forks source link

Transport received RST_STREAM stream=37 len=4 ErrCode=PROTOCOL_ERROR when trying to download random songs #10

Closed toniz4 closed 3 years ago

toniz4 commented 3 years ago

When trying to download many songs I get this error. It ocours on random songs, and sometimes doesn't happens. And when it happens, It doesn't trows an error, so it locks the program. This bug report might be relevant https://github.com/golang/go/issues/29125.

here is the relevant part of the log that I get when running my program with GODEBUG=http2debug=1:

2021/06/08 20:54:42 http2: Transport received DATA stream=59 len=16384 data="\x9a\xafp\x02\xa3\xaa\xc0U\a\x11,\x04\xbd\x9c\xb9\x10\x9d\xd2%\xc2\xcf2\xe3\x176\x8c\xbb\xdfֺ\u008a\xa4\xe6CO\x8e!\xb1\xe5\xdf\xe7\xc0O\xaft\xaa\f\xe2YY\xf3\xc4z\xf0\x96[\xbfO\xb9v\xdb\\\x92\x8a\x1a-\vT\xa5\x8am䞤\xdd\x02\x9d\xe2\xaa\x1aݑ\xf3L\xeb2\xb2S\xe7Z\xe5}'Y*n\x9cu\x14_\x9b\x84AVLE\x18\xabm\x97\xb5\xbfȢ8*B\xd7r(\x8f\xaa\x1d\xcf\xd7\tH\xb9h\xb3\xb7qcf\xbf#\x06_;\x92\xaa\x14[\x1c\xf1\xa3f\xdb\r\x1eh\x15g-`Ѫ\xcaS\x18\xa9\x16\xfa\tf\xa2\xfer\xa2\xc4\xfdi\n\x1f(N\xde\xd7C\xb0\xd2!fSZx\x8eV\xc1\x1e9\xa6l\x81b\f\v\n(\v(-Q\x1f\xef\xb5\xe2\x81=\xfe5\xf1h\xed\"+;\\T\x97\x13\x91rB\x1e\xa8>\xb4\xae=D\xa7\xe1\x19\u007f\xbe\b\xee\x96x\x89\xb75\xdfT\xc9[\x8c\xb9\xf3\x8b\x94Q+\xc5" (16128 bytes omitted)
2021/06/08 20:54:42 http2: Transport received DATA stream=59 len=7 data="#\xceo\xf8\x94\xb0\x16"
2021/06/08 20:54:46 http2: Transport received RST_STREAM stream=29 len=4 ErrCode=PROTOCOL_ERROR
2021/06/08 20:54:59 http2: Transport readFrame error on conn 0xc000082600: (*errors.errorString) EOF
2021/06/08 20:55:02 http2: Transport received RST_STREAM stream=33 len=4 ErrCode=PROTOCOL_ERROR
2021/06/08 20:55:06 http2: Transport received RST_STREAM stream=29 len=4 ErrCode=PROTOCOL_ERROR

Sometimes it takes a while to happen, some times not. The full log is almost 300M, if you want I can upload it somewere, but i didin't saw anything important there.

samhza commented 3 years ago

Can you send in the part of your code that downloads the songs?

toniz4 commented 3 years ago

https://gitlab.com/heyitscassio/deezgo/-/blob/master/main.go#L233 it's in this function, I tried using song.Write too, same effect

samhza commented 3 years ago

I've ran env GODEBUG=http2debug=1 go run . get -f flac https://www.deezer.com/us/track/793554582 with deezgo a couple times in an attempt to reproduce the error and I have not yet been able to. I'll keep trying to reproduce the error and I'll let you know if I'm able to.

toniz4 commented 3 years ago

try to download a whole artist discography, I've found problems doing that. When I have time I will try to come up with a program that shows this problem. For now try: ./deezgo get -f flac -p /tmp/music 'https://www.deezer.com/us/artist/399'

samhza commented 3 years ago

I believe the error should be now fixed in 142b8240e3ef8f55aa94a6e39d00a2b54981c2a7. After making this change the error hasn't occurred anymore. Upgrade to v1.2.1 and reopen this issue if the error occurs again.

toniz4 commented 3 years ago

Thanks! Now it woks as intended.