Just started getting these "broken pipe" messages in code that's been working for months. Anyone know how to diagnose TWS socket issues like broken pipes. I don't even know which log to look at!!!
this code has been working for about 3 months without fault so this behavior started 12/16/22. NOW it just fails on the first call to reqMktData
I checked the HELP for the TWS desktop I am using as a gateway and the build is 10.20.1f 12/13/22 so it's NOT pacing problems. I know the connection is working because I have TWS desktop running as my gateway api and I can see the DATA indicator is consistently GREEN. I monitor the ISP feed ( 1GB/s) using a raspberry pi and that seems ok. I'm working on how to look at the TWS logs to see if they tell me anything.
©° Warning: connection terminated
©¸ @ Jib.Reader ~/.julia/packages/Jib/JOmEj/src/reader.jl:70
[ Info: reader exiting
ERROR: LoadError: IOError: write: broken pipe (EPIPE)
Stacktrace:
[1] uv_write(s::Sockets.TCPSocket, p::Ptr{UInt8}, n::UInt64)
@ Base ./stream.jl:1064
[2] unsafe_write(s::Sockets.TCPSocket, p::Ptr{UInt8}, n::UInt64)
@ Base ./stream.jl:1118
[3] unsafe_write
@ ./io.jl:683 [inlined]
[4] write
@ ./io.jl:706 [inlined]
[5] write_one(socket::Sockets.TCPSocket, buf::IOBuffer)
@ Jib.Client ~/.julia/packages/Jib/JOmEj/src/client.jl:28
[6] sendmsg
what is REALLY weird, other than the fact this JUST broke a few days ago, is that it ONLY happens with reqMktData whereas reqHistoricalData works fine.
for (idx, s) in enumerate(eachrow(symbol_list))
contract = Contract(symbol=s.Sym, secType="STK" , exchange=s.exchange , currency="USD")
reqMktData(ib, idx, contract,"106", false) # https://interactivebrokers.github.io/tws-api/tick_types.html
end
BUT this one works properly. They both share the same ZMQ configuration code and worked fine up until 12/16/22.
for (idx, s) in enumerate(eachrow(symbol_list))
sleep(5)
contract = Contract(symbol=s.Sym, secType="STK" , exchange=s.exchange , currency="USD")
try
reqHistoricalData(ib, idx ,contract,"","1 Y","1 day","TRADES",true,1,false )
catch e
println("something went wrong with : " , s.Sym)
stk_send_msg = "STK" * "~" * s.Sy * "~" * "CLOSE" * "~" * string( 999 ) #show there was an error
ZMQ.send( stk_socket, stk_send_msg )
continue
end
end