Tustin / psn-php

A PHP wrapper for the PSN API
https://tustin.dev/psn-php/
MIT License
358 stars 74 forks source link

Fatal error since yesterday. #219

Closed Reuns closed 2 years ago

Reuns commented 2 years ago

Hi Since 2022-10-18 17:20 I'm unable to get information from Sony's servers. It worked well at untill 17:15 then ...

Fatal error: Uncaught Tustin\Haste\Exception\AccessDeniedHttpException in [...]vendor/tustin/haste/src/Http/Middleware/ResponseHandlerMiddleware.php:62
Stack trace:
#0 [...]vendor/tustin/haste/src/Http/Middleware/ResponseHandlerMiddleware.php(32): Tustin\Haste\Http\Middleware\ResponseHandlerMiddleware->handleErrorResponse()
#1 [...]vendor/guzzlehttp/promises/src/FulfilledPromise.php(41): Tustin\Haste\Http\Middleware\ResponseHandlerMiddleware->__invoke()
#2 [...]vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise\{closure}()
#3 [...]vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run()
#4 [...]vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#5 [...]vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#6 [...]vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#7 [...]vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#8 [...]vendor/guzzlehttp/guzzle/src/Client.php(187): GuzzleHttp\Promise\Promise->wait()
#9 [...]vendor/guzzlehttp/guzzle/src/ClientTrait.php(95): GuzzleHttp\Client->request()
#10 [...]vendor/tustin/haste/src/Http/HttpClient.php(52): GuzzleHttp\Client->post()
#11 [...]vendor/tustin/psn-php/src/Client.php(134): Tustin\Haste\Http\HttpClient->post()
#12 [...]psnApi/psnapi.class.php(46): Tustin\PlayStation\Client->loginWithRefreshToken()
...
  thrown in [...]vendor/tustin/haste/src/Http/Middleware/ResponseHandlerMiddleware.php on line 62

I've tried to reset my NPSSO but still .... it remains !

Am I the only one in this case. I didn't change anything for month and it has always work fine. An update from Sony maybe ? Thanks for your help.

Strategeru commented 2 years ago

Looks like Sony set some limitation on https://m.np.playstation.net/ it now gives Access Denied on any request from any IPs.

Strategeru commented 2 years ago

Ok.

The base URL for accessing the API was https://m.np.playstation.net/api/trophy

Now it appears as https://m.np.playstation.com/api/trophy

So if you change url in files in should work again.

Ragowit commented 2 years ago

Yeah, this was fixed yesterday with commit 16032a352b78057bbda03bf956167003570d4cc2

Reuns commented 2 years ago

Thanks all ... still I'm not familiar with the composer thing. I've updated with "composer update --ignore-platform-reqs" but the issue remains.

I tried to uninstall it and install it again but I might be doing something wrong. If i tried to install "composer require tustin/psn-php" it'll install v2 which doesn't work anymore. I've installed it with "composer require tustin/psn-php:3.0" but the issue remain.

Is there anything I'm doing wrong @Ragowit ? Thanks for your help.

Ragowit commented 2 years ago

@reuns Try this:

composer require --dev tustin/psn-php:master

Reuns commented 2 years ago

Thanks @Ragowit

I have this msg :

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires tustin/psn-php master, found tustin/psn-php[dev-master] but it does not match your minimum-stability.

Do you know what it means ?

Ragowit commented 2 years ago

Yeah, it didn't find master but dev-master, try this then.

composer require --dev tustin/psn-php:dev-master

Reuns commented 2 years ago

Nice. Thank you @Ragowit ! You're awesome.

Tustin commented 2 years ago

I just created a new release (3.0.1) that resolves this issue and won't require you to reference the master branch 😄 . It should be published on Packagist shortly