question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

request.get_gym_details fails with [pokemongo_bot.api_wrapper] [WARNING] Server seems to be busy or offline - try again - 1/15

See original GitHub issue

Hi,

I am sorry if this is not the right way to ask for guidance in sharing my progress with adding some new features to the code, but this is my first time I am actually developing python code or even using github. In short I am trying to implement a feature that whenever a spot in a gym is available, the bot will place a mon inside the gym. So i’ve created some very basic and crude code that should do the job, however it seems I run into an error when I try to retreive the GYM_DETAILS. I’ve upgraded the API to version 0.67.2 so that should be OK without problems.

First of all I would like to share my code. I’ve placed this inside file \pokemongo_bot\cell_workers\spin_fort.py Around line 77, I’ve added the following QUICK and DIRTY code. Note that it is just a proof of concept, so the code is very crude.

`

    lat = fort['latitude']
    lng = fort['longitude']

    details = fort_details(self.bot, fort['id'], lat, lng)
    fort_name = details.get('name', 'Unknown')
    
    #NEW CODE ADDED
    fort_type = details.get('type', '1')
    fort_id = fort['id']
	
    if fort_type != 1:
        """
        This is a gym. Get the gym info
        """
        from pgoapi import PGoApi
        PGoAPI_version = PGoApi.get_api_version()
        PGoAPI_version_str = str(PGoAPI_version)
        PGoAPI_version_str = "0."+ PGoAPI_version_str[0:2] + "." + PGoAPI_version_str[-1]
        
        request = self.bot.api.create_request()
        request.get_gym_details(gym_id=fort_id, player_latitude=lat, player_longitude=lng, gym_latitude=lat, gym_longitude=lng, client_version=PGoAPI_version_str)
        try:
            response_gym_dict = request.call()
            GYMDETAILS = response_gym_dict['responses']['GET_GYM_DETAILS']
        except Exception:
            pass
    #NEW CODE END

`

When I execute this code, it starts calling GET_GYM_DETAILS from the API, but it seems that it runs into an error. On the screen I see the following:

[pokemongo_bot.api_wrapper] [WARNING] Server seems to be busy or offline - try again - 1/15

I added some debug details to find out what is going on in the wrapper and see the variables contents. This is what they are:

api_req_method_list=[(134, {‘player_latitude’: 52.090977, ‘gym_latitude’: 52.090977, ‘player_longitude’: 5.09591, ‘gym_id’: u’14ea1a37c420456d8224a6f700477454.16’, ‘gym_longitude’: 5.09591, ‘client_version’: u’0.67.2’})] result=None request_callers=[‘GET_GYM_DETAILS’]

As a test I also tried to call some other methods like

request.fort_details(fort_id=fort_id, latitude=lat, longitude=lng)

and they just work fine. So I have no clue on how to fix this error in getting the gym details. Any ideas / suggestions?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:33 (33 by maintainers)

github_iconTop GitHub Comments

1reaction
goedzocommented, Jul 12, 2017

p.s., pushing your changes with a pull request, to speed up pgoapi https://github.com/pogodevorg/pgoapi/pull/210

0reactions
solderzzccommented, Jul 13, 2017

I think that would be ok.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server seems to be busy or offline · Issue #3768 - GitHub
Hi all. Please help me! 2016-08-13 01:10:15,992 [pokemongo_bot.api_wrapper] [WARNING] Server seems to be busy or offline - try again - 15/15
Read more >
Pokémon Go server status, failed to login and other error ...
If the issue persists, try again in five to ten minutes. If you see this, then the server might still be up -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found