Forum

FAQs and other general questions are answered here
By jamesD
#25493
I've noticed recently that BFBM will often place a bet triggered by a strategy but not register that the bet has been successfully placed. The logs suggest that the 'BET PLACEMENT FAILED', and the bet is not registered anywhere within BFBM, however if I check my Betfair account the bet has placed successfully. As a result of BFBM not registering the bet, another strategy then places a bet on this market (its set not to bet if a bet on this market already exists), which is unwanted.

The logs of one example are below - any ideas on what might be causing this? It appears to be happening semi-regularly (once every 25-30 bets).

18/09/2021 15:27:01: BET PLACEMENT FAILED, Selection name: Over 2.5 Goals, error: System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
at BFNGAPI.RescriptClient.Invoke[T](String method, IDictionary`2 args)
at BFNGAPI.RescriptClient.placeOrders(String marketId, String customerRef, IList`1 placeInstructions)
at Framework.Requests.PlaceOrdersRequest.PerformRequest()
#25494
Hi James,

This bet placement did not complete because of WebException error. This means that bot sent request to Betfair API but it never received any response from Betfair API. So bot does not know if bet was accepted or not by Betfair API.

Betfair API accepted the bet in your case, but bot was unaware of that as it did not receive any response/message from server about this bet.

This can be caused by bad network connection or by problems with Betfair servers.

We recommend that you use reliable cable connection or VPS (Virtual Private Server) if you are running bot with large bet sizes.

Also stop the bot if you notice or hear that Betfair exchange is having problems e.g. follow them at Twitter etc.