PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Issue: Crash after 1 hour

Open pranavperfect opened this issue 10 years ago • 16 comments

Expected Behavior

Continue running

Actual Behavior

Abruptly stopped

Steps to Reproduce

Random - Unsure if there are any steps possible to reproduce

Other Information

OS: Win 10 Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here): ad6c21aa1dc0902c62e4001f9a81ce1fcd8a9f59 Python Version: (run 'python -V' and paste it here): Python 2.7.6

Error details when it stopped: Traceback (most recent call last): File "pokecli.py", line 493, in main() File "pokecli.py", line 129, in main raise e TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

pranavperfect avatar Aug 07 '16 16:08 pranavperfect

Can you post your config? Looks like you're missing a comma somewhere.

mjmadsen avatar Aug 07 '16 21:08 mjmadsen

@mjmadsen if so, why would it run for 1 hour before stopping?

pranavperfect avatar Aug 07 '16 21:08 pranavperfect

2016-08-07 14:00:43,695 [ cli] [INFO] Ran for 0:59:33 2016-08-07 14:00:43,695 [ cli] [INFO] Total XP Earned: 17080 Average: 17209.90/h 2016-08-07 14:00:43,696 [ cli] [INFO] Travelled 1.90km 2016-08-07 14:00:43,697 [ cli] [INFO] Visited 55 stops 2016-08-07 14:00:43,698 [ cli] [INFO] Encountered 60 pokemon, 58 caught, 0 released, 4 evolved, 0 never seen before 2016-08-07 14:00:43,698 [ cli] [INFO] Threw 65 pokeballs 2016-08-07 14:00:43,699 [ cli] [INFO] Earned 5800 Stardust 2016-08-07 14:00:43,700 [ cli] [INFO] 2016-08-07 14:00:43,701 [ cli] [INFO] Highest CP Pokemon: Golduck [CP: 955] [IV: 4/15/10] Potential: 0.64 2016-08-07 14:00:43,702 [ cli] [INFO] Most Perfect Pokemon: Magikarp [CP: 86] [IV: 13/13/15] Potential: 0.91 Traceback (most recent call last): File "pokecli.py", line 493, in main() File "pokecli.py", line 129, in main raise e TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

pranavperfect avatar Aug 07 '16 21:08 pranavperfect

Can confirm, have the same bug. It is raised every time after perfectly running 1 hour.

This was at the tail of my trace:

  File "pokecli.py", line 501, in <module>
    main()
  File "pokecli.py", line 132, in main
    raise e
TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

With this config file:

