Status: Failure

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

    #16
    Originally posted by jabe View Post
    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?
    So this is all inplay horse racing (1 second delay), if the bet wasn't accepted then I wouldn't have a betId.

    Should have time next week to setup some code to resubmit any cancel that fails.

    Comment

    • jabe
      Senior Member
      • Dec 2014
      • 705

      #17
      Originally posted by LiamP View Post
      So this is all inplay horse racing (1 second delay), if the bet wasn't accepted then I wouldn't have a betId.

      Should have time next week to setup some code to resubmit any cancel that fails.
      Right. So a system problem rather than a programming problem.

      Or could there be an intermittent code request problem? How easy would it be to write all your API requests and responses to a text file, along with the time? At least that way you could check definitively that it wasn't a program error. Just a thought.

      Comment

      • LiamP
        Junior Member
        • Oct 2015
        • 284

        #18
        Originally posted by jabe View Post
        Right. So a system problem rather than a programming problem.

        Or could there be an intermittent code request problem? How easy would it be to write all your API requests and responses to a text file, along with the time? At least that way you could check definitively that it wasn't a program error. Just a thought.
        Yeh thats a good idea, it seems to happen more on one particular account but could be due to the high number of place / cancel requests I place. Will try logging all requests and responses, this will include regular current order requests as well so I can try and decipher if it has been matched or not.

        Thanks for all your help!

        Comment

        • Tc147
          Junior Member
          • Jul 2012
          • 5

          #19
          Here are some detailed requests and responses from today

          {"jsonrpc":"2.0","method":"SportsAPING/v1.0/cancelOrders","params":{"marketId":1.123726483},"i d":1} worked perfect and cancelled all open orders on that market

          about 45 minutes later the following request:

          {"jsonrpc":"2.0","method":"SportsAPING/v1.0/cancelOrders","params":{"marketId":1.123663780},"i d":1}
          resulted in following API response:
          {"jsonrpc":"2.0","error":{"code":-32099,"message":"ANGX-0002","data":{"exceptionname":"APINGException","AP INGException":{"errorDetails":"market id passed is invalid","errorCode":"INVALID_INPUT_DATA","request UUID":"prdangXXX-XXXX0718-008438XXXX"}}},"id":1}

          the market ID was obviously valid at that time.
          the exakt same request was then repeatedly send about 80 times in the next 40 seconds with exactly the same API response( apart from the "prdang-XXXXXX...." number wich was different everytime)

          I manually cancelled the open order through another programm method which SPECIFIED the actual BetID, that worked and resulted in the following response:
          {"jsonrpc":"2.0","result":{"status":"SUCCESS","mar ketId":"1.123663780","instructionReports":[{"status":"SUCCESS","instruction":{"betId":"655463 3XXXX"},"sizeCancelled":79.78,"cancelledDate":"201 6-03-23T19:XX:XX.000Z"}]},"id":1}

          i edited some XXXX
          i have had similar(and costly) cancel failures latey...roughly in the region of every 300th time as was described earlier by LIAMP...( could be every 500-800th.... dont know)
          i noticed that the JSON response came back with "error" instead of "result"
          and also the missing "STATUS" field in the error message.
          Hopefully we can get to the bottom of the problem by this more detailed data.
          Any Ideas welcome.... BDP Team ?? any help on that?
          Last edited by Tc147; 23-03-2016, 10:40 PM.

          Comment

          • bnl
            Junior Member
            • Nov 2012
            • 108

            #20
            {"jsonrpc":"2.0","method":"SportsAPING/v1.0/cancelOrders","params":{"marketId":1.123726483},"i d":1} worked perfect and cancelled all open orders on that market
            not quoted marketid, but it works since it does not end with '0'
            {"jsonrpc":"2.0","method":"SportsAPING/v1.0/cancelOrders","params":{"marketId":1.123663780},"i d":1}

            not quoted marketid, does not work since it does end with '0'


            resulted in following API response:
            {"jsonrpc":"2.0","error":{"code":-32099,"message":"ANGX-0002","data":{"exceptionname":"APINGException","AP INGException":{"errorDetails":"market id passed is invalid","errorCode":"INVALID_INPUT_DATA","request UUID":"prdangXXX-XXXX0718-008438XXXX"}}},"id":1}
            yes since 1.123663780 will become 1.12366378
            since you treat it as a number


            I manually cancelled the open order through another programm method which SPECIFIED the actual BetID, that worked and resulted in the following response:
            {"jsonrpc":"2.0","result":{"status":"SUCCESS","mar ketId":"1.123663780","instructionReports":[{"status":"SUCCESS","instruction":{"betId":"655463 3XXXX"},"sizeCancelled":79.78,"cancelledDate":"201 6-03-23T19:XX:XX.000Z"}]},"id":1}
            yes, look how nicely the other program treats marketid as a string

            This is exactly why I hate none/weakly typed languages.
            It is fast to make bad code, and takes long time
            to find the errors.

            /Björn

            Comment

            • Tc147
              Junior Member
              • Jul 2012
              • 5

              #21
              BNL,
              that is awesome you picked up on that so quick!
              that all sounds very plausible....will change code quickly and hope all goes well from here on.

              THANK YOU VERY MUCH !

              Tc147
              Last edited by Tc147; 23-03-2016, 11:27 PM.

              Comment

              • LiamP
                Junior Member
                • Oct 2015
                • 284

                #22
                I have an example where two cancel request where sent with one being successful, surely this proves that the error is Betfair and not me?


                2016-03-25 15:00:28,821 | INFO | 1.123800133 Letter placed PotentialProfiterNoGreenFlat initial on 8606896: 65628967457, 27.0, 2.0
                2016-03-25 15:00:28,822 | INFO | 1.123800133 Letter placed PotentialProfiterNoGreenFlat initial on 8973533: 65628967460, 23.0, 2.0
                2016-03-25 15:00:28,822 | INFO | 1.123800133 OrderPackage initial: SUCCESS, 2 letters
                2016-03-25 15:00:30,031 | INFO | Starting new HTTPS connection (1): api.betfair.com
                2016-03-25 15:00:30,445 | INFO | 1.123800133 killing: 8606896, 65628967457
                2016-03-25 15:00:30,445 | INFO | 1.123800133 killing: 8973533, 65628967460

                2016-03-25 15:00:30,451 | INFO | Starting new HTTPS connection (1): api.betfair.com

                2016-03-25 15:00:30,661 | ERROR | API Execution PROCESSED_WITH_ERRORS: 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-25 15:00:30,662 | ERROR | Bug error SportsAPING/v1.0/cancelOrders, request: {'marketId': '1.123800133', 'instructions': [{'betId': '65628967457'}, {'betId': '65628967460'}]}

                2016-03-25 15:00:30,662 | ERROR | Bug error SportsAPING/v1.0/cancelOrders, response: {'jsonrpc': '2.0', 'result': {'marketId': '1.123800133', 'status': 'PROCESSED_WITH_ERRORS', 'instructionReports': [{'cancelledDate': '2016-03-25T15:00:30.000Z', 'status': 'SUCCESS', 'sizeCancelled': 1.56, 'instruction': {'betId': '65628967457'}}, {'status': 'FAILURE', 'instruction': {'betId': '65628967460'}}], 'errorCode': 'BET_ACTION_ERROR'}, 'id': 1}

                Comment

                • betdynamics
                  Junior Member
                  • Sep 2010
                  • 534

                  #23
                  Can I suggest that you contact the BDP team (bdp@betfair.com), send them the EXACT json requests and responses and let them look into it for you.

                  Comment

                  • LiamP
                    Junior Member
                    • Oct 2015
                    • 284

                    #24
                    Here is an example showing the exact request and response, will send Neil an email and point him to this.

                    2016-03-30 16:56:21,579 | INFO | 1.123901956 Letter placed PotentialProfiterNoGreenFlat initial on 4737100: 65878146873, 19.0, 2.0
                    2016-03-30 16:56:21,580 | INFO | 1.123901956 OrderPackage initial: SUCCESS, 1 letters

                    2016-03-30 16:56:23,231 | INFO | 1.123901956 killing: 4737100, 65878146873

                    2016-03-30 16:56:23,389 | WARNING | 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-30 16:56:23,390 | WARNING | Bug error SportsAPING/v1.0/cancelOrders, request: {'instructions': [{'betId': '65878146873'}], 'marketId': '1.123901956'}
                    2016-03-30 16:56:23,390 | WARNING | Bug error SportsAPING/v1.0/cancelOrders, response: {'result': {'status': 'FAILURE', 'instructionReports': [{'status': 'FAILURE', 'instruction': {'betId': '65878146873'}}], 'marketId': '1.123901956', 'errorCode': 'BET_ACTION_ERROR'}, 'id': 1, 'jsonrpc': '2.0'}
                    2016-03-30 16:56:23,390 | WARNING | Instruction None: None

                    2016-03-30 16:56:23,390 | CRITICAL | Response analysis start
                    2016-03-30 16:56:23,390 | CRITICAL | url: https://api.betfair.com/exchange/betting/json-rpc/v1
                    2016-03-30 16:56:23,390 | CRITICAL | raw: <requests.packages.urllib3.response.HTTPResponse object at 0x7feab9153ba8>
                    2016-03-30 16:56:23,390 | CRITICAL | raw: {'chunk_left': None, '_fp': <http.client.HTTPResponse object at 0x7feaba46ae10>, 'decode_content': False, 'chunked': False, 'strict': 0, '_decoder': <requests.packages.urllib3.response.GzipDecoder object at 0x7feab91b00b8>, '_body': None, 'reason': 'OK', 'version': 11, 'headers': HTTPHeaderDict({'Content-Length': '165', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json', 'Date': 'Wed, 30 Mar 2016 16:56:23 GMT', 'Vary': 'Accept-Encoding, User-Agent', 'Cache-Control': 'no-cache', 'Server': 'Cougar - 4.4.2 (Cougar 2 mode)'}), 'status': 200, '_original_response': <http.client.HTTPResponse object at 0x7feaba46ae10>, '_connection': None, '_pool': <requests.packages.urllib3.connectionpool.HTTPSCon nectionPool object at 0x7feaba10d668>, '_fp_bytes_read': 165}
                    2016-03-30 16:56:23,390 | CRITICAL | _content: b'{"jsonrpc":"2.0","result":{"status":"FAILURE","e rrorCode":"BET_ACTION_ERROR","marketId":"1.1239019 56","instructionReports":[{"status":"FAILURE","instruction":{"betId":"658781 46873"}}]},"id":1}'
                    2016-03-30 16:56:23,390 | CRITICAL | encoding: None
                    2016-03-30 16:56:23,390 | CRITICAL | elapsed: 0:00:00.150842
                    2016-03-30 16:56:23,390 | CRITICAL | status_code: 200
                    2016-03-30 16:56:23,390 | CRITICAL | connection: <requests.adapters.HTTPAdapter object at 0x7feaba10def0>
                    2016-03-30 16:56:23,390 | CRITICAL | _content_consumed: True
                    2016-03-30 16:56:23,390 | CRITICAL | reason: OK
                    2016-03-30 16:56:23,390 | CRITICAL | cookies: <RequestsCookieJar[]>
                    2016-03-30 16:56:23,390 | CRITICAL | headers: {'Content-Length': '165', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json', 'Date': 'Wed, 30 Mar 2016 16:56:23 GMT', 'Vary': 'Accept-Encoding, User-Agent', 'Cache-Control': 'no-cache', 'Server': 'Cougar - 4.4.2 (Cougar 2 mode)'}
                    2016-03-30 16:56:23,390 | CRITICAL | history: []
                    2016-03-30 16:56:23,391 | CRITICAL | request: <PreparedRequest [POST]>
                    2016-03-30 16:56:23,391 | CRITICAL | request: {'url': 'https://api.betfair.com/exchange/betting/json-rpc/v1', '_cookies': <RequestsCookieJar[]>, 'method': 'POST', 'headers': {'Content-Length': '153', 'X-Authentication': 'poo', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'keep-alive', 'Accept': '*/*', 'User-Agent': 'python-requests/2.9.1', 'content-type': 'application/json', 'X-Application': 'poo'}, 'body': '{"params": {"instructions": [{"betId": "65878146873"}], "marketId": "1.123901956"}, "id": 1, "method": "SportsAPING/v1.0/cancelOrders", "jsonrpc": "2.0"}', 'hooks': {'response': []}}
                    2016-03-30 16:56:23,391 | CRITICAL | Response analysis end

                    Comment

                    Working...
                    X