Function :timeout.body/0 is undefined (module :timeout is not available)

Have anyone been seeing this error with their system. It is not coming from my code but i believe from my deps. I have not updated my elixir version. Still running at elixir 1.15.4-otp-26. Failing to track down which deps is causing it. My wild guess is Httpoison. Trying to see if anyone had similar experience.

It will be a lot easier for people to help if you can post the stack trace that should accompany that error message.

My guess is there’s code someplace that thinks it has a struct with a body field, despite actually having the atom :timeout.

timeout in :timeout.body/0
lib/enum.ex in anonymous fn/2 in Enum.map_join/3 at line 1794
lib/enum.ex in Enum.map_intersperse_list/3 at line 4369
lib/enum.ex in Enum.map_intersperse_list/3 at line 4372
lib/enum.ex in Enum.map_join/3 at line 1794
lib/myapp/email.ex in MyApp.Email.send/3 at line 12
lib/myapp/account_manager.ex in anonymous fn/2 in MyApp.AccountManager.upsert_user/4 at line 231
lib/task/supervised.ex in Task.Supervised.invoke_mfa/2 at line 101

That stacktrace is basically all lib/myapp. In particular MyApp.Email.send/3 looks like it’s probably passing in the atom :timeout as one of its arguments

1 Like

Ok i think i realised my problem. Its due to my code change from elsewhere. Thanks all for taking a look.
Seeing :timout.body really threw me off. I was thinking is there a erlang module called timeout which did not have a body function.

Can you show what you’ve changed and it it fixed your problem?

Its my own code problem really. Nothing to do with dependencies or erlang versions. I had a variable that i thought will always be a map with a body attribute. But turns out the variable can be an atom as well which led to :timeout.body being called and failing