PokemonGoF / PokemonGo-Bot

The Pokemon Go Bot, baking with community.
MIT License
3.86k stars 1.54k forks source link

[ERROR] [u"TypeError: None has type , but expected one of: (, ) #3851

Closed IanFang closed 8 years ago

IanFang commented 8 years ago

Expected Behavior

Keep running

Actual Behavior

Bot crashes after the summary is printed

Config file

{
    "auth_service": "google",
    "username": "",
    "password": "",
    "location": "",
    "gmapkey": "AIzaSyAiaCNU43hHoRQJXyHCra_1goXn-V4FTkg",
    "libencrypt_location": "",
    "tasks": [
      {
        "type": "HandleSoftBan"
      },
      {
        "type": "SleepSchedule",
        "config": {
          "enabled": false,
          "time": "22:54",
          "duration":"7:46",
          "time_random_offset": "00:24",
          "duration_random_offset": "00:43"
        }
      },
      {
        "type": "CollectLevelUpReward"
      },
      {
        "type": "IncubateEggs",
        "config": {
          "longer_eggs_first": true
        }
      },
      {
        "type": "EvolvePokemon",
        "config": {
            "evolve_all": "none",
            "first_evolve_by": "iv",
            "evolve_above_cp": 10,
            "evolve_above_iv": 0.1,
            "logic": "or",
            "evolve_speed": 20,
            "use_lucky_egg": false
        }
      },
      {
        "type": "TransferPokemon"
      },
      {
        "type": "RecycleItems",
        "config": {
          "item_filter": {
            "Pokeball":       { "keep" : 40 },
            "Greatball":       { "keep" : 60 },
            "Ultraball":       { "keep" : 60 },
            "Potion":         { "keep" : 5 },
            "Super Potion":   { "keep" : 10 },
            "Hyper Potion":   { "keep" : 10 },
            "Revive":         { "keep" : 10 },
            "Razz Berry":     { "keep" : 30 }
          }
        }
      },
      {
        "type": "NicknamePokemon",
        "config": {
          "nickname_template": "{name:.8s}_{iv_pct}"
        }
      },
      {
        "type": "CatchVisiblePokemon"
      },
      {
        "type": "SpinFort"
      },
      {
        "type": "MoveToFort",
        "config": {
            "lure_attraction": false,
            "lure_max_distance": 2000
        }
      },
      {
        "type": "FollowSpiral",
        "config": {
          "diameter": 4,
          "step_size": 70
        }
      }
    ],
    "map_object_cache_time": 5,
    "forts": {
      "avoid_circles": true,
      "max_circle_size": 50
    },
    "websocket_server": false,
    "walk": 11,
    "action_wait_min": 1,
    "action_wait_max": 4,
    "debug": false,
    "test": false,
    "health_record": true,
    "location_cache": true,
    "distance_unit": "km",
    "reconnecting_timeout": 15,
    "logging_color": true,
    "catch": {
      "any": { "always_catch" : true }
    },
    "catch_throw_parameters": {
      "excellent_rate": 0.1,
      "great_rate": 0.5,
      "nice_rate": 0.3,
      "normal_rate": 0.1,
      "spin_success_rate" : 0.6
    },
    "release": {
      "any": {"keep_best_cp": 1, "keep_best_iv": 1},
      "Growlithe": {"keep_best_iv": 3},
      "Dragonair": {"keep_best_iv": 3},
      "Grimer": {"keep_best_iv": 3},
      "Magikarp": {"keep_best_iv": 3},
      "Exeggcute": {"keep_best_iv": 3},
      "Eevee": {"keep_best_iv": 3},

      "Weedle": {"keep_best_iv": 10},
      "Pidgey": {"keep_best_iv": 15},
      "Caterpie": {"keep_best_iv": 10},
      "Rattata": {"keep_best_iv": 10}

    },
    "vips" : {
         "Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate!": {},
        "any": {"catch_above_cp": 1200, "catch_above_iv": 0.9, "logic": "or" },
        "Lapras": {},
        "Moltres": {},
        "Zapdos": {},
        "Articuno": {},

        "// S-Tier pokemons (if pokemon can be evolved into tier, list the representative)": {},
        "Mewtwo": {},
        "Dragonite": {},
        "Snorlax": {},
        "// Mew evolves to Mewtwo": {},
        "Mew": {},
        "Arcanine": {},
        "Vaporeon": {},
        "Gyarados": {},
        "Exeggutor": {},
        "Muk": {},
        "Weezing": {},
        "Flareon": {},
        "Jolteon": {}

    }
}

Steps to Reproduce

Run the bot for about 1 hour and it happens

Other Information

Run in docker built with given Dockfile dev branch commit: ee9c6f3

2016-08-13 01:53:52,722 [ cli] [INFO]
2016-08-13 01:53:52,723 [ cli] [INFO] Ran for 0:59:46
2016-08-13 01:53:52,723 [ cli] [INFO] Total XP Earned: 19265 Average: 19338.61/h
2016-08-13 01:53:52,723 [ cli] [INFO] Travelled 4.05km
2016-08-13 01:53:52,723 [ cli] [INFO] Visited 78 stops
2016-08-13 01:53:52,723 [ cli] [INFO] Encountered 45 pokemon, 44 caught, 45 released, 9 evolved, 1 never seen before
2016-08-13 01:53:52,723 [ cli] [INFO] Threw 51 pokeballs
2016-08-13 01:53:52,723 [ cli] [INFO] Earned 6000 Stardust
2016-08-13 01:53:52,723 [ cli] [INFO]
2016-08-13 01:53:52,723 [ cli] [INFO] Highest CP Pokemon: Tangela [CP: 901] [IV: 14/3/14] Potential: 0.69
2016-08-13 01:53:52,723 [ cli] [INFO] Most Perfect Pokemon: Venonat [CP: 347] [IV: 14/14/14] Potential: 0.93
Traceback (most recent call last):
File "pokecli.py", line 521, in
main()
File "pokecli.py", line 95, in main
bot.tick()
File "/usr/src/app/pokemongo_bot/init.py", line 441, in tick
if worker.work() == WorkerResult.RUNNING:
File "/usr/src/app/pokemongo_bot/cell_workers/evolve_pokemon.py", line 28, in work
response_dict = self.api.get_inventory()
File "/usr/src/app/src/pgoapi/pgoapi/pgoapi.py", line 122, in function
return request.call()
File "/usr/src/app/pokemongo_bot/api_wrapper.py", line 106, in call
result = self.call()
File "/usr/src/app/pokemongo_bot/api_wrapper.py", line 63, in call
return PGoApiRequest.call(self)
File "/usr/src/app/src/pgoapi/pgoapi/pgoapi.py", line 220, in call
response = request.request(self._api_endpoint, self._req_method_list, self.get_position())
File "/usr/src/app/src/pgoapi/pgoapi/rpc_api.py", line 126, in request
request_proto = self._build_main_request(subrequests, player_position)
File "/usr/src/app/src/pgoapi/pgoapi/rpc_api.py", line 216, in _build_main_request
request.auth_info.token.contents = self._auth_provider.get_access_token()
File "/usr/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter
new_value = type_checker.CheckValue(new_value)
File "/usr/local/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 176, in CheckValue
raise TypeError(message)
TypeError: None has type , but expected one of: (, )
2016-08-13 01:53:52,730 [sentry.errors] [ERROR] Sentry responded with an error: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
super(ThreadedHTTPTransport, self).send(data, headers)
File "/usr/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
ca_certs=self.ca_certs,
File "/usr/local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
response = self._open(req, data)
File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
'_open', req)
File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
return self.do_open(ValidHTTPSConnection, req)
File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 1284, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/local/lib/python2.7/httplib.py", line 1057, in request
self._send_request(method, url, body, headers)
File "/usr/local/lib/python2.7/httplib.py", line 1097, in _send_request
self.endheaders(body)
File "/usr/local/lib/python2.7/httplib.py", line 1053, in endheaders
self._send_output(message_body)
File "/usr/local/lib/python2.7/httplib.py", line 895, in _send_output
msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128)
2016-08-13 01:53:52,730 [sentry.errors.uncaught] [ERROR] [u"TypeError: None has type , but expected one of: (, )", u' File "pokecli.py", line 521, in ', u' File "pokecli.py", line 95, in main', u' File "pokemongo_bot/__init.py", line 441, in tick', u' File "pokemongo_bot/cell_workers/evolve_pokemon.py", line 28, in work', u' File "pgoapi/pgoapi.py", line 122, in function', u' File "pokemongo_bot/api_wrapper.py", line 106, in call', u' File "pokemongo_bot/api_wrapper.py", line 63, in _call', u' File "pgoapi/pgoapi.py", line 220, in call', u' File "pgoapi/rpc_api.py", line 126, in request', u' File "pgoapi/rpc_api.py", line 216, in _build_main_request', u' File "/usr/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter', u' File "/usr/local/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 176, in CheckValue']
pperle commented 8 years ago

Did it start again? Are you sure you are not banned? Did it happen during evolving?

k4n30 commented 8 years ago

@IanFang - Can you please try without the nickname pokemon function and see if you have the same issue. If the problem disappears, try readding the nickname function and see if it returns

IanFang commented 8 years ago

The problem is gone. No idea why. Thank you guys!

IanFang commented 8 years ago

Probably compatibility problem. Can not reproduce now.