Status: Failure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LiamP
    Junior Member
    • Oct 2015
    • 284

    #1

    Status: Failure

    Hi,

    I have been getting a few of these sort of errors:

    {'status': 'FAILURE', 'instruction': {'betId': '123123123'}}

    With the errorCode missing, does anyone know why?
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    I don't know.

    You've not given us much to go on. Would you care to elaborate?

    Comment

    • LiamP
      Junior Member
      • Oct 2015
      • 284

      #3

      2016-03-11 14:53:45,201 | INFO | 1.123543133 Letter placed PotentialProfiter initial on 8575994: 64700605193, 7.0, 2.0
      2016-03-11 14:53:45,201 | INFO | 1.123543133 Letter placed PotentialProfiterNoGreen initial on 8575994: 64700605194, 7.0, 2.0
      2016-03-11 14:53:45,201 | INFO | 1.123543133 OrderPackage initial: SUCCESS, 2 letters

      2016-03-11 14:53:46,232 | INFO | Starting new HTTPS connection (1): api.betfair.com

      2016-03-11 14:53:47,230 | INFO | 1.123543133 killing: 8575994, 64700605193
      2016-03-11 14:53:47,230 | INFO | 1.123543133 killing: 8575994, 64700605194
      2016-03-11 14:53:47,231 | INFO | Starting new HTTPS connection (1): api.betfair.com

      2016-03-11 14:53:47,422 | INFO | 1.123543133 OrderPackage initial: SUCCESS, 2 letters

      2016-03-11 14:53:47,423 | ERROR | API Execution FAILURE: There is an error with an action that has caused the entire order to be rejected. Check the instructionReports errorCode for the reason for the rejection of the order.
      2016-03-11 14:53:47,425 | ERROR | Bug error {'instruction': {'betId': '64700605193'}, 'status': 'FAILURE'}

      *Thread dies due to no errorCode*
      See above for logs, but involves successfully placing 2 orders and then killing said orders 2 seconds later. Looking at my bet history both orders were eventually matched at 7, I will change my code to log the entire response rather than just the first order, as the thread gets killed due to there being no errorCode as expected.

      Comment

      • jabe
        Senior Member
        • Dec 2014
        • 705

        #4
        It says there's an error with the code in the cancelOrders request.

        Without being able to see that code, it's going to be difficult to tell you what is wrong with it.

        Comment

        • Tc147
          Junior Member
          • Jul 2012
          • 5

          #5
          i think i encountered a similar problem lately.
          On 4 occasions yesterday i send out cancel "all orders on specific market" ( cancel order with only MarketId supplied), but ended up getting filled on some of those supposedly canceled orders a short while later, resulting in big open positions when the market should have been greened out. Whats worse is that AFTER failed cancellation my tradesystem did not pick up that there were actually still open orders on the market, which makes me wonder if they were actually showing up at all in the marketbookrequest afterwards. IF NOT then we have a serious problem here. ( As i was under the impression that when only MarketId is supplied ALL orders on that MarketId are canceled anyway i dont verify the cancellation report in those cases( compared to when i only cancel specific BetIds to confirm SizeCancelled).I think i will have to implement a method to control/verify the MarketCancel from now on.
          Still worried about the "NOT CANCELLED" Orders not showing in marketbook afterwards( but not 100% sure there, as there might be other causes for that)

          Comment

          • LiamP
            Junior Member
            • Oct 2015
            • 284

            #6
            I realise that there are issues with bet placements today but this log should clear things up.

            You can see my request and the response received which has no errorCode.

            2016-03-13 15:59:14,451 | INFO | Starting new HTTPS connection (1): api.betfair.com
            2016-03-13 15:59:17,463 | INFO | 1.123610596 Letter placed Five initial on 5894424: 64961954212, 5.0, 2.0
            2016-03-13 15:59:17,463 | INFO | 1.123610596 OrderPackage initial: SUCCESS, 1 letters
            2016-03-13 15:59:19,654 | INFO | 1.123610596 killing: 5894424, 64961954212
            2016-03-13 15:59:19,656 | INFO | Starting new HTTPS connection (1): api.betfair.com
            2016-03-13 15:59:19,888 | ERROR | API Execution FAILURE: There is an error with an action that has caused the entire order to be rejected. Check the instructionReports errorCode for the reas$

            2016-03-13 15:59:19,888 | ERROR | Bug error, request: {'instructions': [{'betId': '64961954212'}], 'customerRef': None, 'marketId': '1.123610596'}

            2016-03-13 15:59:19,888 | ERROR | Bug error, response: {'result': {'status': 'FAILURE', 'instructionReports': [{'instruction': {'betId': '64961954212'}, 'status': 'FAILURE'}], 'marketId’: '1.123610596', 'errorCode': 'BET_ACTION_ERROR'}, 'id': 1, 'jsonrpc': '2.0'}

            2016-03-13 16:00:00,002 | INFO | Transaction count reset: 602

            Comment

            • betdynamics
              Junior Member
              • Sep 2010
              • 534

              #7
              Please post the EXACT json string that is sent to the API

              For example:

              {"jsonrpc":"2.0","method":"SportsAPING/v1.0/cancelOrders","params":{"marketId":"1.123610567"," instructions":[{"betId":"64967032785","sizeReduction":10.0}],"customerRef":"0101"},"id":1}

              Comment

              • LiamP
                Junior Member
                • Oct 2015
                • 284

                #8
                Here is an example from today, full request and response received:

                2016-03-14 16:36:17,604 | INFO | Starting new HTTPS connection (1): api.betfair.com
                2016-03-14 16:36:18,194 | INFO | 1.123621436 Letter placed CalcOneFour initial on 9009394: 65035268925, 8.4, 0.8
                2016-03-14 16:36:18,195 | INFO | 1.123621436 OrderPackage initial: SUCCESS, 1 letters

                2016-03-14 16:36:19,243 | INFO | Starting new HTTPS connection (1): api.betfair.com
                2016-03-14 16:36:20,237 | INFO | 1.123621436 killing: 9009394, 65035268925

                2016-03-14 16:36:20,242 | INFO | Starting new HTTPS connection (1): api.betfair.com

                2016-03-14 16:36:20,407 | ERROR | API Execution FAILURE: There is an error with an action that has caused the entire order to be rejected. Check the instructionReports errorCode for the reason for the rejection of the order.

                2016-03-14 16:36:20,411 | ERROR | Bug error SportsAPING/v1.0/cancelOrders, request: {'jsonrpc': '2.0', 'method': ‘SportsAPING/v1.0/cancelOrders’, 'params': ‘{'marketId': '1.123621436', 'customerRef': None, 'instructions': [{'betId': '65035268925’}]}’, 'id': 1}

                2016-03-14 16:36:20,411 | ERROR | Bug error SportsAPING/v1.0/cancelOrders, response: {'id': 1, 'jsonrpc': '2.0', 'result': {'errorCode': 'BET_ACTION_ERROR', 'marketId': '1.123621436', 'instructionReports': [{'instruction': {'betId': '65035268925'}, 'status': 'FAILURE'}], 'status': 'FAILURE'}}
                Is it simply because I am not supplying size reduction that this sometimes occurs, as docs state that 'If supplied then this is a partial cancel. Should be set to 'null' if no size reduction is required.'

                Comment

                • betdynamics
                  Junior Member
                  • Sep 2010
                  • 534

                  #9
                  I think your issue may be your customerRef.

                  If you don't want to supply a customer reference, then try removing it completely from the JSON request.

                  So, your request would become:

                  {'jsonrpc': '2.0', 'method': ‘SportsAPING/v1.0/cancelOrders’, 'params': ‘{'marketId': '1.123621436', 'instructions': [{'betId': '65035268925’}]}’, 'id': 1}

                  Comment

                  • LiamP
                    Junior Member
                    • Oct 2015
                    • 284

                    #10
                    CustomerRef removed and still seeing the same issue, may try adding the sizeReduction parameter as None:

                    2016-03-17 14:04:11,640 | INFO | 1.123663885 Letter placed Three initial on 8823387: 65205399035, 3.0, 2.0
                    2016-03-17 14:04:11,640 | INFO | 1.123663885 OrderPackage initial: SUCCESS, 1 letters

                    2016-03-17 14:04:13,669 | INFO | 1.123663885 killing: 8823387, 65205399035

                    2016-03-17 14:04:13,671 | INFO | Starting new HTTPS connection (1): api.betfair.com

                    2016-03-17 14:04:13,868 | ERROR | API Execution FAILURE: There is an error with an action that has caused the entire order to be rejected. Check the instructionReports errorCode for the reason for the rejection of the order.

                    2016-03-17 14:04:13,868 | ERROR | Bug error SportsAPING/v1.0/cancelOrders, request: {'jsonrpc': '2.0', 'method': ‘SportsAPING/v1.0/cancelOrders’, 'params': {'marketId': '1.123663885', 'instructions': [{'betId': '65205399035'}], 'id': 1}}

                    2016-03-17 14:04:13,869 | ERROR | Bug error SportsAPING/v1.0/cancelOrders, response: {'id': 1, 'result': {'marketId': '1.123663885', 'instructionReports': [{'status': 'FAILURE', 'instruction': {'betId': '65205399035'}}], 'errorCode': 'BET_ACTION_ERROR', 'status': 'FAILURE'}, 'jsonrpc': '2.0'}

                    Comment

                    • betdynamics
                      Junior Member
                      • Sep 2010
                      • 534

                      #11
                      I just posted your JSON string into a text editor.

                      It shows that the quote marks used to surround the ‘SportsAPING/v1.0/cancelOrders’ are different (and possibly incorrect!)

                      So, you have:

                      Code:
                      ‘SportsAPING/v1.0/cancelOrders’
                      when it perhaps should be

                      Code:
                      'SportsAPING/v1.0/cancelOrders'

                      Comment

                      • Tc147
                        Junior Member
                        • Jul 2012
                        • 5

                        #12
                        I noticed that your last postet API responce only contains 1 errorCode ("result" with errorCode = BET_ACTION_ERROR)
                        the InstructionReports included in the responce should contain another errorCode specifying more excatly what happend.

                        At least from a sample BetActionError Responce im just checking here... obv dont know your exact API responce.
                        It might help to look for the second errorCode to close in on the problem.



                        PS... sry ....just read that it was noticed already that the 2nd errorcode is missing
                        Last edited by Tc147; 17-03-2016, 07:43 PM.

                        Comment

                        • LiamP
                          Junior Member
                          • Oct 2015
                          • 284

                          #13
                          The missmatch of quote marks will be due to me editing it, this error is only happening once every 300 bets ish. I am fairly sure that the reason for the Failure is that the bet has been matched but the lack of errorCode is what is causing the issue.

                          Comment

                          • betdynamics
                            Junior Member
                            • Sep 2010
                            • 534

                            #14
                            Ah ok - didn't realise that it was only happening infrequently.

                            If there is no errorCode, what happens if you resubmit the cancellation request?

                            i.e. it would be interesting to know whether the response is the same.

                            Comment

                            • jabe
                              Senior Member
                              • Dec 2014
                              • 705

                              #15
                              I can't identify the event to allow me to check this - is there any chance at all that the event had gone in-play with a delay of more than 2 seconds when your cancelOrders request was sent, meaning perhaps that the bets were accepted but not yet placed?

                              Comment

                              Working...
                              X