Go-whatsapp: Cant login

Created on 11 Jun 2019  路  19Comments  路  Source: Rhymen/go-whatsapp

error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}

login successful, session: {uocSvrqQWvColFnkQ0aW2w== [] [] }

go func() {
        terminal := qrcodeTerminal.New()
        terminal.Get(<-qr).Print()     //err here
    }()



I have no session in /tmp, the problem generates when trying to generate QR code. Ive already updated to last version of the repo.
Thanks in advance

Most helpful comment

Note that the version number is in two places: https://github.com/Rhymen/go-whatsapp/blob/master/session.go#L152 and https://github.com/Rhymen/go-whatsapp/blob/master/session.go#L306

Restoring sessions might not work if you don't change the one on line 306 too.

All 19 comments

Same problem here. Anybody knows the cause?

error logging in: error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}

Yups

i found same problem.
fixed by change
longClientName and shortClientName with the short string

i found same problem.
fixed by change
longClientName and shortClientName with the short string

Hello. Can you provide working code example?

We receive error error on login:
decoding login connResp: json: cannot unmarshal array into Go value of type map[string]interface {}
Json is: ["Cmd",{"type":"update"}]

I suppose, that problem not in longClientName and shortClientName :(

@Rhymen, we are waiting for you! :)

_session.go_ file line number 152.
changing {0, 3, 225} to {0,3,3324} did solved it.

I got this value from chrome but I did not understand the actual issue here, can anybody help ?

The problem seems to be that whatsapp is disconnecting users with old whatsapp protocol versions. go-whatsapp probably just needs to update the protobuf schema and that number in session.go (and also keep updating those every time they change)

_session.go_ file line number 152.
changing {0, 3, 225} to {0,3,3324} did solved it.

Thank you, it`s solved our problem!

Note that the version number is in two places: https://github.com/Rhymen/go-whatsapp/blob/master/session.go#L152 and https://github.com/Rhymen/go-whatsapp/blob/master/session.go#L306

Restoring sessions might not work if you don't change the one on line 306 too.

@tulir I checked on your fork that you updated protobuf. Right?

Yes, although it looks like there's another protobuf update since then (version 3324, it was at 2846 when I updated).

Using the last commit solves the problem.

Thank you!

How @it-sumanp told:

session.go file line number 152.
changing {0, 3, 225} to {0,3,3324} did solved it.

And how @tulir told it's necessary update in the same file(session.go) at line 306 too.

Thx it's worked to me.

work?

What made it for me was to change server, i just copied all my files into a backup server i have and started working. Dont know why though

I thinks this issue was resolved with the last commits @SchulteMK

What was happening is I was updating the wrong folder, after i went to /go/src/github.com/Rhymen/go-whatsapp un updated de git it worked just fine in the other server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xnodcorp picture xnodcorp  路  3Comments

yazeed44 picture yazeed44  路  4Comments

lutpiero picture lutpiero  路  8Comments

carloslfu picture carloslfu  路  5Comments

jhow2892 picture jhow2892  路  3Comments