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

could not decode binary: invalid string with tag 174 #187

Closed
shekohex opened this issue Jul 8, 2019 · 31 comments
Closed

could not decode binary: invalid string with tag 174 #187

shekohex opened this issue Jul 8, 2019 · 31 comments

Comments

@shekohex
Copy link

shekohex commented Jul 8, 2019

Hello, I got this error

error caught in handler: error processing data: error decoding binary: could not decode binary: invalid string with tag 174

Directly after scanning the QR

Here is some information

Mobile OS: Android 6.0
Whatsapp Version: 2.19.190
go-whatsapp Version: latest, the master branch at 4c0e263c801b8b5bd7fad1577786ab6c32c2c042

A small note here for the owner, i'm also working on another project uses the same implementation as this project, but written in rust, and of course since most of my code is ported from this project i'm now facing the same problem.

Here is a debug log from my implementation that maybe help

OPEN THE LOG

[2019-07-08T02:46:39Z DEBUG wapi::client] Received message Text("s1,[\"Conn\",{\"ref\":\" MASKEDI\",\"wid\":\"MASKED@c.us\",\"connected\":true,\"isResponse\":\"false\",\"serverToken\":\"MASKED",\"browserToken\":\"  MQWKED",\"clientToken\":\"MASKED",\"lc\":\"US\",\"lg\":\"en\",\"locales\":\"en-US\",\"secret\":\"MASKED",\"protoVersion\":[0,17],\"binVersion\":11,\"battery\":48,\"plugged\":false,\"platform\":\"android\",\"features\":{\"URL\":true,\"FLAGS\":\"EAEYASgBOAFAAUgBWAFgAWgBmAEBoAEBsAECyAEB2AEC6AEC\"},\"phone\":{\"wa_version\":\"2.19.190\",\"mcc\":\"602\",\"mnc\":\"002\",\"os_version\":\"6.0\",\"device_manufacturer\":\"LENOVO\",\"device_model\":\"A7000plus\",\"os_build_number\":\"A7000-a_PLUS_S308_160618_ROW\"},\"pushname\":\"Shady Khalifa\",\"tos\":0}]")
[2019-07-08T02:46:39Z INFO  echo] new state: Connected
[2019-07-08T02:46:39Z DEBUG echo] PersistentSession { client_token: "MASKED", server_token: "MASKED", client_id:[...], mac: [...] }
[2019-07-08T02:46:39Z INFO  echo] user data changed: UserJid(Jid { id: "MASKED", is_group: false, is_broadcast: false, is_remote: false })
[2019-07-08T02:46:39Z DEBUG wapi::client] Received message Text("s2,[\"Blocklist\",{\"id\":1,\"blocklist\":[\"201145915654@c.us\",\"201098459714@c.us\"]}]")
[2019-07-08T02:46:39Z DEBUG wapi::client] received json: Array([Short("Blocklist"), Object(Object { store: [("id", Number(Number { category: 1, exponent: 0, mantissa: 1 }), 0, 1), ("blocklist", Array([Short("201145915654@c.us"), Short("201098459714@c.us")]), 0, 0)] })])
[2019-07-08T02:46:39Z DEBUG wapi::client] Received message Binary([52, 55, 97, 102, 55, 54, 97, 51, 54, 99, 101, 102, 55, 51, 100, 97, 46, 45, 45, 51, 55, 44, 143, 101, 218, 52, 137, 207, 52, 177, 250, 42, 128, 60, 171, 213, 126, 119, 224, 168, 116, 2, 152, 239, 223, 149, 241, 245, 59, 2, 99, 220, 68, 91, 10, 201, 229, 160, 28, 210, 240, 238, 154, 30, 168, 29, 1, 7, 195, 210, 241, 179, 242, 237, 49, 101, 16, 36, 117, 126, 29, 110, 166, 125, 136, 149, 73, 4, 218, 75, 16, 151, 219, 229, 251, 80, 128, 130, 43, 68, 199, 1, 146, 9, 77, 41, 80, 171, 118, 172, 201, 64, 84, 118, 50, 97, 120, 233, 76, 147, 221, 137, 217, 250, 168, 163, 204, 197, 196, 112, 183, 253, 52, 144, 235, 28, 245, 55, 47, 15, 150, 123, 218, 200, 5, 56, 191, 208, 124, 214, 6, 28, 13, 74, 96, 114, 107, 111, 130, 22, 159, 181, 146, 222, 20, 164, 4, 4, 149, 81, 218, 174, 11, 196, 139, 14, 225, 129, 23, 136, 234, 165, 245, 155, 191, 250, 39, 68, 2, 230, 51, 90, 175, 190, 157, 211, 70, 32, 236, 95, 146, 113, 98, 183, 187, 132, 176, 170, 180, 239, 251, 165, 153, 124, 78, 150, 214, 142, 24, 89, 145, 167, 96, 253, 66, 155, 206, 160, 15, 129, 201, 58, 45, 132, 91, 160, 107, 187, 135, 96, 43, 183, 147, 182, 102, 175, 96, 212, 193, 38, 13, 87, 60, 19, 245, 217, 42, 181, 165, 8, 102, 141])
[2019-07-08T02:46:39Z TRACE wapi::protocol] Found the sep at: 21, and the tag is: [52, 55, 97, 102, 55, 54, 97, 51, 54, 99, 101, 102, 55, 51, 100, 97, 46, 45, 45, 51, 55]
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 9
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 248
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 23
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 91
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 139
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 248
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 52
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 45
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 250
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 255
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 80
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 52
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 45
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 250
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 255
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 80
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 52
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 45
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 250
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 255
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 80
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 52
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 45
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 250
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 255
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 80
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 40
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 45
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 250
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 255
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 80
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 40
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 45
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 250
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 255
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 80
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 40
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 45
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 250
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 255
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 80
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 40
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 45
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 250
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 255
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 35
[2019-07-08T02:46:39Z DEBUG wapi::node] trying to find the tag: 174
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Unknown("Invalid Tag, tag 174")'

i'm open to provide more information as needed to reproduce this issue

Thanks :)

@shekohex
Copy link
Author

shekohex commented Jul 8, 2019

ok, it seems that whatsapp is going to add a new tag 174, or it is already added, in the whatsapp v2.19.190 is a beta version, i got another mobile with whatsapp v2.19.175 and it seems to work perfectly !

@codenoid
Copy link

codenoid commented Jul 8, 2019

so @shekohex would you close this issue

@shekohex
Copy link
Author

shekohex commented Jul 8, 2019

Actually, we need to know what tag it is, since definitely WhatsApp will update to this version soon, so we would face that issue.

I managed to solve this by returning an empty Node when getting a 174 tag.
And my implementation is seems to work fine in beta version. I can login send/recv messages, but this sounds like a hack/workaround this issue, we need to investigate more to know actually what that tag is, or even is this actually a new tag or a bug in our decoder reading a wrong bits results a wrong tag ?!

@curchunflo13
Copy link

hello, same error here "gowhatsapp: error occoured: error processing data: error decoding binary: could not decode binary: invalid string with tag 174" I hope you can fix it, thank you so much for your work!

@codenoid
Copy link

have no idea, i use Latest WhatsApp Version (Android 9) and latest go-whatsapp version, works like a charm

@houstondapaz
Copy link
Contributor

The problem is linked with the version of phone whatsapp version, on my project I have a lot of numbers connecteds (more than 300) and sometimes this error is logged, but I don't have the phone to get more details

@shekohex
Copy link
Author

have no idea, i use Latest WhatsApp Version (Android 9) and latest go-whatsapp version, works like a charm

are you in beta channel ? what whatsapp version you are using ?

@shekohex
Copy link
Author

... sometimes this error is logged, but I don't have the phone to get more details

are you sure that it's a tag 174 error ? or similar one ? and what version of whatsapp you are using ?

@codenoid
Copy link

@shekohex my WhatsApp version is 2.19.188, and it's latest version available in play store, and i'm not beta-tester

@shekohex
Copy link
Author

my WhatsApp version is 2.19.188, and it's latest version available in play store, and i'm not beta-tester

yup, but i'm using beta v2.19.190 and it has this problem.

@SchulteMK
Copy link
Collaborator

Has anyone tried to find a clue in the official WAweb js source?

@houstondapaz
Copy link
Contributor

houstondapaz commented Jul 11, 2019

Has anyone tried to find a clue in the official WAweb js source?

I found this code videoDecErrorFrames: [174, i] on Call definition
@SchulteMK

@shekohex
Copy link
Author

@SchulteMK

.... or even is this actually a new tag or a bug in our decoder reading a wrong bits results a wrong tag ?!

I'm afraid of the fact that could be a Decoder error, and there's no tag 174 at all.

I will try to Inspect these bytes to see what's actually going on.

@houstondapaz
Copy link
Contributor

Any update @shekohex ?

@shekohex
Copy link
Author

Any update @shekohex ?

not actually, i just bypass it as a workaround here by returning an empty node once i get that error,
i'm currently not using this project, as i said it helped me to implement my own.

by the way, i hadn't encounter any new errors since i fixed this using this workaround, i mean by errors here: logic errors, server error, invalid data, data corruption ..etc.
all working now.

@curchunflo13
Copy link

curchunflo13 commented Jul 16, 2019 via email

@Lantizia
Copy link

Lo folks, sorry but I I think this issue hasn't really gone away.

When enabling the account it's icon just stays greyed out as though it isn't connecting...
image

This is obviously after enabling it at least once the first time, scanning the QR successfully and then restarting Pidgin.

Only some of the time does the below appear after enabling it, sometimes it doesn't... but in all cases the account stays greyed out for me...
image

I'm using the latest nightly on Ubuntu 18.04 amd64, the way I personally install it is below (which includes a handy and legal way of obtaining the WhatsApp icon!)...

sudo wget -P /usr/lib/purple-2 https://buildbot.hehoe.de/purple-gowhatsapp/builds/libgowhatsapp_0.0.3~git9da9b8e+gowhatsapp~git5c79b2c_amd64_ubuntu18.04.so
for s in 16 22 48; do curl -sL web.archive.org/web/0im_/media.whatsapp.com/directory/logos/Bitmap/logo-color-symbol.png|sudo convert -background none -trim -resize $sx$s - /usr/share/pixmaps/pidgin/protocols/$s/whatsapp.png; done

@Lantizia
Copy link

Lantizia commented Aug 6, 2019

This (for me) was fixed with commit hoehermann/purple-gowhatsapp@47b0740

@houstondapaz
Copy link
Contributor

@Lantizia I'm don't found this commit

@Lantizia
Copy link

Lantizia commented Aug 7, 2019

Sorry I now realise why my commit mention before... wasn't turning into a link automatically :) I've been talking about purple-gowhatsapp rather than go-whatsapp... have updated the link above to reflect that.

But if you are using purple-gowhatsapp then there is already a prebuilt binary of 47b0740 at https://buildbot.hehoe.de/purple-gowhatsapp/builds/

Sorry for the confusion

@houstondapaz
Copy link
Contributor

@Lantizia understood

But this commit did not fix the problem only mask the error, right?

@Lantizia
Copy link

Lantizia commented Aug 7, 2019

Couldn't comment, not my code.

@shekohex
Copy link
Author

shekohex commented Aug 7, 2019

@houstondapaz I think I'm doing the same thing in my codebase, I didn't have any side effects thought.

Moreover, that error happens only on starting, and occurs 3 or more times.

I just ignore it 😌

@houstondapaz
Copy link
Contributor

I agree to ignore this error on your application, but we cannot ignore this error as a library

@ramikalai
Copy link

On Android 9 with WhatsApp version 2.19.254 I had the same issue, updating WhatsApp version to 2.19.258 solved this - I no longer get the 174 tag on the server. Could potentially be a bug introduced and then removed by the WhatsApp team.

@gabstv
Copy link
Contributor

gabstv commented Nov 1, 2019

Does anybody have an update on this?

@tigsdev
Copy link

tigsdev commented Nov 11, 2019

solution?

@rodarima
Copy link

May be related: rodarima/libwa#1

@fitraditya
Copy link

fitraditya commented Oct 14, 2020

Hi, I also got this error.
I tried to remove all chat history, and then tried to re-login and it works normally.
I use WhatsApp version 2.20.200.19 on android.

@deven96
Copy link

deven96 commented Jun 11, 2021

Still got this problem running the echo example

Mobile OS: Android 10
Whatsapp Version: 2.21.11.17
go-whatsapp Version: v0.1.1 latest on master

@cobordism
Copy link

I have encountered the same problem in the whatsapp signal bridge here: meinto/whatsapp-signal-bridge#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests