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

Failed to parse gateway message #372

Closed
ImVexed opened this issue Jul 19, 2024 · 11 comments
Closed

Failed to parse gateway message #372

ImVexed opened this issue Jul 19, 2024 · 11 comments

Comments

@ImVexed
Copy link

ImVexed commented Jul 19, 2024

Describe the bug
Seeing lots of snowflake parsing logs

Error

ERROR error while parsing gateway message name=gateway shard_id=0 shard_count=1 err="failed to unmarshal message data: {\"t\":\"GUILD_CREATE\",\"s...: failed to unquote snowflake: invalid syntax"

To Reproduce
Seems to be happening for presence updates as well.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Disgo Version(please complete the following information):
github.com/disgoorg/disgo v0.18.8
github.com/disgoorg/snowflake/v2 v2.0.1
Additional context
Add any other context about the problem here.

@topi314
Copy link
Member

topi314 commented Jul 19, 2024

discord sending ids as non strings again bruh,
can you enable debug logs and send those so we can see which field is causing this?

in case you dont know how you should just need this line at the start of your program

slog.SetLogLoggerLevel(slog.LevelDebug)

@ImVexed
Copy link
Author

ImVexed commented Jul 19, 2024

I'm not seeing any more specific field failure logs, just the same error messages. For presence updates it's:

2024/07/19 15:33:59 ERROR error while parsing gateway message name=gateway shard_id=0 shard_count=1 err="failed to unmarshal message data: {\"t\":\"PRESENCE_UPDATE\",\"s\":328,\"op\":0,\"d\":{\"user\":{\"id\":\"1214960289343348779\"},\"status\":\"online\",\"guild_id\":\"412794678791110664\",\"client_status\":{\"desktop\":\"online\"},\"broadcast\":null,\"activities\":[{\"type\":0,\"timestamps\":{\"start\":1721401839000},\"name\":\"TLauncher\",\"id\":\"c747a5611b48b02b\",\"details\":\"Vues de la page d'accueil\",\"created_at\":1721401839648,\"assets\":{\"large_image\":\"1142030771398385665\"},\"application_id\":\"1140558605771350016\"},{\"type\":0,\"state\":\"with Medal.tv\",\"session_id\":\"8419ad9930d88b0759363ef310e544d9\",\"name\":\"Medal\",\"id\":\"30523a5df503d9a3\",\"details\":\"Recently clipped Minecraft\",\"created_at\":1721403236352,\"buttons\":[\"Follow on Medal\",\"Download Medal\"],\"assets\":{\"large_text\":\"Minecraft\",\"large_image\":\"859167360925564958\"},\"application_id\":\"307998818547531777\"},{\"type\":0,\"timestamps\":{\"start\":1721377578201},\"state\":\"Joue a Grand Theft Auto VI\",\"session_id\":\"8419ad9930d88b0759363ef310e544d9\",\"name\":\"Grand Theft Auto VI\",\"id\":\"e1b62882f0b1f451\",\"flags\":1,\"details\":\"Bienvenue a Vice City!\",\"created_at\":1721377582295,\"buttons\":[\"Jouer a Grand Theft Auto VI\"],\"assets\":{\"large_image\":\"mp:attachments/1221893448110575669/1262758010069979168/1635795-la-sortie-de-grand-theft-auto-vi-est-prevue-pour-l-annee-2025.png?ex=6697c28a&is=6696710a&hm=8a92d346a018b513a9f679cf0f8f084c54855d26eaf0e9f9da2da16e6b9c006e&\"},\"application_id\":1}]}}: failed to unmarshal event data: {\"user\":{\"id\":\"1214960289343348779\"},\"status\":\"online\",\"guild_id\":\"412794678791110664\",\"client_status\":{\"desktop\":\"online\"},\"broadcast\":null,\"activities\":[{\"type\":0,\"timestamps\":{\"start\":1721401839000},\"name\":\"TLauncher\",\"id\":\"c747a5611b48b02b\",\"details\":\"Vues de la page d'accueil\",\"created_at\":1721401839648,\"assets\":{\"large_image\":\"1142030771398385665\"},\"application_id\":\"1140558605771350016\"},{\"type\":0,\"state\":\"with Medal.tv\",\"session_id\":\"8419ad9930d88b0759363ef310e544d9\",\"name\":\"Medal\",\"id\":\"30523a5df503d9a3\",\"details\":\"Recently clipped Minecraft\",\"created_at\":1721403236352,\"buttons\":[\"Follow on Medal\",\"Download Medal\"],\"assets\":{\"large_text\":\"Minecraft\",\"large_image\":\"859167360925564958\"},\"application_id\":\"307998818547531777\"},{\"type\":0,\"timestamps\":{\"start\":1721377578201},\"state\":\"Joue a Grand Theft Auto VI\",\"session_id\":\"8419ad9930d88b0759363ef310e544d9\",\"name\":\"Grand Theft Auto VI\",\"id\":\"e1b62882f0b1f451\",\"flags\":1,\"details\":\"Bienvenue a Vice City!\",\"created_at\":1721377582295,\"buttons\":[\"Jouer a Grand Theft Auto VI\"],\"assets\":{\"large_image\":\"mp:attachments/1221893448110575669/1262758010069979168/1635795-la-sortie-de-grand-theft-auto-vi-est-prevue-pour-l-annee-2025.png?ex=6697c28a&is=6696710a&hm=8a92d346a018b513a9f679cf0f8f084c54855d26eaf0e9f9da2da16e6b9c006e&\"},\"application_id\":1}]}: failed to unquote snowflake: invalid syntax"

But I'm not sure about posting the intial gateway message as it's like 3Mb, followed by a "one of those fields isn't a snowflake"

@topi314
Copy link
Member

topi314 commented Jul 19, 2024

bruh \"application_id\":1
there seems to be an open issue on discords end: discord/discord-api-docs#6763

@topi314
Copy link
Member

topi314 commented Jul 19, 2024

I think the initial guild create also contains the presences, hence why the both error

@ImVexed
Copy link
Author

ImVexed commented Jul 19, 2024

Yes, \"application_id\":1, is present in the ERROR error while parsing gateway message name=gateway shard_id=0 shard_count=1 err="failed to unmarshal message data: {\"t\":\"GUILD_CREATE\" sync message

@topi314
Copy link
Member

topi314 commented Jul 19, 2024

since this issue seems to be happening quite frequently with discord I went ahead and added an option to allow for unquoted ids in the snowflake package

you can enable this by setting snowflake.AllowUnquoted = true and go getting bc39308

this will also be included in the next release

@topi314
Copy link
Member

topi314 commented Jul 19, 2024

I would not recommend to turn this option on unless you get this error tbh, this is just to workaround discords incompetence to address these issues in a timely manner

@ImVexed
Copy link
Author

ImVexed commented Jul 19, 2024

after enabling snowflake.AllowUnquoted = true

ERROR error while parsing gateway message name=gateway shard_id=0 shard_count=1 err="failed to unmarshal message data: {\"t\":\"PRESENCE_UPDATE\",\"s\":15001,\"op\":0,\"d\":{\"user\":{\"id\":\"1015370136045228112\"},\"status\":\"dnd\",\"guild_id\":\"412794678791110664\",\"client_status\":{\"desktop\":\"dnd\"},\"broadcast\":null,\"activities\":[{\"type\":0,\"timestamps\":{\"start\":1721340000922},\"state\":\"Ticket na Cash Mods\",\"session_id\":\"18551ae30f2c038415a2eaf3f616ee45\",\"name\":\"bobusss\",\"id\":\"146c7a3ce0041e7b\",\"flags\":1,\"details\":\"Pomoc z modsami i reduxami?\",\"created_at\":1721417629055,\"buttons\":[\"Cash Mods\",\"YouTube\"],\"assets\":{\"large_image\":\"mp:attachments/908084735719403521/1242513635201519739/a787c37735287b605d185019707cec71.png?ex=667c40ff&is=667aef7f&hm=49f61926c8a2685413b10737f5dbbffa4ccc3d7b1b8d352effdd14ad5ceb9876&\"},\"application_id\":1}]}}: failed to unmarshal event data: {\"user\":{\"id\":\"1015370136045228112\"},\"status\":\"dnd\",\"guild_id\":\"412794678791110664\",\"client_status\":{\"desktop\":\"dnd\"},\"broadcast\":null,\"activities\":[{\"type\":0,\"timestamps\":{\"start\":1721340000922},\"state\":\"Ticket na Cash Mods\",\"session_id\":\"18551ae30f2c038415a2eaf3f616ee45\",\"name\":\"bobusss\",\"id\":\"146c7a3ce0041e7b\",\"flags\":1,\"details\":\"Pomoc z modsami i reduxami?\",\"created_at\":1721417629055,\"buttons\":[\"Cash Mods\",\"YouTube\"],\"assets\":{\"large_image\":\"mp:attachments/908084735719403521/1242513635201519739/a787c37735287b605d185019707cec71.png?ex=667c40ff&is=667aef7f&hm=49f61926c8a2685413b10737f5dbbffa4ccc3d7b1b8d352effdd14ad5ceb9876&\"},\"application_id\":1}]}: failed to parse snowflake as uint64: strconv.ParseUint: parsing \"\": invalid syntax"

@topi314
Copy link
Member

topi314 commented Jul 19, 2024

my logic was a bit flawed lol, try this commit please: 564ae16

@ImVexed
Copy link
Author

ImVexed commented Jul 20, 2024

That worked, not seeing errors anymore

@sebm253
Copy link
Member

sebm253 commented Aug 4, 2024

this has been fixed as of https://github.com/disgoorg/disgo/releases/tag/v0.18.9, please update to this version if you're experiencing this issue and check the release notes for instructions.

@sebm253 sebm253 closed this as completed Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants