lflare / mdathome-golang

An unofficial rewrite of the official MangaDex@Home client, with focus on performance and reliability!
GNU Affero General Public License v3.0
27 stars 8 forks source link

Client crash on a fail to ping the control server. #1

Closed Cybernatus closed 4 years ago

Cybernatus commented 4 years ago

Hello there,

If you are still working on the client, maybe you'll be interested to know this issue regarding the control server not responding after a ping attempt :

2020-06-28T22:22:26+02:00 Failed to ping control server: Post "https://api.mangadex.network/ping": read tcp 78.46.78.83:44196->172.64.207.34:443: read: connection reset by peer
panic: Failed to ping control server: Post "https://api.mangadex.network/ping": read tcp 78.46.78.83:44196->172.64.207.34:443: read: connection reset by peer

goroutine 57 [running]:
log.Panicf(0x78055e, 0x21, 0xc000963ef8, 0x1, 0x1)
    /usr/local/go/src/log/log.go:358 +0xc0
main.pingServer(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/cybernatus/go/pkg/mod/github.com/!cybernatus/tempo@v0.0.0-20200628004834-fc9a391e8ecf/main.go:96 +0x2e9
main.BackgroundLoop()
    /home/cybernatus/go/pkg/mod/github.com/!cybernatus/tempo@v0.0.0-20200628004834-fc9a391e8ecf/main.go:149 +0xeb
created by main.main
    /home/cybernatus/go/pkg/mod/github.com/!cybernatus/tempo@v0.0.0-20200628004834-fc9a391e8ecf/main.go:374 +0x4ae

It tends to happen quite a few times cause of the bad path we have to the server by here and maybe also DDOSGuard acting funny in EU for a while. Unfortunetely, when this occurs the client ultimately crash and a manual reboot is necessary.

On a side note, using your client is much appreciated since I have way less fails on the graps compared to the official. So bunch of gratitude for that ;w;

lflare commented 4 years ago

@Cybernatus, thanks for letting me know, I've actually noticed this myself when someone turned off the server for a "migration". This has been fixed in 1c0ff352e7818fcf4612bf1abda985ac87e319d6.

Cybernatus commented 4 years ago

Thanks :3

There is also a variant from this crash, when for some reason the server return an invalid response that couldn't be parsed correctly :

2020/06/30 09:48:46 Received invalid server response: 
panic: runtime error: slice bounds out of range [:-1]

goroutine 51 [running]:
main.pingServer(0x0)
    /home/cybernatus/go/pkg/mod/github.com/!cybernatus/tempo@v0.0.0-20200628004834-fc9a391e8ecf/main.go:116 +0x819
main.BackgroundLoop()
    /home/cybernatus/go/pkg/mod/github.com/!cybernatus/tempo@v0.0.0-20200628004834-fc9a391e8ecf/main.go:153 +0x108
created by main.main
    /home/cybernatus/go/pkg/mod/github.com/!cybernatus/tempo@v0.0.0-20200628004834-fc9a391e8ecf/main.go:386 +0x43f
lflare commented 4 years ago

Hello!

Real sorry about that, I thought I had fixed it, but this time around, I really fixed it in 2c05184951c68530554565a412aecce4f805ef6f. It really shouldn't crash anymore if it fails to ping the backend!