-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Nostrum Application Crash Loop #511
Comments
#351 is a similar problem. This needs to be fixed on Discord's side. Not sure if we can make this more crash-resistant in nostrum. Upstream issue is at discord/discord-api-docs#6230 |
Heya! Just an FYI; I have a bot using nostrum that randomly started falling over a couple of days ago due to the same issue. It looks like [error] GenServer #PID<0.527.0> terminating
** (Protocol.UndefinedError) protocol Enumerable not implemented for %{__struct__: Guilds.Models.RecurrenceRule, by_month: nil, by_month_day: nil, by_n_weekday: nil, by_weekday: [1], by_year_day: nil, count: nil, end: nil, frequency: 2, interval: 1, start: "2023-12-19T00:00:00+00:00"} of type Guilds.Models.RecurrenceRule (a struct). This protocol is implemented for the following type(s): DBConnection.PrepareStream, DBConnection.Stream, Date.Range, Ecto.Adapters.SQL.Stream, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Jason.OrderedObject, List, Map, MapSet, Postgrex.Stream, Range, Stream
(elixir 1.14.3) lib/enum.ex:1: Enumerable.impl_for!/1
(elixir 1.14.3) lib/enum.ex:166: Enumerable.reduce/3
(elixir 1.14.3) lib/enum.ex:4307: Enum.reduce/3
(nostrum 0.7.0) lib/nostrum/util.ex:132: Nostrum.Util.safe_atom_map/1
(nostrum 0.7.0) lib/nostrum/util.ex:132: anonymous fn/2 in Nostrum.Util.safe_atom_map/1
(stdlib 4.3) maps.erl:411: :maps.fold_1/3
(nostrum 0.7.0) lib/nostrum/util.ex:132: Nostrum.Util.safe_atom_map/1
(elixir 1.14.3) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
(nostrum 0.7.0) lib/nostrum/util.ex:132: anonymous fn/2 in Nostrum.Util.safe_atom_map/1
(stdlib 4.3) maps.erl:411: :maps.fold_1/3
(nostrum 0.7.0) lib/nostrum/util.ex:132: Nostrum.Util.safe_atom_map/1
(nostrum 0.7.0) lib/nostrum/util.ex:132: anonymous fn/2 in Nostrum.Util.safe_atom_map/1
(stdlib 4.3) maps.erl:411: :maps.fold_1/3
(nostrum 0.7.0) lib/nostrum/util.ex:132: Nostrum.Util.safe_atom_map/1
(nostrum 0.7.0) lib/nostrum/shard/event.ex:12: Nostrum.Shard.Event.handle/3
(nostrum 0.7.0) lib/nostrum/shard/session.ex:100: Nostrum.Shard.Session.handle_info/2
(stdlib 4.3) gen_server.erl:1123: :gen_server.try_dispatch/4
(stdlib 4.3) gen_server.erl:1200: :gen_server.handle_msg/6
(stdlib 4.3) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:gun_ws, #PID<0.528.0>, #Reference<0.3883579898.983040001.130556>, {:binary, <<236, 125, 9, 120, 36, 101, 153, 112, 39, 233, 220, 231, 12, 51, 160, 32, 80, 136, 202, 53, 105, 234, 62, 34, 66, 206, 153, 140, 147, 201, 196, 36, 128, 3, 236, 54, 95, 85, 125, 149, 174, 73, 119, 87, ...>>}}
State: %Nostrum.Struct.WSState{shard_num: 0, seq: 2, session: "16ae16936d51729e231d024b53096377", shard_pid: nil, conn: #PID<0.528.0>, conn_pid: #PID<0.527.0>, stream: #Reference<0.3883579898.983040001.130556>, gateway: "gateway.discord.gg/?compress=zlib-stream&encoding=etf&v=10", last_heartbeat_send: ~U[2023-12-18 01:11:00.834439Z], last_heartbeat_ack: ~U[2023-12-18 01:11:00.913502Z], heartbeat_ack: true, heartbeat_interval: 41250, heartbeat_ref: {:once, #Reference<0.3883579898.983040002.131081>}, zlib_ctx: #Reference<0.3883579898.983171076.130054>} To fix things on my end, I've pinned my app to use a ref containing the fix above (#512) until it gets rolled into the next release. Cheers! |
Thanks for the report, I'll open an issue on the discord api docs. |
Are we missing |
@jchristgit the fix was merged after the most recent hex release |
Over night our error log started filling up with these messages where the Nostrum app goes into a crash loop when it fails to parse
Guilds.Models.IncidentsData
Stacktrace:
I dumped the payload before parsing in session.ex:103 and the only reference to to this struct looks as follows
Any ideas what's happening or how to fix this?
The text was updated successfully, but these errors were encountered: