API calls blocked to single endpoint after connection termination
After a connection termination to the Discord API (stemming from Nostrum.Api.Message.edit_message/3), all subsequent requests to the edit that same message will hang and not terminate until timed-out by Oban (or not terminate when executed through iex). :sys.trace indicates that the ratelimiter receives the queue call, but there are no further logs indicating an updated ratelimit from the response nor is the message edited. All other API calls are being processed normally.
I'm on Nostrum v0.10.4 (and OTP 26.2.5.3 for the stacktrace).
Original error
** (CaseClauseError) no case clause matching: {:error, %Nostrum.Error.ApiError{status_code: 503, response: "upstream connect error or disconnect/reset before headers. reset reason: connection termination"}}
(tornium 0.1.0) lib/notification/notification.ex:486: Tornium.Notification.try_message/3
(elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
(elixir 1.17.2) lib/enum.ex:1711: anonymous fn/3 in Enum.map/2
(stdlib 5.2.3.1) maps.erl:416: :maps.fold_1/4
(elixir 1.17.2) lib/enum.ex:2543: Enum.map/2
(tornium 0.1.0) lib/workers/notification.ex:52: Tornium.Workers.Notification.perform/1
(oban 2.19.2) lib/oban/queue/executor.ex:145: Oban.Queue.Executor.perform/1
(oban 2.19.2) lib/oban/queue/executor.ex:77: Oban.Queue.Executor.call/1
Stack trace
This is the stack trace of a hung invocation of Nostrum.Api.Message.edit_message/3.
iex(tornium@ubuntu-16gb-fsn1-1)13> Process.info(p, :current_stacktrace)
{:current_stacktrace,
[
{:gen, :do_call, 4, [file: ~c"gen.erl", line: 240]},
{:gen_statem, :call, 3, [file: ~c"gen_statem.erl", line: 923]},
{Nostrum.Api.Message, :edit, 3,
[file: ~c"lib/nostrum/api/message.ex", line: 312]},
{Tornium.Notification, :try_message, 3,
[file: ~c"lib/notification/notification.ex", line: 486]},
{Enum, :"-map/2-lists^map/1-1-", 2, [file: ~c"lib/enum.ex", line: 1703]},
{Enum, :"-map/2-fun-0-", 3, [file: ~c"lib/enum.ex", line: 1711]},
{:maps, :fold_1, 4, [file: ~c"maps.erl", line: 416]},
{Enum, :map, 2, [file: ~c"lib/enum.ex", line: 2543]}
]}
Gun crash
Although, this issue seems to have fixed itself after about eight hours when gun crashed the Ratelimiter genserver.
** (Oban.CrashError) ** (exit) exited in: :gen_statem.call(#PID<0.416148.0>, {:queue, %{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}}, :infinity)
** (EXIT) an exception was raised:
** (FunctionClauseError) no function clause matching in Nostrum.Api.Ratelimiter.connected/3
(nostrum 0.10.4) lib/nostrum/api/ratelimiter.ex:397: Nostrum.Api.Ratelimiter.connected(:info, {:gun_error, #PID<0.416115.0>, #Reference<0.2727500168.1588592643.146734>, {:badstate, ~c"The stream cannot be found."}}, %{running: %{#Reference<0.2727500168.1588592643.146595> => {"/channels/1341473712771432569/messages/_id", %{params: [], body: %{"embeds" => [%{"description" => "[SDS_ [3122793]](https://torn.com/profiles.php?XID=3122793) - <t:1741470249:R>\n[Cloth_Moth [3044419]](https://torn.com/profiles.php?XID=3044419) - <t:1741472859:R>\n[SJF11 [3540721]](https://torn.com/profiles.php?XID=3540721) - <t:1741475297:R>\n[Kappa_91 [3554368]](https://torn.com/profiles.php?XID=3554368) - <t:1741476451:R>\n", "title" => "Hospitalized Members of LLLL"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1341473712771432569/messages/1341500505804771328"}, {#PID<0.465868.0>, #Reference<0.2727500168.1588592643.146594>}}, #Reference<0.2727500168.1598291970.186530> => {"/channels/1340417795220832286/messages/_id", %{params: [], body: %{"embeds" => [%{"fields" => [%{"name" => "United Kingdom", "value" => "[WendyJong [2882507]](https://tcy.sh/p/2882507) - <t:1741469448:R>\n"}], "footer" => %{"text" => "Shows earliest airstrip landing time"}, "title" => "Flying Members of Torn Community Garden"}, %{"description" => "No members are hospitalized overseas.", "title" => "Hospitalized Members of Torn Community Garden"}, %{"description" => "No members are abroad.", "title" => "Abroad Members of Torn Community Garden"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1340417795220832286/messages/1341491902280761354"}, {#PID<0.465866.0>, #Reference<0.2727500168.1598291970.186529>}}, #Reference<0.2727500168.1598291970.186537> => {"/channels/1316601377073533028/messages/_id", %{params: [], body: %{"embeds" => [%{"description" => "[YourMomGoty [2445328]](https://torn.com/profiles.php?XID=2445328) - <t:1741469334:R>\n[Eratio [2549846]](https://torn.com/profiles.php?XID=2549846) - <t:1741469503:R>\n[Burntgouda [3198883]](https://torn.com/profiles.php?XID=3198883) - <t:1741469603:R>\n[IIIdolphins [2254106]](https://torn.com/profiles.php?XID=2254106) - <t:1741469608:R>\n[DrKillian [3137133]](https://torn.com/profiles.php?XID=3137133) - <t:1741469649:R>\n[Wolf_101 [2268059]](https://torn.com/profiles.php?XID=2268059) - <t:1741469666:R>\n[Frostyy [3176125]](https://torn.com/profiles.php?XID=3176125) - <t:1741470113:R>\n[ChocoFudgiebarr [3077786]](https://torn.com/profiles.php?XID=3077786) - <t:1741470707:R>\n[LilRemians [2012680]](https://torn.com/profiles.php?XID=2012680) - <t:1741470795:R>\n[-Kas- [3199934]](https://torn.com/profiles.php?XID=3199934) - <t:1741493238:R>\n", "title" => "Hospitalized Members of The Horizon Initiative"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1316601377073533028/messages/1347623841811398788"}, {#PID<0.465838.0>, #Reference<0.2727500168.1579941892.120000>}}, #Reference<0.2727500168.1598291970.186553> => {"/channels/1266844880856940584/messages/_id", %{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Phantom Reapers"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1266844880856940584/messages/1336147511957524523"}, {#PID<0.465835.0>, #Reference<0.2727500168.1588592643.146661>}}, #Reference<0.2727500168.1598291970.186630> => {"/channels/1335005566933794867/messages/_id", %{params: [], body: %{"embeds" => [%{"fields" => [%{"name" => "Torn", "value" => "[Klujio [2179910]](https://tcy.sh/p/2179910) - <t:1741473937:R>\n[Conjexaige [3492911]](https://tcy.sh/p/3492911) - <t:1741475786:R>\n"}], "footer" => %{"text" => "Shows earliest airstrip landing time"}, "title" => "Flying Members of Bargain Boozers CW"}, %{"description" => "No members are hospitalized overseas.", "title" => "Hospitalized Members of Bargain Boozers CW"}, %{"description" => "No members are abroad.", "title" => "Abroad Members of Bargain Boozers CW"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1335005566933794867/messages/1344367158582575206"}, {#PID<0.465869.0>, #Reference<0.2727500168.1598291970.186629>}}}, conn: #PID<0.416115.0>, remaining_in_window: 43, outstanding: %{"/channels/1266844880856940584/messages/_id" => {:initial, {[], []}}, "/channels/1293776093333164032/messages/_id" => {:initial, {[{%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465839.0>, #Reference<0.2727500168.1579941892.118080>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465819.0>, #Reference<0.2727500168.1579941892.117390>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465787.0>, #Reference<0.2727500168.1598291970.178308>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465734.0>, #Reference<0.2727500168.1598291970.170760>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465733.0>, #Reference<0.2727500168.1598291970.168274>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465699.0>, #Reference<0.2727500168.1588592643.141020>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465653.0>, #Reference<0.2727500168.1598291970.160899>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465650.0>, #Reference<0.2727500168.1619787777.206036>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465604.0>, #Reference<0.2727500168.1619787777.204780>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465570.0>, #Reference<0.2727500168.1619787777.199742>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465519.0>, #Reference<0.2727500168.1619787777.198602>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465532.0>, #Reference<0.2727500168.1588592643.134286>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465433.0>, #Reference<0.2727500168.1619787777.193174>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465489.0>, #Reference<0.2727500168.1619787777.192317>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465436.0>, #Reference<0.2727500168.1579941892.117026>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465365.0>, #Reference<0.2727500168.1619787777.187051>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465362.0>, #Reference<0.2727500168.1598291970.140536>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465353.0>, #Reference<0.2727500168.1619787777.185820>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465329.0>, #Reference<0.2727500168.1598291970.135480>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465284.0>, #Reference<0.2727500168.1619787777.183058>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465270.0>, #Reference<0.2727500168.1588592643.117192>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465225.0>, #Reference<0.2727500168.1588592643.113413>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465248.0>, #Reference<0.2727500168.1579941892.107195>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465189.0>, #Reference<0.2727500168.1579941892.105830>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465134.0>, #Reference<0.2727500168.1598291970.126147>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465138.0>, #Reference<0.2727500168.1619787777.175017>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465107.0>, #Reference<0.2727500168.1598291970.123030>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465090.0>, #Reference<0.2727500168.1598291970.119354>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465088.0>, #Reference<0.2727500168.1619787777.165812>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.464972.0>, #Reference<0.2727500168.1619787777.163058>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.464974.0>, #Reference<0.2727500168.1619787777.158095>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.465002.0>, #Reference<0.2727500168.1588592643.108167>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.464897.0>, #Reference<0.2727500168.1619787777.153911>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", ...}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.464924.0>, #Reference<0.2727500168.1619787777.151392>}}, {%{params: [], body: %{"embeds" => [%{"description" => "No members are hospitalized", ...}]}, method: :patch, headers: [{...}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.464921.0>, #Reference<0.2727500168.1598291970.102088>}}, {%{params: [], body: %{"embeds" => [%{...}]}, method: :patch, headers: [...], ...}, {#PID<0.464821.0>, #Reference<0.2727500168.1598291970.100477>}}, {%{params: [], body: %{"embeds" => [...]}, method: :patch, ...}, {#PID<0.464841.0>, #Reference<0.2727500168.1579941892.102197>}}, {%{params: [], body: %{...}, ...}, {#PID<0.464827.0>, ...}}, {%{params: [], ...}, {...}}, {%{...}, ...}, {...}, ...], [{%{params: [], body: %{"embeds" => [%{"description" => "[bbgrich [3555103]](https://torn.com/profiles.php?XID=3555103) - <t:1741443133:R>\n", "title" => "Hospitalized Members of Violent Resolution"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1293776093333164032/messages/1347606980784820245"}, {#PID<0.425181.0>, #Reference<0.2727500168.1616117761.222375>}}]}}, "/channels/1316601377073533028/messages/_id" => {:initial, {[{%{params: [], body: %{"embeds" => [%{"description" => "[Tentacles [3163623]](https://torn.com/profiles.php?XID=3163623) - <t:1741473139:R>\n", "title" => "Hospitalized Members of Chrondawgs"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1316601377073533028/messages/1337131008549716084"}, {#PID<0.465867.0>, #Reference<0.2727500168.1598291970.186617>}}], []}}, "/channels/1335005566933794867/messages/_id" => {:initial, {[{%{params: [], body: %{"embeds" => [%{"fields" => [%{"name" => "China", "value" => "[babusen [3442954]](https://tcy.sh/p/3442954) - <t:1741477866:R>\n"}, %{"name" => "South Africa", "value" => "[UncleePockets [3529730]](https://tcy.sh/p/3529730) - <t:1741471497:R>\n"}, %{"name" => "Switzerland", "value" => "[HappyJon [3138091]](https://tcy.sh/p/3138091) - <t:1741470806:R>\n"}, %{"name" => "Torn", "value" => "[Brizo [2715469]](https://tcy.sh/p/2715469) - <t:1741472601:R>\n[Ace_Armani [3172559]](https://tcy.sh/p/3172559) - <t:1741474348:R>\n[TheJeff [3189453]](https://tcy.sh/p/3189453) - <t:1741470767:R>\n"}, %{"name" => "UAE", "value" => "[FattyLumpkin [2702848]](https://tcy.sh/p/2702848) - <t:1741476328:R>\n"}], "footer" => %{"text" => "Shows earliest airstrip landing time"}, "title" => "Flying Members of Shiny Hoard Avian Team"}, %{"description" => "No members are hospitalized overseas.", "title" => "Hospitalized Members of Shiny Hoard Avian Team"}, %{"fields" => [%{"name" => "China", "value" => "[Rhysie [3348591]](https://tcy.sh/p/3348591)\n"}, %{"name" => "United Kingdom", "value" => "[TaterSaladSa [2488202]](https://tcy.sh/p/2488202)\n"}], "title" => "Abroad Members of Shiny Hoard Avian Team"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1335005566933794867/messages/1346928764881473606"}, {#PID<0.465865.0>, #Reference<0.2727500168.1598291970.186645>}}], []}}, "/channels/1335691234936885441/messages/_id" => {:initial, {[{%{params: [], body: %{"embeds" => [%{"fields" => [%{"name" => "Argentina", "value" => "[NeverPrey [3411977]](https://tcy.sh/p/3411977) - <t:1741467996:R>\n"}, %{"name" => "South Africa", "value" => "[Sadaka [2161801]](https://tcy.sh/p/2161801) - <t:1741479778:R>\n"}, %{"name" => "Torn", "value" => "[Acayib [2895639]](https://tcy.sh/p/2895639) - <t:1741474166:R>\n[FriendlyBea [3035400]](https://tcy.sh/p/3035400) - <t:1741476126:R>\n[nyxl [3276095]](https://tcy.sh/p/3276095) - <t:1741469877:R>\n[FallenRonin1337 [3466161]](https://tcy.sh/p/3466161) - <t:1741473228:R>\n[Friedritch [3573954]](https://tcy.sh/p/3573954) - <t:1741472186:R>\n"}], "footer" => %{"text" => "Shows earliest airstrip landing time"}, "title" => "Flying Members of DarkHearts"}, %{"description" => "No members are hospitalized overseas.", "title" => "Hospitalized Members of DarkHearts"}, %{"fields" => [%{"name" => "China", "value" => "[JaySnipes [3188844]](https://tcy.sh/p/3188844)\n"}, %{"name" => "South Africa", "value" => "[Demonknifer [2558452]](https://tcy.sh/p/2558452)\n"}, %{"name" => "Switzerland", "value" => "[Cansif [2473265]](https://tcy.sh/p/2473265)\n"}, %{"name" => "UAE", "value" => "[Epicwin [592103]](https://tcy.sh/p/592103)\n"}, %{"name" => "United Kingdom", "value" => "[liablelia [3417105]](https://tcy.sh/p/3417105)\n"}], "title" => "Abroad Members of DarkHearts"}]}, method: :patch, headers: [{"content-type", "application/json"}], route: "/channels/1335691234936885441/messages/1336074768377577495"}, {#PID<0.465858.0>, #Reference<0.2727500168.1588592643.146733>}}], []}}, "/channels/1340417795220832286/messages/_id" => {:initial, {[], []}}, "/channels/1341473712771432569/messages/_id" => {:initial, {[], []}}}, wrapped_token: #Function<4.13273927/0 in Nostrum.Api.Ratelimiter.empty_state/1>, inflight: %{}})
(stdlib 5.2.3.1) gen_statem.erl:1395: :gen_statem.loop_state_callback/11
(stdlib 5.2.3.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
(stdlib 5.2.3.1) gen.erl:246: :gen.do_call/4
(stdlib 5.2.3.1) gen_statem.erl:923: :gen_statem.call/3
(nostrum 0.10.4) lib/nostrum/api/message.ex:312: Nostrum.Api.Message.edit/3
(tornium 0.1.0) lib/notification/notification.ex:486: Tornium.Notification.try_message/3
(elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
(elixir 1.17.2) lib/enum.ex:1711: anonymous fn/3 in Enum.map/2
(stdlib 5.2.3.1) maps.erl:416: :maps.fold_1/4
(elixir 1.17.2) lib/enum.ex:2543: Enum.map/2
Thank you for the bug report.
I will need a :sys.trace of the ratelimiter, please. This case should be covered presently already with the test I added for the last issue (connection killed while request is in flight). I added another test case to test an endpoint with known ratelimit information being crashed and then receiving further requests - this also works fine.
I'll post the trace the next time the issue occurs. After the ratelimiter crash, it hasn't occurred yet.
@jchristgit Sorry about the delay, took a while to catch the bug occurring before it randomly fixed itself. Is this the trace you were asking for? The issue was occurring on PATCH /channels/1316601377073533028/messages/1349840471744319488 in erlang.log
Looking at Oban, this time it was caused by a 502:
** (CaseClauseError) no case clause matching: {:error, %Nostrum.Error.ApiError{status_code: 502, response: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>cloudflare</center>\r\n</body>\r\n</html>\r\n"}}
(tornium 0.1.0) lib/notification/notification.ex:486: Tornium.Notification.try_message/3
(elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
(elixir 1.17.2) lib/enum.ex:1711: anonymous fn/3 in Enum.map/2
(stdlib 5.2.3.1) maps.erl:416: :maps.fold_1/4
(elixir 1.17.2) lib/enum.ex:2543: Enum.map/2
(tornium 0.1.0) lib/workers/notification.ex:52: Tornium.Workers.Notification.perform/1
(oban 2.19.2) lib/oban/queue/executor.ex:145: Oban.Queue.Executor.perform/1
(oban 2.19.2) lib/oban/queue/executor.ex:77: Oban.Queue.Executor.call/1
Thank you for the bug trace.
Sadly it's missing info that I need. I see that messages to channel ..028 are being queued and not processed, but I need to see the trace from way, way earlier to figure out why it ended up in that state in the first place. That means you will probably need to start the trace as soon as possible.