Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError crash #4418

Closed
hobbes3 opened this issue Aug 20, 2016 · 3 comments
Closed

UnicodeDecodeError crash #4418

hobbes3 opened this issue Aug 20, 2016 · 3 comments

Comments

@hobbes3
Copy link

hobbes3 commented Aug 20, 2016

Expected Behavior

Bot to run

Actual Behavior

Bot crashes after a successful login

Your FULL config.json (remove your username, password, gmapkey and any other private info)

{
    "auth_service": "ptc",
    "username": "xxx",
    "password": "xxx",
    "location": "37.795614,-122.393536",
    "gmapkey": "xxx",
    "encrypt_location": "",
    "tasks": [
    {
        "type": "HandleSoftBan"
    },
    {
        "type": "SleepSchedule",
        "config": {
        "enabled": false,
        "time": "09:04",
        "duration":"7:46",
        "time_random_offset": "00:24",
        "duration_random_offset": "00:43"
        }
    },
        {
                "type": "RandomPause",
        "config": {
                "enabled": true,
                "min_duration": "00:00:10",
                "max_duration": "00:10:00",
                "min_interval": "00:10:00",
                "max_interval": "02:00:00"
        }
        },
    {
        "type": "CompleteTutorial",
        "config": {
        "enabled": true,
        "// set a name": "",
        "nickname": "hobbes3k"
        }
    },
    {
        "type": "CollectLevelUpReward"
    },
    {
        "type": "IncubateEggs",
        "config": {
        "longer_eggs_first": true
        }
    },
    {
        "type": "UpdateLiveStats",
        "config": {
        "enabled": true,
        "min_interval": 10,
        "stats": ["username", "uptime", "stardust_earned", "xp_earned", "xp_per_hour", "stops_visited"],
        "terminal_log": true,
        "terminal_title": true
        }
    },
    {
        "type": "UpdateLiveInventory",
        "config": {
        "enabled": true,
        "min_interval": 120,
        "show_all_multiple_lines": false,
        "items": ["pokemon_bag", "space_info", "pokeballs", "greatballs", "ultraballs", "razzberries", "luckyegg"]
        }
    },
    {
        "type": "TransferPokemon",
        "config": {
        "min_free_slot": 5,
        "transfer_wait_min": 1,
        "transfer_wait_max": 4
        }
    },
    {
        "type": "NicknamePokemon",
        "config": {
        "enabled": true,
        "nickname_template": "{iv_pct}_{iv_ads}"
        }
    },
    {
        "type": "EvolvePokemon",
        "config": {
        "evolve_all": "none",
        "__evolve_all": "Caterpie,Ekans,Goldeen,Krabby,Pidgey,Rattata,Paras,Spearow,Tentacool,Weedle,Zubat",
        "first_evolve_by": "iv",
        "evolve_above_cp": 0,
        "evolve_above_iv": 0,
        "logic": "or",
        "evolve_speed": 20,
        "use_lucky_egg": false
        }
    },
    {
        "type": "RecycleItems",
        "config": {
        "min_empty_space": 20,
        "max_balls_keep": 300,
        "max_potions_keep": 20,
        "max_berries_keep": 100,
        "max_revives_keep": 10,
        "item_filter": {
            "Pokeball":     { "keep" : 100 },
            "Greatball":    { "keep" : 100 },
            "Potion":       { "keep" : 0 },
            "Super Potion": { "keep" : 0 },
            "Hyper Potion": { "keep" : 0 },
            "Max Potion":   { "keep" : 20 },
            "Revive":       { "keep" : 0 },
            "Max Revive":   { "keep" : 10 },
            "Razz Berry":   { "keep" : 100 }
        },
        "recycle_wait_min": 1,
        "recycle_wait_max": 4
        }
    },
    {
        "type": "CatchPokemon",
        "config": {
        "catch_visible_pokemon": true,
        "catch_lured_pokemon": true,
        "min_ultraball_to_keep": 10,
        "berry_threshold": 0.35,
        "vip_berry_threshold": 0.9,
        "catch_throw_parameters": {
            "excellent_rate": 0.3,
            "great_rate": 0.5,
            "nice_rate": 0.2,
            "normal_rate": 0.1,
            "spin_success_rate" : 0.8,
            "hit_rate": 0.85
        },
        "catch_simulation": {
            "flee_count": 3,
            "flee_duration": 2,
            "catch_wait_min": 2,
            "catch_wait_max": 6,
            "berry_wait_min": 2,
            "berry_wait_max": 3,
            "changeball_wait_min": 2,
            "changeball_wait_max": 3
        }
        }
    },
    {
        "type": "SpinFort",
        "config": {
        "spin_wait_min": 1,
        "spin_wait_max": 3
        }
    },
    {
        "type": "FollowPath",
        "config": {
        "path_mode": "loop",
        "path_start_mode": "first",
        "path_file": "configs/path.json"
        }
    }
    ],
    "map_object_cache_time": 5,
    "forts": {
    "avoid_circles": true,
    "max_circle_size": 50,
    "cache_recent_forts": true
    },
    "pokemon_bag": {
    "// if 'show_at_start' is true, it will log all the pokemons in the bag (not eggs) at bot start": {},
    "show_at_start": true,
    "// if 'show_count' is true, it will show the amount of each pokemon (minimum 1)": {},
    "show_count": false,
    "// 'pokemon_info' parameter define which info to show for each pokemon": {},
    "// the available options are": {},
    "// ['cp', 'iv_ads', 'iv_pct', 'ivcp', 'ncp', 'level', 'hp', 'moveset', 'dps']": {},
    "pokemon_info": ["cp", "iv_pct"]
    },
    "walk_max": 8.16,
    "walk_min": 3.16,
    "alt_min": 500,
    "alt_max": 1000,
    "gps_default_altitude": 8.0,
    "replicate_gps_xy_noise": false,
    "replicate_gps_z_noise": false,
    "gps_xy_noise_range": 0.000125,
    "gps_z_noise_range": 12.5,
    "debug": false,
    "test": false,
    "health_record": true,
    "location_cache": true,
    "distance_unit": "km",
    "reconnecting_timeout": 15,
    "logging_color": true,
    "daily_catch_limit": 10000,
    "catch": {
    "any": { "always_catch": true }
    },
    "catch_throw_parameters": {
    "excellent_rate": 0.2,
    "great_rate": 0.5,
    "nice_rate": 0.2,
    "normal_rate": 0.1,
    "spin_success_rate" : 0.8
    },
    "release": {
    "any": { "release_below_cp": 0, "release_below_iv": 0.9, "logic": "or" },

    "Articuno": { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Lapras":   { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Mew":      { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Mewtwo":   { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Moltres":  { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Snorlax":  { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },
    "Zapdos":   { "release_below_cp": 0, "release_below_iv": 0, "logic": "or" },

    "Magikarp": { "release_below_cp": 150, "release_below_iv": 9.5, "logic": "or" },

    "Caterpie":  { "keep_best_iv": 20 },
    "Goldeen":   { "keep_best_iv": 5 },
    "Krabby":    { "keep_best_iv": 5 },
    "Pidgey":    { "keep_best_iv": 60 },
    "Rattata":   { "keep_best_iv": 10 },
    "Spearow":   { "keep_best_iv": 10 },
    "Tentacool": { "keep_best_iv": 10 },
    "Weedle":    { "keep_best_iv": 20 },
    "Zubat":     { "keep_best_iv": 20 },

    "foo": "bar"
    },
    "vips" : {
        "Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate!": {},
        "any": {"catch_above_cp": 500, "catch_above_iv": 0.9, "logic": "and" },
        "Abra": {},
        "Arcanine": {},
        "Articuno": {},
        "Bellsprout": {},
        "Blastoise": {},
        "Bulbasaur": {},
        "Charizard": {},
        "Charmander": {},
        "Charmeleon": {},
        "Dragonair": {},
        "Dragonite": {},
        "Dratini": {},
        "Eevee": {},
        "Exeggcute": {},
        "Exeggutor": {},
        "Flareon": {},
        "Growlithe": {},
        "Gyarados": {},
        "Ivysaur": {},
        "Kadabra": {},
        "Lapras": {},
        "Mew": {},
        "Mewtwo": {},
        "Moltres": {},
        "Snorlax": {},
        "Squirtle": {},
        "Vaporeon": {},
        "Venusaur": {},
        "Wartortle": {},
        "Zapdos": {},

        "foo": "bar"
    }
}

Output when issue occurred

2016-08-20 22:04:12,413 [       cli] [INFO]
2016-08-20 22:04:12,413 [       cli] [INFO] Ran for 0:00:23
2016-08-20 22:04:12,414 [       cli] [INFO] Total XP Earned: 150  Average: 23561.55/h
2016-08-20 22:04:12,414 [       cli] [INFO] Travelled 0.00km
2016-08-20 22:04:12,414 [       cli] [INFO] Visited 0 stops
2016-08-20 22:04:12,414 [       cli] [INFO] Encountered 1 pokemon, 1 caught, 0 released, 0 evolved, 0 never seen before
2016-08-20 22:04:12,415 [       cli] [INFO] Threw 1 pokeball
2016-08-20 22:04:12,415 [       cli] [INFO] Earned 100 Stardust
2016-08-20 22:04:12,415 [       cli] [INFO]
2016-08-20 22:04:12,415 [       cli] [INFO] Highest CP Pokemon: Bellsprout [CP: 71] [IV: 8/6/2] Potential: 0.36
2016-08-20 22:04:12,415 [       cli] [INFO] Most Perfect Pokemon: Bellsprout [CP: 71] [IV: 8/6/2] Potential: 0.36
Traceback (most recent call last):
File "pokecli.py", line 674, in <module>
    main()
File "pokecli.py", line 118, in main
    bot.tick()
File "/home/pokemon/PokemonGo-Bot/pokemongo_bot/__init__.py", line 541, in tick
    if worker.work() == WorkerResult.RUNNING:
File "/home/pokemon/PokemonGo-Bot/pokemongo_bot/cell_workers/follow_path.py", line 143, in work
    'current_position': (lat, lng, alt),
UnboundLocalError: local variable 'alt' referenced before assignment
2016-08-20 22:04:12,428 [sentry.errors] [ERROR] Sentry responded with an error: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
File "/home/pokemon/.pyenv/versions/2.7.12/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 "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/httplib.py", line 1057, in request
    self._send_request(method, url, body, headers)
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/httplib.py", line 1097, in _send_request
    self.endheaders(body)
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/httplib.py", line 1053, in endheaders
    self._send_output(message_body)
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/httplib.py", line 895, in _send_output
    msg += message_body
File "/home/pokemon/.pyenv/versions/2.7.12/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte
2016-08-20 22:04:12,430 [sentry.errors.uncaught] [ERROR] [u"UnboundLocalError: local variable 'alt' referenced before assignment", u'  File "pokecli.py", line 674, in <module>', u'  File "pokecli.py", line 118, in main', u'
File "pokemongo_bot/__init__.py", line 541, in tick', u'  File "pokemongo_bot/cell_workers/follow_path.py", line 143, in work']

Steps to Reproduce

Run the bot

Other Information

OS: Debian 8.1

Branch: dev

Git Commit: f5ec24151155ebca0622c6d2e4feebf2a0224059

Python Version: Python 2.7.12

Any other relevant files/configs (eg: path files)

Short Description

Possible solution

How it would help others

@hobbes3
Copy link
Author

hobbes3 commented Aug 20, 2016

Some times it catches a few pokemons and spins a few port before crashing.

@hobbes3 hobbes3 changed the title UnicodeDecodeError after login UnicodeDecodeError crash Aug 20, 2016
@kanemasa1987
Copy link
Contributor

kanemasa1987 commented Aug 21, 2016

Sounds to be duplicate of this #4390

@mjmadsen
Copy link
Contributor

Yeah, #4390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants