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

Bot crashes after a few hours of uptime

Open AdaptCharm opened this issue 10 years ago • 29 comments

Expected Behavior

The bot shouldn't crash at all. It should be stable and run 24/7 without crashes.

Actual Behavior

The bot crashes after a few hours uptime. It's crashing at different times. Sometimes 30 mins, 2 hours, etc etc.

http://m.imgur.com/rZ0Z2D5

Steps to Reproduce

Use the latest version and run the bot.

Other Information

OS: Ubuntu 14.04 Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here) 3aca6d798f8a3e173dce0beb7b13c9505cc5b251

AdaptCharm avatar Jul 26 '16 08:07 AdaptCharm

+1 I have same exception:

Traceback (most recent call last):
  File "./pokecli.py", line 220, in <module>
    main()
  File "./pokecli.py", line 211, in main
    bot.take_step()
  File "/home/server/PokemonGo-Bot/pokemongo_bot/__init__.py", line 36, in take_step
    self.stepper.take_step()
  File "/home/server/PokemonGo-Bot/pokemongo_bot/stepper.py", line 62, in take_step
    self._work_at_position(position[0], position[1], position[2], True)
  File "/home/server/PokemonGo-Bot/pokemongo_bot/stepper.py", line 139, in _work_at_position
    self.bot.work_on_cell(cell, position, pokemon_only)
  File "/home/server/PokemonGo-Bot/pokemongo_bot/__init__.py", line 93, in work_on_cell
    worker.work()
  File "/home/server/PokemonGo-Bot/pokemongo_bot/cell_workers/move_to_fort_worker.py", line 30, in work
    self.stepper._walk_to(self.config.walk, *position)
  File "/home/server/PokemonGo-Bot/pokemongo_bot/stepper.py", line 88, in _walk_to
    alt, False)
  File "/home/server/PokemonGo-Bot/pokemongo_bot/stepper.py", line 102, in _work_at_position
    response_dict = self.api.call()
  File "/home/server/PokemonGo-Bot/src/pgoapi/pgoapi/pgoapi.py", line 81, in call
    response = request.request(api_endpoint, self._req_method_list, player_position)
  File "/home/server/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 98, in request
    raise NotLoggedInException()
pgoapi.exceptions.NotLoggedInException

MeGaPk avatar Jul 26 '16 09:07 MeGaPk

+1 Same here as well

