mautrix / whatsapp

A Matrix-WhatsApp puppeting bridge
https://maunium.net/go/mautrix-whatsapp
GNU Affero General Public License v3.0
1.28k stars 173 forks source link

panic: value method maunium.net/go/mautrix.RespError.Is called using nil *RespError pointer #230

Closed alistair23 closed 4 years ago

alistair23 commented 4 years ago

Running the latest version (current master) I get the following crash when running:

[Oct  5, 2020 23:55:25] [Matrix/@whatsapp_13017584845:matrix.alistair23.me/DEBUG] POST https://matrix.alistair23.me/_matrix/media/r0/upload?user_id=%40whatsapp_13017584845%3Amatrix.alistair23.me 2324556 bytes
panic: value method maunium.net/go/mautrix.RespError.Is called using nil *RespError pointer

goroutine 89 [running]:
maunium.net/go/mautrix.(*RespError).Is(0x0, 0xe3d6c0, 0xc000580090, 0x7f8ef75f7398)
        <autogenerated>:1 +0x1b3
errors.Is(0xe3c720, 0x0, 0xe3d6c0, 0xc000580090, 0xc000020000)
        /home/alistair/mautrix-whatsapp/go/src/errors/wrap.go:49 +0x174
maunium.net/go/mautrix.HTTPError.Is(0xc0003a8c00, 0xc000518000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe3d6c0, ...)
        /home/alistair/mautrix-whatsapp/go/work/pkg/mod/maunium.net/go/mautrix@v0.7.10/error.go:72 +0x55
errors.Is(0xe3d6a0, 0xc00052a370, 0xe3d6c0, 0xc000580090, 0xc000355460)
        /home/alistair/mautrix-whatsapp/go/src/errors/wrap.go:49 +0x174
main.(*Portal).HandleMediaMessage(0xc000127100, 0xc0004d1cc0, 0xc00033e610, 0xc000367bc0, 0x14, 0xc000367b60, 0x1b, 0x0, 0x0, 0x0, ...)
        /home/alistair/mautrix-whatsapp/portal.go:1468 +0x10af
main.(*Portal).handleMessage(0xc000127100, 0xc000296740, 0x1b, 0xc0004d1cc0, 0xd33b80, 0xc000303ce0, 0x5f787dfa)
        /home/alistair/mautrix-whatsapp/portal.go:232 +0xcb8
main.(*Portal).handleHistory(0xc000127100, 0xc0004d1cc0, 0xc00034e000, 0xa, 0xa)
        /home/alistair/mautrix-whatsapp/portal.go:857 +0x43a
main.(*Portal).BackfillHistory(0xc000127100, 0xc0004d1cc0, 0x5f78fef4, 0x0, 0x0)
        /home/alistair/mautrix-whatsapp/portal.go:706 +0x3e5
main.(*User).syncPortals(0xc0004d1cc0, 0xc0001d6c00, 0xc000380b00)
        /home/alistair/mautrix-whatsapp/user.go:594 +0xd98
created by main.(*User).HandleChatList
        /home/alistair/mautrix-whatsapp/user.go:541 +0x366

This occurs when starting up and is unavoidable.

ironashram commented 4 years ago

same error here For me it actually crashed after trying to write a message in one of the chat rooms created by the whatsappbot and now if i try to run the brdge i get this error

ironashram commented 4 years ago

nevermind that was just a coincidence, i managed to pinpoint the issue and in my case it is related to a specific media, bypassing that in a very ugly way everything else seems working

tulir commented 4 years ago

This was fixed in tulir/mautrix-go@4da8e38b4a1c5d5439b54c0d3ab8c762c2ad3093