Why am I getting ‘:bad_action_from_state_function’ error?

Erlang error: {:bad_action_from_state_function, {:reply, :undefined, {:error, :timeout}}}

I’m seeing this sporadic error lately in our error reporting, but not in stdout. Here’s the backtrace (and all I know about it):

(stdlib) gen_statem.erl:1290: :gen_statem.parse_actions_reply/7
(stdlib) gen_statem.erl:1206: :gen_statem.loop_event_actions_list/10
(ssl) tls_connection.erl:133: :tls_connection.init/1
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Has anyone seen this, too?

On a side note, I wanted to put the error in the topic title, which would have been easy to read and skip for people here, but the forum software would not accept it in any way.

1 Like

looks like the OTP 21.3 ssl bug - which OTP are you on?

downgrade to 21.2.7…


Isn’t this a bad format of the :reply tuple? If it comes from an actions list then I think it is wrong.

1 Like

pretty sure it’s


Here is the real patch. It is a timing related bug and there was one place that missed to cancel the recv timer.


Thank you all, I’ll try do downgrade.

That did the trick.