Bet_action_error - invalid runner

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mr Magoo
    Junior Member
    • Jan 2011
    • 86

    #1

    Bet_action_error - invalid runner

    I received these errors from the API today. My placeOrders() call returned BET_ACTION_ERROR on an AUS greyhound market.

    The market ID was 2.101056181 - Ball (AUS) 27th Oct - 01:19 R1 545m Mdn

    The request, made at 01:13, returned BET_ACTION_ERROR and each bet came back with INVALID_RUNNER. However, I've double-checked the selection IDs and they all should have been present in the market.

    The response from the Betfair server was as follows: (n.b. this perl's formatting of the JSON response)

    Code:
    $VAR1 = {
              'instructionReports' => [
                                        {
                                          'errorCode' => 'INVALID_RUNNER',
                                          'status' => 'FAILURE',
                                          'instruction' => {
                                                             'side' => 'LAY',
                                                             'limitOrder' => {
                                                                               'price' => '1.74',
                                                                               'persistenceType' => 'LAPSE',
                                                                               'size' => '60.81'
                                                                             },
                                                             'orderType' => 'LIMIT',
                                                             'selectionId' => 8944362
                                                           }
                                        },
                                        {
                                          'errorCode' => 'INVALID_RUNNER',
                                          'status' => 'FAILURE',
                                          'instruction' => {
                                                             'side' => 'LAY',
                                                             'limitOrder' => {
                                                                               'price' => '2.2',
                                                                               'persistenceType' => 'LAPSE',
                                                                               'size' => '37.5'
                                                                             },
                                                             'orderType' => 'LIMIT',
                                                             'selectionId' => 8944364
                                                           }
                                        },
    [...abbreviated...]
                                      ],
              'marketId' => '2.101056181',
              'errorCode' => 'BET_ACTION_ERROR',
              'status' => 'FAILURE'
            };
    So can anyone tell me what went wrong with the bet placement? Was this a Betfair server error of some kind, or is it something to do with my request?
    Last edited by Mr Magoo; 27-10-2014, 03:46 PM. Reason: Incomplete
  • Mr Magoo
    Junior Member
    • Jan 2011
    • 86

    #2
    Also seen this same problem today on other AUS markets: 2.101056391. The errors repeated when further attempts to place bets in the market failed.

    I can't see any sign in my logs about any non-runners in these two markets. In any case, the placeOrders() call involved multiple runners and they can't all have been withdrawn?

    Comment

    • Mr Magoo
      Junior Member
      • Jan 2011
      • 86

      #3
      I'm still getting this regularly, on many different markets. All are on the AUS exchange. It's really frustrating, as I can't see what the problem is and I'm not sure what my program's response to these errors should be. Right now, it will ignore the market for a while, then refresh the odds and try to place the bets again. But the error re-occurs, often repeating until the market is closed.

      Any suggestions from the BF devs here?

      Comment

      • Mr Magoo
        Junior Member
        • Jan 2011
        • 86

        #4
        Ok, still getting this error countless times daily from the AUS exchange. I've examined my requests and can't see anything unusual in the ones that trigger this error.

        Is this forum the only support for the new API? I'd send an email to the normal Betfair support team, but I don't find them very clued-up on the API, they always ask for screenshots :-/

        Comment

        • BetfairDeveloperProgram
          Administrator
          • Oct 2008
          • 679

          #5
          Hi Mr Magoo,

          Please send any support queries directly to bdp@betfair.com.

          We can then investigate these issue's with reference to your account. You would only expect to see this error if either the selection has been removed (non-runner) or if the seectionId passed in the request is invalid (doesn't exist).

          Thanks

          Neil

          Comment

          • Mr Magoo
            Junior Member
            • Jan 2011
            • 86

            #6
            I've tracked this problem down now... you're absolutely right, the root cause is a non-runner, but there's a strangeness with how greyhound non-runners are marked in the API.

            When a greyhound is taken out, sometimes the runner is not marked as REMOVED but instead is given the status LOSER. This is while the market is still open for betting. This fooled my code into believing that the runner was still valid.

            e.g. here's a BET_ACTION_ERROR I got today, on the market 2.101062652 Hoba (AUS) 6th Nov - 11:08 R8 461m Heat

            (n.b. for some reason the forum seems to insert random spaces into the quoted JSON...)

            {"params":{"instructions":[
            {"limitOrder":{"price":1.7,"persistenceType":"LAPS E","size":17.14},"side":"LAY","orderType":"LIMIT", "selectionId":7675922},
            {"limitOrder":{"price":1.46,"persistenceType":"LAP SE","size":26.09},"side":"LAY","orderType":"LIMIT" ,"selectionId":8671411},
            {"limitOrder":{"price":38,"persistenceType":"LAPSE ","size":4},"side":"BACK","orderType":"LIMIT","sel ectionId":8951843},
            {"limitOrder":{"price":200,"persistenceType":"LAPS E","size":4},"side":"BACK","orderType":"LIMIT","se lectionId":8671411}],
            "marketId":"2.101062652"},"jsonrpc":"2.0","id":"12 34","method":"SportsAPING/v1.0/placeOrders"}
            Which returned BET_ACTION_ERROR and INVALID_RUNNER for each of the bets:

            {"jsonrpc":"2.0","id":"1234","result":{"instructio nReports":[
            {"errorCode":"INVALID_RUNNER","status":"FAILURE"," instruction":{"side":"LAY","limitOrder":{"price":1 .7,"persistenceType":"LAPSE","size":17.14},"orderT ype":"LIMIT","selectionId":7675922}},
            {"errorCode":"INVALID_RUNNER","status":"FAILURE"," instruction":{"side":"LAY","limitOrder":{"price":1 .46,"persistenceType":"LAPSE","size":26.09},"order Type":"LIMIT","selectionId":8671411}},
            {"errorCode":"INVALID_RUNNER","status":"FAILURE"," instruction":{"side":"BACK","limitOrder":{"price": 38,"persistenceType":"LAPSE","size":4},"orderType" :"LIMIT","selectionId":8951843}},
            {"errorCode":"INVALID_RUNNER","status":"FAILURE"," instruction":{"side":"BACK","limitOrder":{"price": 200,"persistenceType":"LAPSE","size":4},"orderType ":"LIMIT","selectionId":8671411}}],
            "marketId":"2.101062652","errorCode":"BET_ACTION_E RROR","status":"FAILURE"}}
            I put in some debug code that reloaded the market and printed out the raw JSON received from Betfair:

            {"jsonrpc":"2.0","result":[{"marketId":"2.101062652","marketName":"R8 461m Heat","marketStartTime":"2014-11-06T11:08:00.000Z","description":{"persistenceEnabl ed":true,"bspMarket":true,"marketTime":"
            2014-11-06T11:08:00.000Z","suspendTime":"2014-11-06T11:08:00.000Z","bettingType":"ODDS","turnInPlay Enabled":false,"marketType":"WIN","marketBaseRate" :6.5,"discountAllowed":true,"wallet":"Australian
            wallet","rules":"[REMOVED]","rulesHasDate":true,"clarifications":"<additiona linfo>Box changes:<br><br>Dog 9. Classic Nikko starts from box no.2"},"totalMatched":21.6,"runners":[{"selectionId":7675922,"runnerName":"1. Hellyeah Bolt","handicap":0.0,"sortPriority":1,"metadata":{ "runnerId":"12729998"}},{"selectionId":7954059,"ru nnerName":"3. Barnes Bay","handicap":0.0,"sortPriority":2,"metadata":{" runnerId":"12729999"}},{"selectionId":8350810,"run nerName":"4. Little Turn","handicap":0.0,"sortPriority":3,"metadata":{ "runnerId":"12730000"}},{"selectionId":7184654,"ru nnerName":"5. Good Odds Demon","handicap":0.0,"sortPriority":4,"metadata": {"runnerId":"12730001"}},{"selectionId":8972685,"r unnerName":"6. Rip And Tear","handicap":0.0,"sortPriority":5,"metadata":{ "runnerId":"12730002"}},{"selectionId":8951843,"ru nnerName":"8. Kinlochs Fury","handicap":0.0,"sortPriority":6,"metadata":{ "runnerId":"12730003"}},{"selectionId":8671411,"ru nnerName":"9. Classic Nikko","handicap":0.0,"sortPriority":7,"metadata": {"runnerId":"12730004"}}],"eventType":{"id":"4339","name":"Greyhound Racing"},"event":{"id":"27300690","name":"Hoba (AUS) 6th Nov","countryCode":"AU","timezone":"Australia/Sydney","venue":"Hobart","openDate":"2014-11-06T08:38:00.000Z"}}],"id":"1234"}
            and

            {"jsonrpc":"2.0","result":[{"marketId":"2.101062652","isMarketDataDelayed":fa lse,"status":"OPEN","betDelay":0,"bspReconciled":f alse,"complete":true,"inplay":false,"numberOfWinne rs":1,"numberOfRunners":7,"numberOfActiveRunners": 6,"lastMatchTime":"2014-11-06T11:08:23.796Z","totalMatched":9632.7,"totalAvai lable":75348.67,"crossMatching":false,"runnersVoid able":false,"version":129674041,"runners":[{"selectionId":7675922,"handicap":0.0,"status":"AC TIVE","lastPriceTraded":1.7,"totalMatched":8360.65 ,"sp":{"nearPrice":1.79,"farPrice":1.76,"backStake Taken":[],"layLiabilityTaken":[]},"ex":{"availableToBack":[{"price":1.69,"size":25.36},{"price":1.67,"size":1 9.4},{"price":1.64,"size":18.43}],"availableToLay":[{"price":1.76,"size":99.3},{"price":1.77,"size":20 .77},{"price":1.81,"size":25.24}],"tradedVolume":[]}},{"selectionId":7954059,"handicap":0.0,"status": "ACTIVE","lastPriceTraded":13.0,"totalMatched":136 .74,"sp":{"nearPrice":13.0,"farPrice":13.0,"backSt akeTaken":[],"layLiabilityTaken":[]},"ex":{"availableToBack":[{"price":12.0,"size":30.77},{"price":10.5,"size":3 .96},{"price":10.0,"size":23.51}],"availableToLay":[{"price":13.0,"size":45.63},{"price":13.5,"size":2 6.28},{"price":14.0,"size":25.51}],"tradedVolume":[]}},{"selectionId":8350810,"handicap":0.0,"status": "ACTIVE","lastPriceTraded":13.0,"totalMatched":319 .27,"sp":{"nearPrice":14.0,"farPrice":17.0,"backSt akeTaken":[],"layLiabilityTaken":[]},"ex":{"availableToBack":[{"price":13.0,"size":2.89},{"price":12.0,"size":9. 08},{"price":11.5,"size":44.12}],"availableToLay":[{"price":14.5,"size":3.85},{"price":16.0,"size":7. 86},{"price":18.0,"size":7.39}],"tradedVolume":[]}},{"selectionId":7184654,"handicap":0.0,"status": "ACTIVE","lastPriceTraded":9.8,"totalMatched":518. 25,"sp":{"nearPrice":9.0,"farPrice":9.0,"backStake Taken":[],"layLiabilityTaken":[]},"ex":{"availableToBack":[{"price":9.0,"size":74.17},{"price":8.8,"size":2.6 },{"price":8.2,"size":16.89}],"availableToLay":[{"price":9.8,"size":2.73},{"price":10.0,"size":19. 88},{"price":11.5,"size":2.0}],"tradedVolume":[]}},{"selectionId":8972685,"handicap":0.0,"status": "ACTIVE","lastPriceTraded":11.0,"totalMatched":214 .92,"sp":{"nearPrice":10.5,"farPrice":10.5,"backSt akeTaken":[],"layLiabilityTaken":[]},"ex":{"availableToBack":[{"price":10.0,"size":11.57},{"price":9.4,"size":34 .61},{"price":9.0,"size":18.12}],"availableToLay":[{"price":11.0,"size":7.19},{"price":12.5,"size":3. 1},{"price":14.0,"size":17.77}],"tradedVolume":[]}},{"selectionId":8951843,"handicap":0.0,"status": "ACTIVE","lastPriceTraded":11.0,"totalMatched":82. 85,"sp":{"nearPrice":11.021790478769685,"farPrice" :11.5,"backStakeTaken":[],"layLiabilityTaken":[]},"ex":{"availableToBack":[{"price":10.0,"size":8.05},{"price":9.8,"size":2.0 4},{"price":9.4,"size":7.93}],"availableToLay":[{"price":11.5,"size":35.59},{"price":14.5,"size":5 .94},{"price":16.0,"size":7.06}],"tradedVolume":[]}},{"selectionId":8671411,"handicap":0.0,"status":"LO SER","sp":{"backStakeTaken":[],"layLiabilityTaken":[]},"ex":{"availableToBack":[],"availableToLay":[],"tradedVolume":[]}}]}],"id":"1234"}
            So runner 8671411 9. Classic Nikko has been withdrawn, but instead of being marked as REMOVED it has been classified as a loser instead. It also hasn't been noted in the market clarifications section (which my code has to parse for horse racing non-runners when calling listMarketCatalogue). This would appear to be bug number 1 - but at least now I have found the problem I can work around it.

            Of the 4 bets submitted, 2 were for this runner. But all 4 came back with the error INVALID_RUNNER. Is this the expected result? I would have thought that only the bets on the NRs should be marked INVALID_RUNNER (it certainly confused me, I had manually checked many of these errors and was puzzled when the runners were still in the market!)

            Comment

            • betdynamics
              Junior Member
              • Sep 2010
              • 534

              #7
              Ooh - I've been looking for the REMOVED status, so I guess I'll have to check for both REMOVED and LOSER as well.

              I look forward to a response from BDP on this one.

              Comment

              • BetfairDeveloperProgram
                Administrator
                • Oct 2008
                • 679

                #8
                Hi Mr Magoo

                Of the 4 bets submitted, 2 were for this runner. But all 4 came back with the error INVALID_RUNNER. Is this the expected result?
                This is the expected result

                So runner 8671411 9. Classic Nikko has been withdrawn, but instead of being marked as REMOVED it has been classified as a loser instead
                This definitely appears to be inconsistent treatment of the REMOVED selection. Only selections that are settled as LOSER should be returned as 'LOSER'. otherwise they should be returned as 'REMOVED'.

                I have asked out Market Operations team to investigate this particular incident to see if there is a potential issue causing this discrepancy.

                Kind Regards

                Neil

                Comment

                • betdynamics
                  Junior Member
                  • Sep 2010
                  • 534

                  #9
                  Neil

                  Why would you get an INVALID_RUNNER response for ALL bets in that were placed if only two of them related to the runner that had been removed?

                  This kind of removes the point of placing multiple bets in a single call - you may as well just send one bet per request.

                  Is this perhaps some kind of atomic grouping? (i.e. place multiple bets that NEED to be placed together in the same call and they will all fail if one of them is incorrect)

                  Comment

                  • BetfairDeveloperProgram
                    Administrator
                    • Oct 2008
                    • 679

                    #10
                    Hi betdynamics,

                    Yes, placeOrder is an atomic operation, if one bet fails all will fail. Agree that the INVALID_RUNNER response for all runners isn't ideal, but this was by design and not due to a specific defect. This may be something that we can look to optimise at some point.

                    Thanks

                    Neil

                    Comment

                    • betdynamics
                      Junior Member
                      • Sep 2010
                      • 534

                      #11
                      Neil - Thanks for the confirmation.

                      Comment

                      Working...
                      X