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

Unexpected websocket close #98

Closed
nightcoder22 opened this issue Feb 12, 2019 · 8 comments

Comments

Projects
None yet
5 participants
@nightcoder22
Copy link

commented Feb 12, 2019

why i always keep getting this error?
error caught in handler: unexpected websocket close: websocket: close 1006 (abnormal closure): unexpected EOF
anyone else facing same issue? device is connected to internet and whatsapp is running too.
didnt get this error until now.
I get this after about 7 to 8 mins on running program.

@rreuvekamp

This comment has been minimized.

Copy link

commented Feb 13, 2019

The problem seems to be on line:

wac.handle(fmt.Errorf("unexpected websocket close: %v", err))

I propose it should reconnect if it detects the connection is closed, instead of trying to re-read from a closed connection every second.

After a while, I get a panic which says:

[Feb 13, 2019 11:44:08] unexpected websocket close: websocket: close 1000 (normal)
panic: repeated read on failed websocket connection

goroutine 105 [running]:
github.com/gorilla/websocket.(*Conn).NextReader(0xc00027c000, 0xf44680, 0xc000411312, 0x2, 0xc00041c600, 0xc000258180)
	/go/pkg/mod/github.com/gorilla/websocket@v1.4.0/conn.go:967 +0x356
github.com/gorilla/websocket.(*Conn).ReadMessage(0xc00027c000, 0x9ff740, 0xc0002201e0, 0x1, 0x1, 0xb3e060, 0xc0002201e0)
	/go/pkg/mod/github.com/gorilla/websocket@v1.4.0/conn.go:1028 +0x2f
github.com/Rhymen/go-whatsapp.(*Conn).readPump(0xc000219ad0)
	/go/pkg/mod/github.com/!rhymen/go-whatsapp@v0.0.0-20181218094654-2ca6af00572c/conn.go:272 +0x73
created by github.com/Rhymen/go-whatsapp.NewConn
	/go/pkg/mod/github.com/!rhymen/go-whatsapp@v0.0.0-20181218094654-2ca6af00572c/conn.go:129 +0x1ff
@nightcoder22

This comment has been minimized.

Copy link
Author

commented Feb 13, 2019

@rreuvekamp Exactly. It should reconnect but after some time i see socket close and i have to rescan the qr code. Didnt encounter this problem but all of sudden i start getting this error.
@Rhymen Please look into this.

@bottookku

This comment has been minimized.

Copy link

commented Feb 16, 2019

i have the same problem how to solve it?

@nightcoder22

This comment has been minimized.

Copy link
Author

commented Feb 17, 2019

@bottookku I removed all go-whatsapp files and reinstalled it. Also restarted my laptop. This solved for me.

@bottookku

This comment has been minimized.

Copy link

commented Feb 17, 2019

but my bug not solved reinstall files. what OS you using with this? and what phone i use android or this problems not dependencies from phone? i trying launch golang in windows and linux and recieve all that the same errors. on my phone have 1 whatsapp messenger 2 whatsapp buisiness i will try remove buisness

@tulir

This comment has been minimized.

Copy link
Contributor

commented Feb 23, 2019

Could this be caused by c9a81e9? I'm pretty sure it's something recent as reverting to an older version of my software that used 2ca6af0 works fine, whereas the latest version doesn't. I haven't bisected the problem yet, but I couldn't see anything else obvious in the recent commits that could cause this.

@nightcoder22

This comment has been minimized.

Copy link
Author

commented Feb 25, 2019

Lets continue discussion on this issue #106 . I am closing this for now.

@meodemsao

This comment has been minimized.

Copy link

commented May 24, 2019

i have the same problem with traefik 1.7.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.