[2016-07-26 21:02:40] [x] Using Pokeball (chance: 47.34%)... (55 left!) [2016-07-26 21:02:42] [x] Captured Pidgey! [CP 155] [IV 0.29] [2016-07-26 21:02:44] [#] Pidgey has been exchanged for candy! Traceback (most recent call last): File "pokecli.py", line 220, in main() File "pokecli.py", line 211, in main bot.take_step() File "C:\Python27\Download\PokemonGo-Bot\pokemongo_bot__init__.py", line 36, in take_step self.stepper.take_step() File "C:\Python27\Download\PokemonGo-Bot\pokemongo_bot\stepper.py", line 62, in take_step self.work_at_position(position[0], position[1], position[2], True) File "C:\Python27\Download\PokemonGo-Bot\pokemongo_bot\stepper.py", line 139, in work_at_position self.bot.work_on_cell(cell, position, pokemon_only) File "C:\Python27\Download\PokemonGo-Bot\pokemongo_bot__init.py", line 93, in work_on_cell worker.work() File "C:\Python27\Download\PokemonGo-Bot\pokemongo_bot\cell_workers\move_to_fort_worker.py", line 30, in work self.stepper._walk_to(self.config.walk, *position) File "C:\Python27\Download\PokemonGo-Bot\pokemongo_bot\stepper.py", line 88, in _walk_to alt, False) File "C:\Python27\Download\PokemonGo-Bot\pokemongo_bot\stepper.py", line 102, in _work_at_position response_dict = self.api.call() File "c:\python27\download\pokemongo-bot\src\pgoapi\pgoapi\pgoapi.py", line 81, in call response = request.request(api_endpoint, self._req_method_list, player_position) File "c:\python27\download\pokemongo-bot\src\pgoapi\pgoapi\rpc_api.py", line 98, in request raise NotLoggedInException() pgoapi.exceptions.NotLoggedInException

ghost avatar Jul 26 '16 09:07 ghost

Temp fix: Just make bash script (if linux or mac):

#!/bin/bash
while true
do
  ./pokecli.py
  echo ">pokecli exited... restarting...";
  sleep 5;
done

And fixed :D

MeGaPk avatar Jul 26 '16 09:07 MeGaPk

Excuse me, what bash script?

Just input that in terminal every time before running, right?

xiejiachen avatar Jul 26 '16 09:07 xiejiachen

Create file "start.sh" put this:

#!/bin/bash
while true
do
  ./pokecli.py
  echo ">pokecli exited... restarting...";
  sleep 5;
done

and in terminal:

chmod u+x start.sh
./start.sh

MeGaPk avatar Jul 26 '16 09:07 MeGaPk

Should I type ''' chmod u+x start.sh ./start.sh ''' Every time before I run it?

xiejiachen avatar Jul 26 '16 09:07 xiejiachen

Same issue. What to do ?

leovarmak avatar Jul 26 '16 09:07 leovarmak

same here :") what should i do in win10 ?

ReqMid avatar Jul 26 '16 10:07 ReqMid

So... Because pokecli.py have exception and he dropped. I recommend use "auto restart" script, for now.

So, for linux or mac you need create file in folder, where you have pokecli.py, for example start.sh with this data:

#!/bin/bash
while true
do
  ./pokecli.py
  echo ">pokecli exited... restarting...";
  sleep 5;
done

Okay, now need give permission for this file from terminal / console:

chmod u+x start.sh

And next time, you need start only

./start.sh

For windows, you need create file in folder where "pokecli.py" with name, for example start.bat with this data:

@echo off
:begin
python2 pokecli.py
goto begin

and start, your file "start.bat".

MeGaPk avatar Jul 26 '16 10:07 MeGaPk

duplicate of #906

ironbishop avatar Jul 26 '16 11:07 ironbishop

@MeGaPk I get this error on LInux -bash: ./start.sh: /bin/bash^M: bad interpreter: No such file or directory

leovarmak avatar Jul 27 '16 06:07 leovarmak

@leovarmak You have unknown symbols in first line your file. Try delete and write manually this line, or: install dos2unix program and dos2unix start.sh

MeGaPk avatar Jul 27 '16 06:07 MeGaPk

@MeGaPk will try and let you know

leovarmak avatar Jul 27 '16 06:07 leovarmak

@MeGaPk The bot runs just fine when started with python pokecli.py or ./pokecli.py but only when using the shell script to run the application do I get an import error saying there's no module named google maps. Any idea why this would be happening?

castiliad avatar Jul 27 '16 07:07 castiliad

@castiliad strange... can you show here your script?

MeGaPk avatar Jul 27 '16 07:07 MeGaPk

@MeGaPk

#!/bin/bash
while true do python pokecli.py echo ">Bot crashed. Restarting..."; sleep 5; done

I've tried using ./pokecli.py instead of python pokecli.py as well

castiliad avatar Jul 27 '16 07:07 castiliad

@castiliad strange, no have idea... Maybe you write to my skype: ivan6335523, i can help from team viewer or etc?

MeGaPk avatar Jul 27 '16 07:07 MeGaPk

@MeGaPk I had multiple terminal windows opened and I just tested the script in a different terminal session and it worked just fine now. I'm not sure what happened or why it would do that. Thanks for your help though.

castiliad avatar Jul 27 '16 07:07 castiliad

Pokecli.py seems to crash every hour or so, I use Windows 10 I will be greatful if anyone can help me.

dorbenshimol avatar Jul 27 '16 12:07 dorbenshimol

@dorbenshimol read my comments in this topic. I have for windows solution too.

MeGaPk avatar Jul 27 '16 12:07 MeGaPk