I have a background process sending email to me when specific event occur.
It's working most of the time (9 out of 10), but sometime I get the following error message :
PHP Warning 'yii\base\ErrorException' with message 'fwrite(): SSL: An established connection was aborted by the software in your host machine.'
in E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php:232
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'fwrite(): SSL: ...', 'E:\ProgramData\...', 232, Array)
#1 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php(232): fwrite(Resource id #481, 'MAIL FROM:<MTE#...')
#2 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\ByteStream\AbstractFilterableInputStream.php(171): Swift_Transport_StreamBuffer->_commit('MAIL FROM:<MTE#...')
#3 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\ByteStream\AbstractFilterableInputStream.php(90): Swift_ByteStream_AbstractFilterableInputStream->_doWrite('MAIL FROM:<MTE#...')
#4 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(276): Swift_ByteStream_AbstractFilterableInputStream->write('MAIL FROM:<MTE#...')
#5 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\EsmtpTransport.php(243): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM:<MTE#...', Array, Array)
#6 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\EsmtpTransport.php(322): Swift_Transport_EsmtpTransport->executeCommand('MAIL FROM:<MTE#...', Array)
#7 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(416): Swift_Transport_EsmtpTransport->_doMailFromCommand('MTE#...')
#8 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(444): Swift_Transport_AbstractSmtpTransport->_doMailTransaction(Object(Swift_Message), 'MTE#...', Array, Array)
#9 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(176): Swift_Transport_AbstractSmtpTransport->_sendTo(Object(Swift_Message), 'MTE#...', Array, Array)
#10 E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Mailer.php(85): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
#11 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2-swiftmailer\Mailer.php(146): Swift_Mailer->send(Object(Swift_Message))
#12 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\mail\BaseMailer.php(260): yii\swiftmailer\Mailer->sendMessage(Object(yii\swiftmailer\Message))
#13 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\mail\BaseMessage.php(48): yii\mail\BaseMailer->send(Object(yii\swiftmailer\Message))
#14 E:\ProgramData\htdocs\Yii2_KB\controllers\BackgroundTask.php(172): yii\mail\BaseMessage->send()
#15 E:\ProgramData\htdocs\Yii2_KB\vendor\bazilio\yii2-async\commands\AsyncWorkerCommand.php(29): app\controllers\BackgroundTask->execute()
#16 [internal function]: bazilio\async\commands\AsyncWorkerCommand->actionDaemon('background')
#17 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\base\InlineAction.php(55): call_user_func_array(Array, Array)
#18 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\base\Controller.php(151): yii\base\InlineAction->runWithParams(Array)
#19 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\console\Controller.php(91): yii\base\Controller->runAction('daemon', Array)
#20 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\base\Module.php(455): yii\console\Controller->runAction('daemon', Array)
#21 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\console\Application.php(167): yii\base\Module->runAction('async-worker/da...', Array)
#22 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\console\Application.php(143): yii\console\Application->runAction('async-worker/da...', Array)
#23 E:\ProgramData\htdocs\Yii2_KB\vendor\yiisoft\yii2\base\Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))
#24 E:\ProgramData\htdocs\Yii2_KB\yii(23): yii\base\Application->run()
#25 {main}
PHP Warning: fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry in E:\ProgramData\htdocs\Yii2_KB\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php on line 232
Here follow my configuration for the mailer :
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'x.x.x.xxx',
'username' => 'xxx',
'password' => 'XyXyXy',
'port' => '25',
'encryption' => 'tls',
],
],
I'm using Yii 2.0.6
PHP Version : 5.5.9
Mail server : Exchange Server 2010
When it fail, it's mostly after a period of inactivity between 2 events ( a few hours).
Any ideas ?
Thanks to ineersa for the tips.
I've added the following code in the beginning of the background process, and now it's working.
if (Yii::$app->mailer->getTransport()->isStarted()) {
Yii::$app->mailer->getTransport()->stop();
}
Yii::$app->mailer->getTransport()->start();
Related
Fatal error: Uncaught Error: Call to a member function get_setting() on string in C:\xampp\htdocs\wp\wp-includes\class-wp-customize-control.php:237 Stack trace: #0 C:\xampp\htdocs\wp\wp-includes\customize\class-wp-customize-media-control.php(57): WP_Customize_Control->_construct('$wp_customize', 'wp_logo_change...', Array) #1 C:\xampp\htdocs\wp\wp-content\themes\wordpress\functions.php(36): WP_Customize_Media_Control->_construct('$wp_customize', 'wp_logo_change...', Array) #2 C:\xampp\htdocs\wp\wp-includes\class-wp-hook.php(303): WordPress_customizer_register(Object(WP_Customize_Manager)) #3 C:\xampp\htdocs\wp\wp-includes\class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #4 C:\xampp\htdocs\wp\wp-includes\plugin.php(470): WP_Hook->do_action(Array) #5 C:\xampp\htdocs\wp\wp-includes\class-wp-customize-manager.php(933): do_action('customize_regis...', Object(WP_Customize_Manager)) #6 C:\xampp\htdocs\wp\wp-includes\class-wp-hook.php(303): WP_Customize_Manager->wp_loaded('') #7 C:\xampp\htdocs\wp\wp-includes\class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #8 C:\xampp\htdocs\wp\wp-includes\plugin.php(470): WP_Hook->do_action(Array) #9 C:\xampp\htdocs\wp\wp-settings.php(600): do_action('wp_loaded') #10 C:\xampp\htdocs\wp\wp-config.php(96): require_once('C:\xampp\htdocs...') #11 C:\xampp\htdocs\wp\wp-load.php(50): require_once('C:\xampp\htdocs...') #12 C:\xampp\htdocs\wp\wp-admin\admin.php(34): require_once('C:\xampp\htdocs...') #13 C:\xampp\htdocs\wp\wp-admin\customize.php(13): require_once('C:\xampp\htdocs...') #14 {main} thrown in C:\xampp\htdocs\wp\wp-includes\class-wp-customize-control.php on line 237
enter image description here
i am using xampp and get this error .....How can i fix this error.
my code is right below
function WordPress_customizer_register( $wp_customize){
$wp_customize-> add_section('wp_header_area',array(
'title' =>__('Header Area','sajjadalam'),
'description' => 'If you need to update your LOGO,you can change.It is easy',
));
$wp_customize->add_setting('wp_logo_change_setting',array(
'default' => get_bloginfo('template_directory').'/img/logo.png',
));
$wp_customize->add_control(new WP_Customize_Image_Control('$wp_customize','wp_logo_change_setting',array(
'label'=> 'Logo Change',
'setting' => 'wp_logo_change_setting',
'section' => 'wp_header_area',
) ));
}
add_action('customize_register', 'WordPress_customizer_register');
I'm trying to put/get an s3 object using Yii 1.1.22 and AWS PHP v3 , and when I try to upload an image to s3 I'm getting below error :
include(php.php): failed to open stream: No such file or directory
stack trace
[error] [php] include(php.php): failed to open stream: No such file or directory (/xxxx/framework/yii/framework/YiiBase.php:463)
yii stack trace:
#0 unknown(0): spl_autoload_call()
#1 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(151): method_exists()
#2 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(113): GuzzleHttp\Promise\Promise->settle()
#3 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(203): GuzzleHttp\Promise\Promise->resolve()
#4 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(156): callHandler()
#5 /xxxx/vendors/aws/GuzzleHttp/Promise/TaskQueue.php(47): GuzzleHttp\Promise\{closure}()
#6 /xxxx/vendors/aws/GuzzleHttp/Handler/CurlMultiHandler.php(96): GuzzleHttp\Promise\TaskQueue->run()
#7 /xxxx/vendors/aws/GuzzleHttp/Handler/CurlMultiHandler.php(123): GuzzleHttp\Handler\CurlMultiHandler->tick()
#8 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(246): GuzzleHttp\Handler\CurlMultiHandler->execute()
#9 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#10 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#11 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#12 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#13 /xxxx/vendors/aws/GuzzleHttp/Promise/Coroutine.php(65): GuzzleHttp\Promise\Promise->wait()
#14 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(246): GuzzleHttp\Promise\Coroutine->GuzzleHttp\Promise\{closure}()
#15 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#16 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#17 /xxxx/vendors/aws/GuzzleHttp/Promise/Coroutine.php(85): GuzzleHttp\Promise\Promise->wait()
#18 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(273): GuzzleHttp\Promise\Coroutine->wait()
#19 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#20 /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#21 /xxxx/vendors/aws/Aws/AwsClientTrait.php(59): GuzzleHttp\Promise\Promise->wait()
#22 /xxxx/vendors/aws/Aws/AwsClientTrait.php(78): Aws\S3\S3Client->execute()
#23 /xxxx/protected/extensions/s3/ES3.php(125): Aws\S3\S3Client->__call()
#24 /xxxx/protected/components/Uploader.php(97): ES3->upload()
#25 /xxxx/protected/modules/account/controllers/UserController.php(619): Uploader->upload()
#26 /xxxx/protected/modules/account/controllers/UserController.php(411): UserController->saveUser()
#27 /xxxx/framework/yii/framework/web/actions/CInlineAction.php(49): UserController->actionEditUser()
#28 /xxxx/framework/yii/framework/web/CController.php(308): CInlineAction->runWithParams()
#29 /xxxx/framework/yii/framework/web/CController.php(286): UserController->runAction()
#30 /xxxx/framework/yii/framework/web/CController.php(265): UserController->runActionWithFilters()
#31 /xxxx/framework/yii/framework/web/CWebApplication.php(282): UserController->run()
#32 /xxxx/framework/yii/framework/web/CWebApplication.php(141): CWebApplication->runController()
#33 /xxxx/framework/yii/framework/base/CApplication.php(185): CWebApplication->processRequest()
#34 /xxxx/index.php(36): CWebApplication->run()
REQUEST_URI=/_pfpg_CVWaHvEhl-5MEij5PiF9oCmnFPK6yNHIX7sqetYnfGY_vcsum=b4b2ef23eeb23074c51a8c6631b491861541198cd0ea11492713cb2cd6bfce10
in /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php (151)
in /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php (113)
in /xxxx/vendors/aws/GuzzleHttp/Promise/Promise.php (203)
I'm using below code to upload :
$result = $s3->putObject([
'Bucket' => '',
'Key' => 'ogo_1070.png ',
]);
and my s3 config is :
$arrS3Config = [
'region' => ( getenv('APPLICATION_ENV') == 'dr' ) ? 'eu-central-1' : 'us-east-1',
'version' => '2006-03-01',
];
Can any one help me how trace this error at least
Thanks
I have a project that's setup with Laravel and Redis Queues. The application is configured to send push notifications when it receives a message. As soon as message is received, it's stored in the DB and a push is generated:
dispatch(new CreateMessageNotification($message));
Project is using Redis queue and Service Provider. The problem is that queue dispatch doesn't work if we don't execute the following command:
php artisan queue:work redis --daemon
However, when we do run this command, the application start to generate error logs below. It appears that some routine is stuck somewhere, and we're unable to figure out where, why and how? If we don't run this script, push notifications don't work. If we do run this script, push notifications work with delay, and ERROR logs are produced AND the size of log reaches to GB in a matter of an hour. What are we doing wrong here?
We're using Redis/Predis:
'redis' => [
'client' => 'predis',
'cluster' => env('REDIS_CLUSTER', false),
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
'timeout' => 15.0,
],
],
For broadcasting, we're using Pusher:
'default' => env('BROADCAST_DRIVER', 'pusher'),
For queue, we're using Redis:
'default' => env('QUEUE_DRIVER', 'sync'),
QUEUE_DRIVER=redis
For cache, we're using Redis:
'default' => env('CACHE_DRIVER', 'file'),
CACHE_DRIVER=redis
CreateMessageNotification
<?php
namespace App\Jobs\EventHandlers;
use App\Events\Notifications\NewMessageCreatedEvent;
use App\Repositories\UserDevicesRepository;
use Event;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class CreateMessageNotification implements ShouldQueue
{
use InteractsWithQueue, Queueable, SerializesModels;
private $message;
public function __construct($message)
{
$this->message = $message;
}
public function handle()
{
Event::fire(new NewMessageCreatedEvent($this->message));
}
}
NewMessageCreatedEvent
<?php
namespace App\Events\Notifications;
use App\Models\Chat\Message;
use Event;
use Illuminate\Queue\SerializesModels;
class NewMessageCreatedEvent extends Event
{
use SerializesModels;
public function __construct(Message $message)
{
$message->load(['other', 'chat', 'chat.chatUsers']);
foreach ($message->chat->chatUsers as $chatUser) {
if ($chatUser->user_id !== $message->other->id) {
Event::fire(new NewMessageNotificationEvent($message, $chatUser->user_id));
}
}
}
}
ERROR LOG
[2018-09-06 06:28:55] local.ERROR: exception 'Illuminate\Broadcasting\BroadcastException' with message 'API call failed since (daily) message quota exceeded
' in /var/www/html/project/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php:106
Stack trace:
#0 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php(49): Illuminate\Broadcasting\Broadcasters\PusherBroadcaster->broadcast(Array, 'new_$
#1 [internal function]: Illuminate\Broadcasting\BroadcastEvent->handle(Object(Illuminate\Broadcasting\Broadcasters\PusherBroadcaster))
#2 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(30): call_user_func_array(Array, Array)
#3 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#4 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Appli$
#5 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Arr$
#6 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array)
#7 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(114): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Illuminate\Broadcasting\Broa$
#8 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Broadcast$
#9 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#10 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(43): Illuminate\Bus\Dispatcher->dispatchNow(Object(Illuminate\Broadcasting\BroadcastEv$
#11 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(69): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#12 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(317): Illuminate\Queue\Jobs\Job->fire()
#13 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(267): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Il$
#14 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(113): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Ill$
#15 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(102): Illuminate\Queue\Worker->daemon('redis', 'default', Object(Illuminate\Queue\Wo$
#16 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(86): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'default')
#17 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#18 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(30): call_user_func_array(Array, Array)
#19 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#20 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Appl$
#21 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Ar$
#22 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Illuminate\Container\Container->call(Array)
#23 /var/www/html/project/vendor/symfony/console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\$
#24 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(168): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\Ar$
#25 /var/www/html/project/vendor/symfony/console/Application.php(946): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\C$
#26 /var/www/html/project/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symf$
#27 /var/www/html/project/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfon$
#28 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\In$
#29 /var/www/html/project/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\Conso$
#30 {main}
[2018-09-06 06:28:55] local.ERROR: exception 'ErrorException' with message 'Trying to get property of non-object' in /var/www/html/project/app/Events/Notifications/NewMessageCreate$
Stack trace:
#0 /var/www/html/project/app/Events/Notifications/NewMessageCreatedEvent.php(27): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/var/www/h$
#1 /var/www/html/project/app/Jobs/EventHandlers/CreateMessageNotification.php(38): App\Events\Notifications\NewMessageCreatedEvent->__construct(Object(App\Models\Chat\Message))
#2 [internal function]: App\Jobs\EventHandlers\CreateMessageNotification->handle()
#3 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(30): call_user_func_array(Array, Array)
#4 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#5 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Appli$
#6 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Arr$
#7 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array)
#8 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(114): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(App\Jobs\EventHandlers\Creat$
#9 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(App\Jobs\EventHandle$
#10 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#11 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(43): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\EventHandlers\CreateMessag$
#12 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(69): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#13 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(317): Illuminate\Queue\Jobs\Job->fire()
#14 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(267): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Il$
#15 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(113): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Ill$
#16 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(102): Illuminate\Queue\Worker->daemon('redis', 'default', Object(Illuminate\Queue\Wo$
#17 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(86): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'default')
#18 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#19 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(30): call_user_func_array(Array, Array)
#20 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#21 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Appl$
#22 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Ar$
#23 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Illuminate\Container\Container->call(Array)
#24 /var/www/html/project/vendor/symfony/console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\$
#25 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(168): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\Ar$
#26 /var/www/html/project/vendor/symfony/console/Application.php(946): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\C$
#27 /var/www/html/project/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symf$
#28 /var/www/html/project/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfon$
#29 /var/www/html/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\In$
#30 /var/www/html/project/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\Conso$
What worked for me was to remove all failed jobs from the queue (after attempting to retry just one more time):
php artisan queue:restart
php artisan queue:work redis --daemon --tries=1
Re-run the queue:
php artisan queue:work redis --daemon
Also, I had to get rid to calls to Pusher which were failing to get this to work.
I am simply adding a paypal IPN (using the https://github.com/mike182uk/paypal-ipn-listener) to add credits to a users profile and add the order into the database. I actually had this working, but for some reason a day later, I noticed nothing being inserted into the DB and the users credits are not given. All I get in the laravel.log is this huge error log which seems to be all TokenMismatchException.
FYI: I am using the paypal sandbox to do this right now, so not sure if that matters or not, but it's quite slow in responding.
Full error log for that specific call:
[2015-01-12 00:21:15] production.ERROR: exception 'Illuminate\Session\TokenMismatchException' in /home/username/webapps/site_name/app/filters.php:88
Stack trace:
#0 [internal function]: {closure}(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#1 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(199): call_user_func_array(Object(Closure), Array)
#2 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(154): Illuminate\Events\Dispatcher->fire('router.filter: ...', Array, true)
#3 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1468): Illuminate\Events\Dispatcher->until('router.filter: ...', Array)
#4 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(240): Illuminate\Routing\Router->callRouteFilter('csrf', Array, Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#5 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Routing\ControllerDispatcher->callFilter(Array, Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#6 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(55): Illuminate\Routing\ControllerDispatcher->before(Object(AuthController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'postLogin')
#7 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(962): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'AuthController', 'postLogin')
#8 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#9 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Route.php(109): call_user_func_array(Object(Closure), Array)
#10 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1028): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#11 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#12 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#13 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(745): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#14 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#15 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#16 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#17 /home/username/webapps/site_name/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#18 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(641): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#19 /home/username/webapps/site_name/public/index.php(49): Illuminate\Foundation\Application->run()
#20 {main} [] []
[2015-01-12 00:21:26] production.ERROR: exception 'Illuminate\Session\TokenMismatchException' in /home/username/webapps/site_name/app/filters.php:88
Stack trace:
#0 [internal function]: {closure}(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#1 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(199): call_user_func_array(Object(Closure), Array)
#2 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(154): Illuminate\Events\Dispatcher->fire('router.filter: ...', Array, true)
#3 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1468): Illuminate\Events\Dispatcher->until('router.filter: ...', Array)
#4 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(240): Illuminate\Routing\Router->callRouteFilter('csrf', Array, Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#5 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Routing\ControllerDispatcher->callFilter(Array, Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#6 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(55): Illuminate\Routing\ControllerDispatcher->before(Object(AuthController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'postLogin')
#7 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(962): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'AuthController', 'postLogin')
#8 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#9 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Route.php(109): call_user_func_array(Object(Closure), Array)
#10 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1028): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#11 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#12 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#13 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(745): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#14 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#15 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#16 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#17 /home/username/webapps/site_name/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#18 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(641): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#19 /home/username/webapps/site_name/public/index.php(49): Illuminate\Foundation\Application->run()
#20 {main} [] []
[2015-01-12 00:21:46] production.ERROR: exception 'Illuminate\Session\TokenMismatchException' in /home/username/webapps/site_name/app/filters.php:88
Stack trace:
#0 [internal function]: {closure}(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#1 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(199): call_user_func_array(Object(Closure), Array)
#2 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(154): Illuminate\Events\Dispatcher->fire('router.filter: ...', Array, true)
#3 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1468): Illuminate\Events\Dispatcher->until('router.filter: ...', Array)
#4 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(240): Illuminate\Routing\Router->callRouteFilter('csrf', Array, Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#5 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Routing\ControllerDispatcher->callFilter(Array, Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#6 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(55): Illuminate\Routing\ControllerDispatcher->before(Object(AuthController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'postLogin')
#7 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(962): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'AuthController', 'postLogin')
#8 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#9 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Route.php(109): call_user_func_array(Object(Closure), Array)
#10 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1028): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#11 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#12 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#13 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(745): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#14 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#15 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#16 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#17 /home/username/webapps/site_name/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#18 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(641): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#19 /home/username/webapps/site_name/public/index.php(49): Illuminate\Foundation\Application->run()
#20 {main} [] []
[2015-01-12 00:22:10] production.ERROR: exception 'Illuminate\Session\TokenMismatchException' in /home/username/webapps/site_name/app/filters.php:88
Stack trace:
#0 [internal function]: {closure}(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#1 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(199): call_user_func_array(Object(Closure), Array)
#2 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(154): Illuminate\Events\Dispatcher->fire('router.filter: ...', Array, true)
#3 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1468): Illuminate\Events\Dispatcher->until('router.filter: ...', Array)
#4 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(240): Illuminate\Routing\Router->callRouteFilter('csrf', Array, Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#5 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Routing\ControllerDispatcher->callFilter(Array, Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#6 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(55): Illuminate\Routing\ControllerDispatcher->before(Object(AuthController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'postLogin')
#7 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(962): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'AuthController', 'postLogin')
#8 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#9 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Route.php(109): call_user_func_array(Object(Closure), Array)
#10 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1028): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#11 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Routing/Router.php(996): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#12 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#13 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(745): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#14 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#15 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#16 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#17 /home/username/webapps/site_name/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#18 /home/username/webapps/site_name/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(641): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#19 /home/username/webapps/site_name/public/index.php(49): Illuminate\Foundation\Application->run()
#20 {main} [] []
Not even sure what TokenMismatchException has to do with the Paypal IPN since I don't have csrf enabled on the routes for it. Peep the Controller/routes below:
IpnController
use PayPal\Ipn\Listener;
use PayPal\Ipn\Message;
use PayPal\Ipn\Verifier\CurlVerifier;
class IpnController extends BaseController {
/**
* Store a newly created resource in storage.
*
* #return Response
*/
public function store()
{
$listener = new Listener;
$verifier = new CurlVerifier;
$ipnMessage = Message::createFromGlobals(); // uses php://input
$verifier->setIpnMessage($ipnMessage);
if ( Config::get( 'app.debug' ) ) {
$verifier->setEnvironment('sandbox'); // Use sandbox if debug is true
} else {
$verifier->setEnvironment('production');
}
$listener->setVerifier($verifier);
$listener->listen( function() use ( $listener )
{
// on verified IPN (everything is good!)
$resp = $listener->getVerifier()->getVerificationResponse();
$data = Input::all();
$order = new CreditOrder;
$order->txn_id = $data['txn_id'];
$order->payer_email = $data['payer_email'];
$order->user_id = $data['custom'];
$order->product_id = $data['item_number'];
$order->mc_gross = $data['mc_gross'];
$order->save();
$product = Product::find( $data['item_number'] );
$user = User::find( $data['custom'] );
$user->increment( 'credits', $product->credit_amount );
Mail::send( 'emails.credits.thankyou', [ 'username' => $user->username, 'package' => $product->product, 'credits' => $product->credit_amount, 'price' => $product->price ], function( $message ) {
$message->to( 'email#gmail.com', 'Name' )->subject( 'Name - Credits Added!' );
});
},
function() use ( $listener )
{
// on invalid IPN (somethings not right!)
$report = $listener->getReport();
$resp = $listener->getVerifier()->getVerificationResponse();
Log::error('invalid IPN');
Mail::send( 'emails.plain', [ 'content' => $report ], function( $message ) {
$message->to( 'email#gmail.com', 'Name' )->subject( 'Name Invalid IPN' );
});
});
}
public function cancel()
{
return Redirect::route( 'credits.packages' )->with( 'error', 'Your payment was canceled.' );
}
public function success()
{
return View::make( 'credits.success' );
// return Redirect::home()->with( 'success', '<strong>Thank you, '. Auth::user()->username .'!</strong> Your payment was successful and your account has been credited.' );
}
}
IPN Routes
Route::group( [ 'before' => 'auth' ], function()
{
// IPN
Route::post('/credits/ipn', [ 'uses' => 'IpnController#store', 'as' => 'credits.ipn' ] );
Route::get('/credits/cancel', [ 'uses' => 'IpnController#cancel', 'as' => 'credits.cancel' ] );
Route::post('/credits/success', [ 'uses' => 'IpnController#success', 'as' => 'credits.success' ] );
});
If you need me to add any additional info, please let me know. I've been struggling with this for a few days now and really need to get this figured out this week! Appreciate any help :)
Just by taking my IPN routes out of the "before auth" group, it seems to be working fine now?
Someone did mention something about the csrf being enabled by default on post routes. So that could have something to do with it as well. Just in case, I used their suggestion here:
http://laravel.io/forum/01-12-2015-laravel-4-paypal-ipn-not-working-tokenmismatchexception?page=1#reply-19578
All seems to be working now though.
Cheers!
I have been working on the official tutorial for ZF2.
At the end of the page, to see what gives the result, I get this long error:
An error occurred
An error occurred during execution; please try again later.
Additional information:
Zend\Db\Adapter\Exception\RuntimeException
File:
D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Driver\Pdo\Connection.php:243
Message:
Connect Error: SQLSTATE[28000] [1045] Access denied for user ''#'localhost' (using password: NO)
Stack trace:
#0 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Driver\Pdo\Pdo.php(211): Zend\Db\Adapter\Driver\Pdo\Connection->connect()
#1 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Adapter.php(175): Zend\Db\Adapter\Driver\Pdo\Pdo->createStatement(NULL)
#2 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Sql\Sql.php(103): Zend\Db\Adapter\Adapter->createStatement()
#3 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\TableGateway\AbstractTableGateway.php(234): Zend\Db\Sql\Sql->prepareStatementForSqlObject(Object(Zend\Db\Sql\Select))
#4 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\TableGateway\AbstractTableGateway.php(210): Zend\Db\TableGateway\AbstractTableGateway->executeSelect(Object(Zend\Db\Sql\Select))
#5 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\TableGateway\AbstractTableGateway.php(197): Zend\Db\TableGateway\AbstractTableGateway->selectWith(Object(Zend\Db\Sql\Select))
#6 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\module\Album\src\Album\Model\AlbumTable.php(24): Zend\Db\TableGateway\AbstractTableGateway->select()
#7 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\module\Album\src\Album\Controller\AlbumController.php(18): Album\Model\AlbumTable->fetchAll()
#8 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Mvc\Controller\AbstractActionController.php(87): Album\Controller\AlbumController->indexAction()
#9 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#10 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(469): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#11 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(209): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Mvc\Controller\AbstractController.php(108): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Mvc\DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#14 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#15 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(469): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#16 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(209): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php(298): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\public\index.php(12): Zend\Mvc\Application->run()
#19 {main}
Previous exceptions:
PDOException
File:
D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Driver\Pdo\Connection.php:239
Message:
SQLSTATE[28000] [1045] Access denied for user ''#'localhost' (using password: NO)
Stack trace:
#0 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Driver\Pdo\Connection.php(239): PDO->__construct('mysql:dbname=zf...', NULL, NULL, Array)
#1 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Driver\Pdo\Pdo.php(211): Zend\Db\Adapter\Driver\Pdo\Connection->connect()
#2 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Adapter.php(175): Zend\Db\Adapter\Driver\Pdo\Pdo->createStatement(NULL)
#3 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\Sql\Sql.php(103): Zend\Db\Adapter\Adapter->createStatement()
#4 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\TableGateway\AbstractTableGateway.php(234): Zend\Db\Sql\Sql->prepareStatementForSqlObject(Object(Zend\Db\Sql\Select))
#5 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\TableGateway\AbstractTableGateway.php(210): Zend\Db\TableGateway\AbstractTableGateway->executeSelect(Object(Zend\Db\Sql\Select))
#6 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Db\TableGateway\AbstractTableGateway.php(197): Zend\Db\TableGateway\AbstractTableGateway->selectWith(Object(Zend\Db\Sql\Select))
#7 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\module\Album\src\Album\Model\AlbumTable.php(24): Zend\Db\TableGateway\AbstractTableGateway->select()
#8 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\module\Album\src\Album\Controller\AlbumController.php(18): Album\Model\AlbumTable->fetchAll()
#9 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Mvc\Controller\AbstractActionController.php(87): Album\Controller\AlbumController->indexAction()
#10 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(469): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#12 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(209): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Mvc\Controller\AbstractController.php(108): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Mvc\DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#15 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(469): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#17 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(209): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#18 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php(298): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 D:\softs\UwAmp\www\zf2-tutorial\ZendSkeletonApplication\public\index.php(12): Zend\Mvc\Application->run()
#20 {main}
Can anyone help me on this?
You need put your credentials in a local config file
// config/autoload/local.php:
return array(
'db' => array(
'username' => 'YOUR USERNAME HERE',
'password' => 'YOUR PASSWORD HERE',
),
);
Thank Maks3w, I got the same error because I didn't create local.php file to add the code. I thought that local.php.dist works well.
Everything's great after I have the local.php with the code
// config/autoload/local.php:
return array(
'db' => array(
'username' => 'YOUR USERNAME HERE',
'password' => 'YOUR PASSWORD HERE',
),
);
There is a comment in local.php.dist that helped me to fix it:
// Copy this file without the .dist extension at the end and populate values as needed.