valid session but no data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaetanofavoino
    Junior Member
    • Dec 2014
    • 8

    #1

    valid session but no data

    Hi guys, strange behaviour with sessions.

    My bot establishes a connection to api services without problems for the most of the time; I get a session token and I get data calling betting methods without problems; every loop in my bot is done every 20 secs and my session is refreshed by calling keep alive every 15 minutes.

    but...

    sometimes...

    when everything seems to go well, sometimes api services returns no data, no errors, simply no data, listmarketbook, listClearedOrders, listCurrentOrders, listMarketCatalogue... every field in which I expect to find data is empty

    I solve the problem establishing a new connection from scratch... someone has the same problem? a bot should run for ever

    Thank you
  • Lopiner
    Junior Member
    • Feb 2009
    • 117

    #2
    Hi gaetanofavoino

    Session will time out even if you call keep alive (i don't know if this is expected behavior or a bug but i think its expected). If you check the error property of your calls (listmarketbook, listClearedOrders, listCurrentOrders, listMarketCatalogue) you will get a message relating to the session being expired. I think all possible errors that will need a valid re-login are the following:

    "NO_SESSION",
    "NO_APP_KEY",
    "INVALID_APP_KEY",
    "INVALID_SESSION_INFORMATION",
    "INVALID_SUBSCRIPTION_TOKEN"

    Check for them on each response from the API where the error field is present.
    fooledbyabet.com

    Comment

    • gaetanofavoino
      Junior Member
      • Dec 2014
      • 8

      #3
      Thank you for your reply Lopiner, I think it is a bug, no docs found about this kind of session expire.

      I'm going to modify my code to test the error properties you suggest.

      Comment

      • aye robot
        Junior Member
        • Jun 2015
        • 12

        #4
        I've been baffled by the same problem, or at least I think it's the same. I don't get an error, just a response with no data in it like: {"jsonrpc":"2.0","result":[]}

        As far as I can see there is nothing wrong with my request, I certainly have a valid session token and I have kept alive successfully.

        I've only been getting this on listMarketBook but that's the call I make the most.

        I can't track down any cause for this and it's not on every api call - just some. It usually happens after bots have been running for hours and always goes away with a fresh login.

        This has only started happening relatively recently (in the last week or so).

        Comment

        • Mr Magoo
          Junior Member
          • Jan 2011
          • 86

          #5
          I've been seeing this problem as well with listMarketBook.

          What's odd is that the session and connection are fine. It happens with new and old sessions too. Other API calls will work OK, and even a repeated call of the same listMarketBook request might sometimes work or fail again.

          It's as if there are one or more misbehaving/broken API servers and if you are unlucky enough to have your request handled by the broken server, you get an empty response of the form: "{"jsonrpc":"2.0","result":[],"id":"1234"}"

          Edit: This started happening around the 14th of June and has continued 'reliably' since then.
          Last edited by Mr Magoo; 22-06-2015, 03:15 PM. Reason: Added date when problem started

          Comment

          • Mr Magoo
            Junior Member
            • Jan 2011
            • 86

            #6
            aye robot, do you see this listMarketBook() problem with all markets, or just when checking markets that have closed? For me, it seems to be only closed markets. A results-checking script of mine has been the only program that has been getting these problems.

            Comment

            • aye robot
              Junior Member
              • Jun 2015
              • 12

              #7
              I don't call it for any closed markets. What's curious is that once the error starts occurring it gets more and more frequent and never goes away, which is different to randomly occurring request timeouts and the like that just show up every now and again. At the same time I have many successful requests getting normal returns.

              That said I haven't had any of these errors today so far so maybe the problem is going away.

              Comment

              • Mr Magoo
                Junior Member
                • Jan 2011
                • 86

                #8
                That's strange. Maybe we're hitting two different problems here...

                Comment

                • aye robot
                  Junior Member
                  • Jun 2015
                  • 12

                  #9
                  I looked into this a bit more and I found that I am calling some closed markets after all. I call listMarketCatalog to get a list of events then listMarketBook on each market in the list to check whether it's ready to start working on. It seems that listMarketCatalog is sporadically returning some long dead markets and this is the origin of the problem for me.

                  Comment

                  • steveBF
                    Junior Member
                    • Jun 2014
                    • 3

                    #10
                    Hi guys,

                    I've been experiencing the same lately. At end of day I collect results info, but for past few weeks been getting blank responses. Everything else working fine. Just wondering whether you'd found a solution/workaround ?

                    Comment

                    • BetfairDeveloperProgram
                      Administrator
                      • Oct 2008
                      • 680

                      #11
                      HI All,

                      We've verified this issue (affecting CLOSED markets request via listMarketBook) and are currently investigating the root cause.

                      Will update this thread as soon as we know more. Ref# is INC0091314

                      Thanks for bringing this to our attention.

                      Neil
                      Last edited by BetfairDeveloperProgram; 26-06-2015, 10:44 AM. Reason: Add incident ref#

                      Comment

                      • Mr Magoo
                        Junior Member
                        • Jan 2011
                        • 86

                        #12
                        As the empty responses seemed to happen at random, I just changed my code to pause and then retry the request a few times. That seems to work well enough. It's not even necessary to reconnect or relogin.

                        With a maximum of 6 retries, my results gathering program has only complained about never receiving a response just once in the last few days.

                        One thing to bear in mind is that there is another API bug where, if you are requesting multiple markets using a single API call, a failure with one market will mean you won't get a response for any of the other markets either. (Sorry, I can't find a reference for this, but I did read of it somewhere in a 'known issues' post on this site). So if you are gathering lots of results, you are best off avoiding any optimisation and request each market individually.

                        How have you found the results, btw? I had hoped that they might provide a source of authoritative results, but I've found they still contain mistakes from time to time.

                        Comment

                        • BetfairDeveloperProgram
                          Administrator
                          • Oct 2008
                          • 680

                          #13
                          We've verified this issue (affecting CLOSED markets request via listMarketBook) and are currently investigating the root cause.

                          Will update this thread as soon as we know more. Ref# is INC0091314
                          This issue appears to have resolved itself as we are no longer able to recreate it. However, please let us know if you are still experiencing problems.

                          Thanks

                          Neil

                          Comment

                          Working...
                          X