Error on updateInventories
The program throws an exception when your itembag has more items than it can has. It happens when you have the full inventory and then get next level, the level up bonus will give you more items than your itembag can carry and the next try to update will thrown this exception
com.pokegoapi.exceptions.RemoteServerException: com.google.protobuf.InvalidProtocolBufferException: Contents of buffer are null
read the other issues. niantic api has changed so it needs to wait for this to be fixed
Niantic api hasnt changed. The PokemonGo servers arent working thats it. This exception is thrown when we cant parse a response from the server.
@vmarchaud did you tried to reproduce it? i didn't debug yet as i really dont understand the protobuf data, but this situation is pretty common i think and the oficial app can deal with it
so probably the parse method has some bug, maybe a fixed value for max amount of data received... and as the parser was automatically generated i would not doubt about it
@bolds07 i understand your question, we got error like these 1 weeks ago non-stop when the servers werent doing up/down every minutes, the issue isnt that api has changed.
Everyone should alway wait few hours before making issue to see if it persist or not, since the official server arent stable.
PS : complete stacktrace are always better than only one line.
@vmarchaud for sure a parser exception is thrown in several situations, but i'm describing here a example that it souldn't
I took several time to realize the error problem and reproduce it, so i'm sure this wasn't a server issue
PS. I will take one hour to re-create the situation, but i come back =D
I just tested this. When I had 400 items in my inventory (my limit is 350) I kept getting the error. But than I logged in with a mobile phone and deleted some items to go below the limit and than the API worked fine.
This is an issue!
Here is the stack trace:
com.pokegoapi.exceptions.RemoteServerException: com.google.protobuf.InvalidProtocolBufferException: Contents of buffer are null
at com.pokegoapi.api.inventory.Inventories.updateInventories(Inventories.java:114)
at com.pokegoapi.api.inventory.Inventories.updateInventories(Inventories.java:84)
at com.pokegoapi.api.inventory.Inventories.
There isnt any limit of item that the response can contains, it should parse without problem. I cant test it now though.
Maybe Niantic sends a different response when there are more items than there should be?
@hmate9 You cant send other response apart those described in proto file, and if you think niantic changed it, nope, they didnt update the app so the protos hasnt changed.
@vmarchaud I just checked with a python API and they throw an error when the number of items is greater also. There is definitely something going on here, however I am completely foreign to protobuf.
@hmate9 can you link the line of the file that you are talking about ? cause they cant know the size of the item inventory without parsing the response ;)
@vmarchaud I don't mean that they throw an error BEFOREHAND. They throw an error as they are using the API to get the items.
ile "/Users/matehegedus/Downloads/pokebot/pokemongo_bot/init.py", line 31, in start self._setup_api() File "/Users/matehegedus/Downloads/pokebot/pokemongo_bot/init.py", line 159, in _setup_api balls_stock = self.pokeball_inventory() File "/Users/matehegedus/Downloads/pokebot/pokemongo_bot/init.py", line 234, in pokeball_inventory inventory_dict = inventory_req['responses']['GET_INVENTORY'][ KeyError: 'GET_INVENTORY'
Yeah but the problem is that we cant get the actual response, how could we send an exception if we dont have any data ? btw working on something else to see if its what i think.
Okay so from what i saw, Niantic introduced a trottle to avoid being spammed with request, since you are spamming request on the login, we are getting instant throttled, working on a fix.
@vmarchaud Nice find!
I am also getting errors pointing to the updateInventories() method call. Apparently its returning "undefined" which kicks out the error everyone is getting.
Not sure why this started happening all of a sudden?
As i said, niantic introduced a rate-limit that we were breaking when we construct the PokemonGo instance, should be fixed in #328
!! PLEASE UPDATE YOUR PROJECT WITH THE LATEST BUILD !!
Awesome, now it logs in no problem. I think it would be cool to have this Java API automatically enforce a limit.
@hmate9 It would be cool yeah, but we'll to almost rewrite all the core architecture of the api, we'll discuting it tomorrow with all maintainers to see how we could do that.