I'm using the Phoenix framework, which is running Cowboy underneath. I am occasionally seeing the following pair of errors in my log:
Bad value on output port 'tcp_inet'
GenServer #PID<0.8423.1> terminating
** (FunctionClauseError) no function clause matching in :http_transport.close/2
(inets) http_transport.erl:346: :http_transport.close(:undefined, #Port<0.18079778>)
(stdlib) gen_server.erl:643: :gen_server.try_terminate/3
(stdlib) gen_server.erl:809: :gen_server.terminate/7
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
All the searching I could think of points to something sending a tuple to gen_tcp:send(). But that is way down under layers of stuff when you're writing at the level of Phoenix.
The server seems to keep rolling so I'm not panicking over this, but I'd like to get to the bottom of it to stop these errors. Anyone know what would be causing this?