NicklasWallgren / PokemonGoAPI-PHP

Pokemon Go API PHP library
BSD 2-Clause "Simplified" License
130 stars 51 forks source link

Uncaught Exception: Retrieved a unknown status code 100 #90

Closed ro1963855 closed 8 years ago

ro1963855 commented 8 years ago

when i called the $profile->getProfileData(), i get the error message like this http://imgur.com/HziXAMw, how can I fix it. Thanks!

lambasoft commented 8 years ago

Please can you show all your code.

ro1963855 commented 8 years ago

this is my code http://imgur.com/a/LRgp3.

ghost commented 8 years ago

@ro1963855 Can you please post whole error with stack trace ?

lambasoft commented 8 years ago

@ro1963855 Why do you have $profile->update() ? You don't need it there. And you're using it incorrectly thus causing the error. Please remove the line that contains $profile->update() and try again.

Try following this example: https://github.com/NicklasWallgren/PokemonGoAPI-PHP/blob/master/examples/RetrievePlayerProfile.php

ro1963855 commented 8 years ago

after i remove that line, error message became http://imgur.com/a/TBurB, and this is my code http://imgur.com/a/s9HqD

lambasoft commented 8 years ago

@ro1963855 Please make sure you're using the latest version of the API, do a composer update . And try logging in with your Pokemon account you're using, just to check account is not banned/working credentials.

NicklasWallgren commented 8 years ago

Have you logged in using the account before?

https://github.com/Grover-c13/POGOProtos/blob/f8b7600136060965ebfa5c39ee209be2d01037b2/src/POGOProtos/Enums/StatusCode.proto

// 10X seems to relate authentication, there is probably a banned status code in this series

DrDelay commented 8 years ago

Just an idea, if you have not logged in yet, I saw some discussion about automatic TOS accepting in keyphact/pgoapi, maybe this status code means TOS have not been accepted yet?

NicklasWallgren commented 8 years ago

I haven't been able to reproduce the 100 status code. I don't think it's related to TOS.

ro1963855 commented 8 years ago

I fixed this problem after I update PHP version from 5.6 to 7.0, thanks everybody for your help.

gracefullight commented 7 years ago

This problem also occurs in php7 environment.

$pokemonGoApi = $application->getPokemonGoApi(); $this->logger->info('get profile'); $profile = $pokemonGoApi->getProfile(); $this->logger->info('get data'); $profileData = $profile->getData(); // <= Error occurs

baskettcase commented 7 years ago

Yes I just started getting this problem also

Fatal error: Uncaught exception 'Exception' with message 'Retrieved a unknown status code 100' in /home/path/public_html/games/pokemongo/vendor/nicklasw/pkm-go-api/src/Handlers/RequestHandler.php:163 Stack trace: #0 /home/path/public_html/games/pokemongo/vendor/nicklasw/pkm-go-api/src/Services/Request/InventoryRequestService.php(27): NicklasW\PkmGoApi\Handlers\RequestHandler->handle(Object(NicklasW\PkmGoApi\Requests\GetInventoryRequest)) #1 /home/path/public_html/games/pokemongo/vendor/nicklasw/pkm-go-api/src/Api/Player/Inventory.php(69): NicklasW\PkmGoApi\Services\Request\InventoryRequestService->getInventory() #2 /home/path/public_html/games/pokemongo/vendor/nicklasw/pkm-go-api/src/Api/Procedure.php(52): NicklasW\PkmGoApi\Api\Player\Inventory->update() #3 /home/path/public_html/games/pokemongo/getiv.php(97): NicklasW\PkmGoApi\Api\Procedure->__call('getPokeBank', Array) #4 /home/path/public_html/games/pokemongo/getiv.php(97): NicklasW\PkmGoApi\Api\Player\Inventory->getPokeBank() #5 /home/path/public_ in /home/path/public_html/games/pokemongo/vendor/nicklasw/pkm-go-api/src/Handlers/RequestHandler.php on line 163

It was working up until Niantic changed something yesterday.

xmillies commented 7 years ago

With a stack ...

( ! ) Fatal error: Uncaught Exception: Retrieved a unknown status code 100 in C:\WTServer\WWW\pogo\vendor\nicklasw\pkm-go-api\src\Handlers\RequestHandler.php on line 163
( ! ) Exception: Retrieved a unknown status code 100 in C:\WTServer\WWW\pogo\vendor\nicklasw\pkm-go-api\src\Handlers\RequestHandler.php on line 163
Call Stack
#   Time    Memory  Function    Location
1   0.0050  369432  {main}( )   ...\update.php:0
2   0.0670  1874096 updateDataFromNiantic( )    ...\update.php:36
3   0.3520  2832688 NicklasW\PkmGoApi\Api\Procedure->getStats( )    ...\functions.php:730
4   0.3520  2832744 NicklasW\PkmGoApi\Api\Procedure->__call( )  ...\functions.php:730
5   0.3520  2832744 NicklasW\PkmGoApi\Api\Player\Inventory->update( )   ...\Procedure.php:52
6   0.3670  2842144 NicklasW\PkmGoApi\Services\Request\InventoryRequestService->getInventory( ) ...\Inventory.php:69
7   0.3860  2874304 NicklasW\PkmGoApi\Handlers\RequestHandler->handle( )    ...\InventoryRequestService.php:27

Steps 1 and 2 are my code.

gracefullight commented 7 years ago

Redirect to this issue