istornz / iPokeGo

A native iOS client to map the Pokemon around you!
https://github.com/RocketMap/RocketMap
MIT License
643 stars 173 forks source link

Connecting to PokemonGoMap fails, Something changed? #323

Closed TheNewDarkOne closed 7 years ago

TheNewDarkOne commented 7 years ago

Been a while since i ran this app and server, and i've updated both so not sure which update broke it, but now Any time ipokego tries to pull from webhook it throws error in ptyhon

[2016-09-18 12:17:07,679] ERROR in app: Exception on /raw_data [GET] Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request return self.view_functionsrule.endpoint File "/root/PokemonGo-Map/pogom/app.py", line 92, in raw_data d['pokemons'] = Pokemon.get_active(swLat, swLng, neLat, neLng) File "/root/PokemonGo-Map/pogom/models.py", line 111, in get_active for p in query: File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2967, in iter return iter(self.execute()) File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2960, in execute self._qr = ResultWrapper(model_class, self._execute(), query_meta) File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2656, in _execute return self.database.execute_sql(sql, params, self.require_commit) File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 3492, in execute_sql self.commit() File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 3316, in exit reraise(new_type, new_type(*exc_args), traceback) File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 3485, in execute_sql cursor.execute(sql, params or ()) OperationalError: database is locked

2016-09-18 12:17:26,140 [ Thread-188][ runserver][ ERROR] Uncaught exception Traceback (most recent call last): File "runserver.py", line 75, in run run_old(_args, *_kwargs) File "/usr/lib/python2.7/threading.py", line 763, in run self.*target(_self.__args, _self.kwargs) File "/usr/lib/python2.7/SocketServer.py", line 602, in process_request_thread self.handle_error(request, client_address) File "/usr/lib/python2.7/SocketServer.py", line 599, in process_request_thread self.finish_request(request, client_address) File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python2.7/SocketServer.py", line 657, in init** self.finish() File "/usr/lib/python2.7/SocketServer.py", line 716, in finish self.wfile.close() File "/usr/lib/python2.7/socket.py", line 279, in close self.flush() File "/usr/lib/python2.7/socket.py", line 303, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 32] Broken pipe

And some other errors too.

cyan commented 7 years ago

solve your flask problem first by setting the db-maxconnection and db-threads and it should be great (it's not a ipokego bug)

TheNewDarkOne commented 7 years ago

Set them to what? using 8 workers. standard scan for mapping spawnpoints and ss otherwise. I leave those values blank because i thought defaults were automatically chosen, at least for workers (each gets it's own thread).

I've always just run this

python runserver.py -a ptc -u account1 -u account2 -u account3 -u account4 -u account5 -u account6 -u account7 -u account8 -p password -st 11 -sd 10 -k key -l number, number -j -ng -nk -H 0.0.0.0 -P 5123

TheNewDarkOne commented 7 years ago

Setting those variables didn't fix anything. As soon as ipokego tries to access web hook the database locks up and starts throwing mass errors. regardless of db-maxconnection and db-threads (tried increasing and decreasing)

I haven't ruled out it's just flat out a new bug in pokemongo map. it probably is. Ever since they got all crazy with database cleanup and new threading it's been very fickle. Maybe I should try to disable database clean to see if that stabilizes things.

EDIT, note, disabling clean doesn't help either. Just seems like with a large amount of spawn points that using anything other than web interface is a lost cause :\ The database locks up the instant ipoke tries to connect to webhook and the errors start (before ipoke itself crashes from the responses)

And this is on a dedicated server with nothing else running on it and ample resources. the server shouldn't be bottleneck.

TheNewDarkOne commented 7 years ago

Further digging it seems the ONLY fix is https://github.com/PokemonGoMap/PokemonGo-Map/issues/1134

sqlite just can't handle my database now that it's larger.

TheNewDarkOne commented 7 years ago

wasn't able to figure out how to convert database and set it up so I may just have to axe using ipokego until PokemonGoMap itself supports a better more robust database by default that has easy setup instructions. :\

cyan commented 7 years ago

I ve set the db max connection to 300 and the db thread to 10 and it work fine