{
    "auth_service": "google",
    "username": "x",
    "password": "x",
    "location": "x",
    "gmapkey": "x",
    "tasks": [
      {
        "type": "HandleSoftBan"
      },
      {
        "type": "CollectLevelUpReward"
      },
      {
        "type": "IncubateEggs",
        "config": {
          "longer_eggs_first": false
        }
      },
      {
        "type": "TransferPokemon"
      },
      {
        "type": "EvolvePokemon",
        "config": {
          "evolve_all": "NONE",
          "evolve_cp_min": 300,
          "evolve_speed": 20,
          "use_lucky_egg": false
        }
      },
      {
        "type": "RecycleItems",
        "config": {
          "item_filter": {
            "Pokeball":       { "keep" : 50 },
            "Greatball":      { "keep" : 150 },
            "Potion":         { "keep" : 10 },
            "Super Potion":   { "keep" : 20 },
            "Hyper Potion":   { "keep" : 30 },
            "Revive":         { "keep" : 30 },
            "Razz Berry":     { "keep" : 80 }
          }
        }
      },
      {
        "type": "CatchVisiblePokemon"
      },
      {
        "type": "CatchLuredPokemon"
      },
      {
        "type": "SpinFort"
      },
      {
        "type": "MoveToFort",
        "config": {
            "lure_attraction": true,
            "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": true,
    "walk": 4.16,
    "action_wait_min": 1,
    "action_wait_max": 4,
    "debug": false,
    "test": false,
    "health_record": true,
    "location_cache": true,
    "distance_unit": "km",
    "reconnecting_timeout": 15,
    "evolve_captured": "NONE",
    "catch_randomize_reticle_factor": 1.0,
    "catch_randomize_spin_factor": 1.0,
    "catch": {
      "any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
      "// Example of always catching Rattata:": {},
      "// Rattata": { "always_catch" : true }
    },
    "release": {
      "any": {"keep_best_cp": 1, "keep_best_iv": 1, "logic": "or"},
      "// Example of always releasing Rattata:": {},
      "// Rattata": {"always_release": true},
      "// Example of keeping 3 stronger (based on CP) Pidgey:": {},
      "Pidgey": {"never_release": true},      
      "// Example of keeping 2 stronger (based on IV) Zubat:": {},
      "// Zubat": {"keep_best_iv": 2},
      "// Also, it is working with any": {},
      "// any": {"keep_best_iv": 3},
      "// Example of keeping the 2 strongest (based on CP) and 3 best (based on IV) Zubat:": {},
      "Magikarp": {"keep_best_cp": 1, "keep_best_iv": 2},
      "Bulbasaur": {"keep_best_cp": 1, "keep_best_iv": 1},
      "Charmander": {"keep_best_cp": 1, "keep_best_iv": 1},
      "Squirtle": {"keep_best_cp": 1, "keep_best_iv": 1}
    },
    "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": {}

    }
}

In the example config file, the "none" for the Evolve_Pokemon.config.evolve_all key is not capitalize, maybe it does matter, I am investigating it.

daolf avatar Aug 07 '16 21:08 daolf

What did it do before it stopped running (transfer, evolve, etc)?

mjmadsen avatar Aug 07 '16 22:08 mjmadsen

So those are the logs just before it crashed:

First time:

2016-08-07 21:14:34,925 [TransferPokemon] [INFO] [keep_best_release] Keeping best 1 Squirtle, based on cp and iv
2016-08-07 21:14:35,594 [TransferPokemon] [INFO] [pokemon_release] Exchanged Squirtle [CP 400] [IV 0.29] for candy.
2016-08-07 21:14:40,635 [  SpinFort] [INFO] [spun_pokestop] Spun pokestop xxx . Experience awarded: 50. Items awarded: {u'Pokeball': 2, u'Greatball': 1}
2016-08-07 21:14:43,550 [MoveToFort] [INFO] [moving_to_lured_fort] Moving towards pokestop xxx  - 0.04km (attraction of lure 0.04km)
2016-08-07 21:14:55,792 [  SpinFort] [INFO] [spun_pokestop] Spun pokestop xxx . Experience awarded: 50. Items awarded: {u'Pokeball': 2, u'Greatball': 1}
2016-08-07 21:14:58,194 [MoveToFort] [INFO] [moving_to_lured_fort] Moving towards pokestop xxx - 0.07km (attraction of lure 0.07km)
2016-08-07 21:15:10,580 [       cli] [INFO]
2016-08-07 21:15:10,580 [       cli] [INFO] Ran for 1:00:01
2016-08-07 21:15:10,580 [       cli] [INFO] Total XP Earned: 12065  Average: 12061.18/h
2016-08-07 21:15:10,580 [       cli] [INFO] Travelled 0.70km
2016-08-07 21:15:10,580 [       cli] [INFO] Visited 35 stops
2016-08-07 21:15:10,580 [       cli] [INFO] Encountered 45 pokemon, 44 caught, 0 released, 0 evolved, 1 never seen before
2016-08-07 21:15:10,580 [       cli] [INFO] Threw 50 pokeballs
2016-08-07 21:15:10,580 [       cli] [INFO] Earned 5208 Stardust
2016-08-07 21:15:10,580 [       cli] [INFO]
2016-08-07 21:15:10,580 [       cli] [INFO] Highest CP Pokemon: Pinsir [CP: 1142] [IV: 11/1/14] Potential: 0.58
2016-08-07 21:15:10,580 [       cli] [INFO] Most Perfect Pokemon: Staryu [CP: 119] [IV: 14/15/8] Potential: 0.82

Second time:

2016-08-07 23:26:55,259 [MoveToFort] [INFO] [moving_to_lured_fort] Moving towards pokestop xxx - 0.05km (attraction of lure 0.12km)
2016-08-07 23:27:14,408 [TransferPokemon] [INFO] [keep_best_release] Keeping best 3 Magikarp, based on cp and iv
2016-08-07 23:27:15,301 [TransferPokemon] [INFO] [pokemon_release] Exchanged Magikarp [CP 23] [IV 0.73] for candy.
2016-08-07 23:27:20,340 [CatchLuredPokemon] [INFO] [lured_pokemon_found] Lured pokemon at xxx (8c0324f57e9a4cf6a91a5f2e35e48964.16)
2016-08-07 23:27:21,102 [PokemonCatchWorker] [INFO] [pokemon_appeared] A wild Pidgey appeared! [CP 204] [Potential 0.36] [S/A/D 3/13/0]
2016-08-07 23:27:23,341 [PokemonCatchWorker] [INFO] [threw_pokeball] Used Pokeball, with chance 41.52 (44 left)
2016-08-07 23:27:24,954 [PokemonCatchWorker] [INFO] [pokemon_caught] Captured Pidgey! [CP 204] [Potential 0.36] [3/13/0] [+210 exp]
2016-08-07 23:27:29,967 [MoveToFort] [INFO] [moving_to_lured_fort] Moving towards pokestop  - xxx 0.04km (attraction of lure 0.12km)
2016-08-07 23:27:53,606 [  SpinFort] [INFO] [spun_pokestop] Spun pokestop xxx. Experience awarded: 50. Items awarded: {u'Pokeball': 3}
2016-08-07 23:27:56,715 [MoveToFort] [INFO] [moving_to_lured_fort] Moving towards  xxx - 0.07km (attraction of lure 0.12km)
2016-08-07 23:28:17,280 [       cli] [INFO]
2016-08-07 23:28:17,281 [       cli] [INFO] Ran for 1:00:05
2016-08-07 23:28:17,281 [       cli] [INFO] Total XP Earned: 11580  Average: 11565.05/h
2016-08-07 23:28:17,281 [       cli] [INFO] Travelled 0.42km
2016-08-07 23:28:17,281 [       cli] [INFO] Visited 30 stops
2016-08-07 23:28:17,281 [       cli] [INFO] Encountered 48 pokemon, 48 caught, 0 released, 0 evolved, 0 never seen before
2016-08-07 23:28:17,281 [       cli] [INFO] Threw 57 pokeballs
2016-08-07 23:28:17,281 [       cli] [INFO] Earned 4800 Stardust
2016-08-07 23:28:17,281 [       cli] [INFO]
2016-08-07 23:28:17,282 [       cli] [INFO] Highest CP Pokemon: Slowpoke [CP: 603] [IV: 6/6/3] Potential: 0.33
2016-08-07 23:28:17,282 [       cli] [INFO] Most Perfect Pokemon: Magikarp [CP: 75] [IV: 13/12/11] Potential: 0.8

daolf avatar Aug 07 '16 22:08 daolf

It has now been more than one hour that the bot is running and it has not crashed yet. The only change I made was to put "none" for the Evolve_Pokemon.config.evolve_all key instead of "NONE".

daolf avatar Aug 07 '16 22:08 daolf

Having the same issue, script stops every 1h.

operating system: OSX 10.11.6 commit: e5b7eda6cd7054baadbd6440bf9b94d3d5cd88e3 python: 2.7.10

my config:

{
    "auth_service": "google",
    "username": "[email protected]",
    "password": "XXXXXX",
    "location": "34.009486, -118.496848",
    "gmapkey": "XXXX-XXXXXXX",
    "tasks": [{
        "type": "HandleSoftBan"
    }, {
        "type": "CollectLevelUpReward"
    }, {
        "type": "IncubateEggs",
        "config": {
            "longer_eggs_first": true
        }
    }, {
        "type": "TransferPokemon"
    }, {
      "type": "EvolvePokemon",
      "config": {
          "evolve_all": "Pidgey,Rattata,Weedle,Zubat,Caterpie",
          "first_evolve_by": "cp",
          "evolve_above_cp": 500,
          "evolve_above_iv": 0.8,
          "logic": "or",
          "evolve_speed": 20,
          "use_lucky_egg": false
      }
    }, {
        "type": "RecycleItems",
        "config": {
            "item_filter": {
                "Pokeball": {
                    "keep": 50
                },
                "Greatball": {
                    "keep": 40
                },
                "Ultraball": {
                    "keep": 40
                },
                "Potion": {
                    "keep": 0
                },
                "Super Potion": {
                    "keep": 30
                },
                "Hyper Potion": {
                    "keep": 100
                },
                "Max Potion": {
                    "keep": 30
                },
                "Revive": {
                    "keep": 20
                },
                "Max Revive": {
                    "keep": 30
                },
                "Razz Berry": {
                    "keep": 20
                }
            }
        }
    }, {
        "type": "CatchVisiblePokemon"
    }, {
        "type": "CatchLuredPokemon"
    }, {
        "type": "SpinFort"
    }, {
      "type": "NicknamePokemon",
      "config": {
          "nickname_template": "{name:.9s}{iv_pct}"
      }
    }, {
        "type": "MoveToFort",
        "config": {
            "lure_attraction": false,
            "lure_max_distance": 2000
        }
    }],
    "map_object_cache_time": 5,
    "forts": {
        "avoid_circles": false,
        "max_circle_size": 50
    },
    "websocket_server": false,
    "walk": 13.72,
    "action_wait_min": 1,
    "action_wait_max": 2,
    "debug": false,
    "test": false,
    "health_record": true,
    "location_cache": true,
    "distance_unit": "km",
    "reconnecting_timeout": 15,
    "evolve_captured": "NONE",
    "catch_randomize_reticle_factor": 1,
    "catch_randomize_spin_factor": 1,
    "catch": {
        "any": {
            "catch_above_cp": 0,
            "catch_above_iv": 0,
            "logic": "or"
        },
        "// Example of always catching Rattata:": {},
        "// Rattata": {
            "always_catch": true
        }
    },
    "release": {
        "any": {
            "keep_best_cp": 2,
            "keep_best_iv": 1,
            "release_below_cp": 900,
            "release_below_iv": 0.9,
            "logic": "and"
        },
        "Eevee": {
            "keep_best_cp": 3,
            "keep_best_iv": 3
        },
        "Magikarp": {
            "keep_best_cp": 1,
            "keep_best_iv": 3
        },
        "Charmander": {
            "keep_best_cp": 1,
            "keep_best_iv": 1
        },
        "Bulbasaur": {
            "keep_best_cp": 1,
            "keep_best_iv": 1
        },
        "Squirtle": {
            "keep_best_cp": 1,
            "keep_best_iv": 1
        },
        "Pidgey": {
          "keep_best_cp": 1,
          "keep_best_iv": 1
        },
        "Ratata": {
          "keep_best_cp": 1,
          "keep_best_iv": 1
        },
        "Zubat": {
          "keep_best_cp": 1,
          "keep_best_iv": 1
        },
        "Dratini": {
            "keep_best_cp": 2,
            "keep_best_iv": 2
        },
        "Electabuzz": {
            "keep_best_cp": 2,
            "keep_best_iv": 1
        },
        "// Example of always releasing Rattata:": {},
        "// Rattata": {
            "always_release": true
        },
        "// Example of keeping 3 stronger (based on CP) Pidgey:": {},
        "// Pidgey": {
            "keep_best_cp": 3
        },
        "// Example of keeping 2 stronger (based on IV) Zubat:": {},
        "// Zubat": {
            "keep_best_cp": 2,
            "keep_best_iv": 3
        },
        "// Also, it is working with any": {},
        "// any": {
            "keep_best_iv": 3
        },
        "// Example of keeping the 2 strongest (based on CP) and 3 best (based on IV) Zubat:": {}
    },
    "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": {}
    }
}

This is where it stops:

2016-08-07 23:29:15,497 [TransferPokemon] [INFO] [keep_best_release] Keeping best 3 Cubone, based on cp and iv
2016-08-07 23:29:15,497 [TransferPokemon] [INFO] [keep_best_release] Keeping best 2 Rhydon, based on cp and iv
2016-08-07 23:29:16,082 [       cli] [INFO]
2016-08-07 23:29:16,082 [       cli] [INFO] Ran for 0:59:51
2016-08-07 23:29:16,082 [       cli] [INFO] Total XP Earned: 18890  Average: 18938.59/h
2016-08-07 23:29:16,082 [       cli] [INFO] Travelled 2.77km
2016-08-07 23:29:16,082 [       cli] [INFO] Visited 61 stops
2016-08-07 23:29:16,082 [       cli] [INFO] Encountered 69 pokemon, 69 caught, 69 released, 1 evolved, 1 never seen before
2016-08-07 23:29:16,082 [       cli] [INFO] Threw 70 pokeballs
2016-08-07 23:29:16,082 [       cli] [INFO] Earned 7300 Stardust
2016-08-07 23:29:16,082 [       cli] [INFO]
2016-08-07 23:29:16,082 [       cli] [INFO] Highest CP Pokemon: Growlithe [CP: 897] [IV: 11/12/9] Potential: 0.71
2016-08-07 23:29:16,082 [       cli] [INFO] Most Perfect Pokemon: Cubone [CP: 103] [IV: 14/12/14] Potential: 0.89
Traceback (most recent call last):
  File "pokecli.py", line 501, in <module>
    main()
  File "pokecli.py", line 132, in main
    raise e
TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)
2016-08-07 23:29:16,092 [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 "/Users/jannickvandaele/Sites/prive/pb2/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/Users/jannickvandaele/Sites/prive/pb2/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/Users/jannickvandaele/Sites/prive/pb2/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/jannickvandaele/Sites/prive/pb2/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
  File "/Users/jannickvandaele/Sites/prive/pb2/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
  File "/Users/jannickvandaele/Sites/prive/pb2/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
  File "/Users/jannickvandaele/Sites/prive/pb2/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/Users/jannickvandaele/Sites/prive/pb2/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 "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request
    self._send_request(method, url, body, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request
    self.endheaders(body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders
    self._send_output(message_body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 891, in _send_output
    msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128)
2016-08-07 23:29:16,095 [sentry.errors.uncaught] [ERROR] [u"TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)", u'  File "pokecli.py", line 501, in <module>', u'  File "pokecli.py", line 132, in main']

jnnck avatar Aug 07 '16 23:08 jnnck

This is not related to evolution since evolutions are happening the entire time.

pranavperfect avatar Aug 08 '16 00:08 pranavperfect

Still a valid issue. Any solution? @solderzzc

@daolf did it continue running after setting evolve as none?

pranavperfect avatar Aug 09 '16 08:08 pranavperfect

After setting evolve as "none" it did run correctly.

daolf avatar Aug 09 '16 08:08 daolf

@daolf For how long? Estimated?

pranavperfect avatar Aug 09 '16 08:08 pranavperfect

@pranavperfect Yesterday it did not run long because of an unrelated morning bug. However it is currently running and I'll keep this updated if the bug is still here or not. But yesterday I was able to have it running at least 3 hours.

daolf avatar Aug 09 '16 08:08 daolf

@daolf Thanks!

pranavperfect avatar Aug 09 '16 08:08 pranavperfect

@pranavperfect Quick update, putting "none", (lowercase) for Evolve_Pokemon.config.evolve_all 'fix' this issue. Bot still running after 2hours. Was testing on : d42082349736c836

daolf avatar Aug 09 '16 10:08 daolf

update to latest dev and upgrade pip packages

eriweb avatar Aug 09 '16 13:08 eriweb