Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending messages stopped working #5

Closed
dandelaney8 opened this issue Aug 21, 2016 · 8 comments
Closed

Sending messages stopped working #5

dandelaney8 opened this issue Aug 21, 2016 · 8 comments
Labels

Comments

@dandelaney8
Copy link

Hello there,

My company hired a developer to build out an application that uses your repo to send PSN messages. It was working nicely, and then out of nowhere about 2 weeks ago it stopped functioning properly, and messages are not going out anymore. Would you have any insight into why this might have happened?

We heard that Sony may have started using a Captcha when users are logging in, and that might have messed with our account - but we haven't seen one when trying to log in using the PSN phone app or the online site.

Thanks in advance for any help you can provide,
Dan Delaney

@tymanog
Copy link

tymanog commented Aug 21, 2016

Hello,
I've recently made something similar. To send messages to users. It is still working as of 4:50 PM 8/21/2016.
Known issues to cause this is a possible ban on the server, and or account. Have you tried using a different account? And or have you gotten any errors recently?

--edit--
Not sure if this is required, but when I did my test the account I made didn't sen either. Once I signed into a PS3/PS4 console it started to send. I believe accounts that you are using need to be signed into a console at least once before use!

Sincerely,
Tyman1294

@Tustin
Copy link
Owner

Tustin commented Aug 21, 2016

Sony will rate limit you if you try sending too many messages within a certain period of time. Although it does seem strange that it hasn't worked for 2 weeks, as the rate limiting should only last a few hours at the most. I haven't seen an update for the PS Messaging iOS app which makes it unlikely that they've changed anything with their requests. Might be worth asking the developer who made it or if you have access to the code you an email me a snippet of it and I can try to help out free of charge: tustin@nextgenupdate.com

@djekl
Copy link

djekl commented Aug 22, 2016

What @dandelaney8 hasn't mentioned is that this is only a local issue. I was the dev who wrote the code, and if I load the code on my server, or vagrant box it works fine, no issues. And yes this is with the same account. However on the production server (that was working) is no longer. A new ToS was issued just before the problem arrised, I resolved my testing account by accepting it, however I couldn't see one for Dan's account. I also noticed in your code (sorry cant ref file/line as on mobile) that you set a value for login using a cookie, however as this is designed to be ran in the background this would never be set in a browser, maybe this is the issue? Potentially use a tmp file for it?

@djekl
Copy link

djekl commented Aug 22, 2016

This is the line I was trying to refer to with regards to the cookie being set - https://github.com/Tustin/psn-php/blob/master/include/auth.php#L130

@dandelaney8
Copy link
Author

An update:

We have tried using a new account, and made sure that we logged in with it on the PS4 console. Successfully sent messages through the console and using the iOS App, but it still doesn't work with the code.

However, I found the following errors in our logs that might be able to help figure out the issue:

[2016-08-21 22:10:01] local.ERROR: exception 'ErrorException' with message 'Undefined index: X-NP-GRANT-CODE' in /var/www/messaging/vendor/Tustin/psn-php/include/auth.php:92
Stack trace:
#0 /var/www/messaging/vendor/Tustin/psn-php/include/auth.php(92): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined index...', '/var/www/messag...', 92, Array)
#1 /var/www/messaging/vendor/Tustin/psn-php/include/auth.php(61): PSN\Auth->GrabCode()
#2 /var/www/messaging/app/PsnAPI.php(54): PSN\Auth->__construct('psn2@playerslou...', 'nvK791qeJIeH')
#3 /var/www/messaging/app/PsnAPI.php(41): App\PsnAPI->initLogin()
#4 /var/www/messaging/app/Console/Commands/SendPsnScheduledMessage.php(59): App\PsnAPI->sendMessage('', Object(App\Message), Object(App\Recipient))
#5 [internal function]: App\Console\Commands\SendPsnScheduledMessage->handle()
#6 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#7 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#8 /var/www/messaging/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\Con
soleOutput))
#9 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony
Component\Console\Output\ConsoleOutput))
#10 /var/www/messaging/vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOut
put))
#11 /var/www/messaging/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\SendPsnScheduledMessage), Object(Symfony\Component\Co
nsole\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/messaging/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Outp
ut\ConsoleOutput))
#13 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(S
ymfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/messaging/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 {main}

[2016-08-22 17:45:02] local.ERROR: exception 'ErrorException' with message 'First parameter must either be an object or the name of an existing class' in /var/www/messaging/vendor/Tustin/psn-php/include/auth.php:116
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'First parameter...', '/var/www/messag...', 116, Array)
#1 /var/www/messaging/vendor/Tustin/psn-php/include/auth.php(116): property_exists(NULL, 'error')
#2 /var/www/messaging/vendor/Tustin/psn-php/include/auth.php(61): PSN\Auth->GrabOAuth()
#3 /var/www/messaging/app/PsnAPI.php(54): PSN\Auth->__construct('psn2@playerslou...', 'nvK791qeJIeH')
#4 /var/www/messaging/app/PsnAPI.php(41): App\PsnAPI->initLogin()
#5 /var/www/messaging/app/Console/Commands/SendPsnScheduledMessage.php(59): App\PsnAPI->sendMessage('', Object(App\Message), Object(App\Recipient))
#6 [internal function]: App\Console\Commands\SendPsnScheduledMessage->handle()
#7 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#8 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#9 /var/www/messaging/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/messaging/vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/messaging/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\SendPsnScheduledMessage), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/messaging/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/messaging/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 {main}

[2016-08-22 18:45:01] local.ERROR: exception 'ErrorException' with message 'First parameter must either be an object or the name of an existing class' in /var/www/messaging/vendor/Tustin/psn-php/include/auth.php:164
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'First parameter...', '/var/www/messag...', 164, Array)
#1 /var/www/messaging/vendor/Tustin/psn-php/include/auth.php(164): property_exists(NULL, 'error')
#2 /var/www/messaging/vendor/Tustin/psn-php/include/auth.php(61): PSN\Auth->GrabNPSSO()
#3 /var/www/messaging/app/PsnAPI.php(54): PSN\Auth->__construct('psn-pl@playersl...', 'IeTb6xYO9QVx')
#4 /var/www/messaging/app/PsnAPI.php(41): App\PsnAPI->initLogin()
#5 /var/www/messaging/app/Console/Commands/SendPsnScheduledMessage.php(59): App\PsnAPI->sendMessage('', Object(App\Message), Object(App\Recipient))
#6 [internal function]: App\Console\Commands\SendPsnScheduledMessage->handle()
#7 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#8 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#9 /var/www/messaging/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/messaging/vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/messaging/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\SendPsnScheduledMessage), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/messaging/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/messaging/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/messaging/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 {main}

Let me know if there's any other information I can provide.

Thanks,
Dan Delaney

@jbdabes
Copy link
Collaborator

jbdabes commented Aug 26, 2016

I'll look into the issue today and see if I can find a fix. Perhaps Sony has updated something on their API that we've missed.

@Octolus
Copy link
Collaborator

Octolus commented Sep 12, 2016

There are defiantly limitations, per hour. You would need multiply IP's, and accounts to perform this.

The captcha only appears if you use invalid login multiply times on an account..

@jbdabes
Copy link
Collaborator

jbdabes commented Sep 13, 2016

Closing this as their API is unchanged. Please raise a new issue if this problem returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants