We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
getting this while trying to record feature usage:
$this->report->user->subscriptionUsage('main')->record('credits', $credits_used);
the full error and stack trace:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-credits' for key 'plan_subscription_usages_subscription_id_code_unique' in /home/yahav/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:142 Stack trace: 0 /home/yahav/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(142): PDOStatement->execute(NULL) 1 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(458): Doctrine\DBAL\Driver\PDOStatement->execute() 2 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(657): Illuminate\Database\Connection->Illuminate\Database{closure}('insert into pl...', Array) 3 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into pl...', Array, Object(Closure)) 4 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\Database\Connection->run('insert into pl...', Array, Object(Closure)) 5 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into pl...', Array) 6 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into pl...', Array) 7 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2494): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into pl...', Array, 'id') 8 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1283): Illuminate\Database\Query\Builder->insertGetId(Array, 'id') 9 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(787): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array) 10 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(752): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array) 11 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(615): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder)) 12 /home/yahav/www/project/vendor/gerardojbaez/laraplans/src/Laraplans/SubscriptionUsageManager.php(59): Illuminate\Database\Eloquent\Model->save() 13 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(157): Gerardojbaez\Laraplans\SubscriptionUsageManager->record(Object(Gerardojbaez\Laraplans\Feature), 242328) 14 /home/yahav/www/project/app/Classes/Platforms/Processors/YoutubeProcessor.php(156): App\Jobs\ProcessReportJob->saveCreditUsage(242328) 15 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(171): App\Classes\Platforms\Processors\YoutubeProcessor->process() 16 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(108): App\Jobs\ProcessReportJob->processJob() 17 [internal function]: App\Jobs\ProcessReportJob->handle() 18 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 19 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 20 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 21 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 22 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array) 23 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}(Object(App\Jobs\ProcessReportJob)) 24 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(App\Jobs\ProcessReportJob)) 25 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure)) 26 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\ProcessReportJob), false) 27 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(83): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\BeanstalkdJob), Array) 28 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(322): Illuminate\Queue\Jobs\Job->fire() 29 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(272): Illuminate\Queue\Worker->process('beanstalkd', Object(Illuminate\Queue\Jobs\BeanstalkdJob), Object(Illuminate\Queue\WorkerOptions)) 30 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\BeanstalkdJob), 'beanstalkd', Object(Illuminate\Queue\WorkerOptions)) 31 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('beanstalkd', 'reportProcessin...', Object(Illuminate\Queue\WorkerOptions)) 32 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('beanstalkd', 'reportProcessin...') 33 [internal function]: Illuminate\Queue\Console\WorkCommand->handle() 34 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 35 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 36 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 37 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 38 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(184): Illuminate\Container\Container->call(Array) 39 /home/yahav/www/project/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 40 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(171): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 41 /home/yahav/www/project/vendor/symfony/console/Application.php(886): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 42 /home/yahav/www/project/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 43 /home/yahav/www/project/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 44 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 45 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 46 /home/yahav/www/project/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 47 {main} Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-credits' for key 'plan_subscription_usages_subscription_id_code_unique' in /home/yahav/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:144 Stack trace: 0 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(458): Doctrine\DBAL\Driver\PDOStatement->execute() 1 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(657): Illuminate\Database\Connection->Illuminate\Database{closure}('insert into pl...', Array) 2 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into pl...', Array, Object(Closure)) 3 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\Database\Connection->run('insert into pl...', Array, Object(Closure)) 4 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into pl...', Array) 5 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into pl...', Array) 6 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2494): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into pl...', Array, 'id') 7 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1283): Illuminate\Database\Query\Builder->insertGetId(Array, 'id') 8 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(787): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array) 9 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(752): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array) 10 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(615): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder)) 11 /home/yahav/www/project/vendor/gerardojbaez/laraplans/src/Laraplans/SubscriptionUsageManager.php(59): Illuminate\Database\Eloquent\Model->save() 12 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(157): Gerardojbaez\Laraplans\SubscriptionUsageManager->record(Object(Gerardojbaez\Laraplans\Feature), 242328) 13 /home/yahav/www/project/app/Classes/Platforms/Processors/YoutubeProcessor.php(156): App\Jobs\ProcessReportJob->saveCreditUsage(242328) 14 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(171): App\Classes\Platforms\Processors\YoutubeProcessor->process() 15 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(108): App\Jobs\ProcessReportJob->processJob() 16 [internal function]: App\Jobs\ProcessReportJob->handle() 17 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 18 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 19 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 20 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 21 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array) 22 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}(Object(App\Jobs\ProcessReportJob)) 23 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(App\Jobs\ProcessReportJob)) 24 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure)) 25 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\ProcessReportJob), false) 26 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(83): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\BeanstalkdJob), Array) 27 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(322): Illuminate\Queue\Jobs\Job->fire() 28 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(272): Illuminate\Queue\Worker->process('beanstalkd', Object(Illuminate\Queue\Jobs\BeanstalkdJob), Object(Illuminate\Queue\WorkerOptions)) 29 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\BeanstalkdJob), 'beanstalkd', Object(Illuminate\Queue\WorkerOptions)) 30 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('beanstalkd', 'reportProcessin...', Object(Illuminate\Queue\WorkerOptions)) 31 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('beanstalkd', 'reportProcessin...') 32 [internal function]: Illuminate\Queue\Console\WorkCommand->handle() 33 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 34 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 35 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 36 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 37 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(184): Illuminate\Container\Container->call(Array) 38 /home/yahav/www/project/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 39 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(171): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 40 /home/yahav/www/project/vendor/symfony/console/Application.php(886): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 41 /home/yahav/www/project/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 42 /home/yahav/www/project/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 43 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 44 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 45 /home/yahav/www/project/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 46 {main} Next Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-credits' for key 'plan_subscription_usages_subscription_id_code_unique' (SQL: insert into plan_subscription_usages (code, subscription_id, used, updated_at, created_at) values (credits, 1, 242328, 2018-09-11 12:17:11, 2018-09-11 12:17:11)) in /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 Stack trace: 0 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into pl...', Array, Object(Closure)) 1 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\Database\Connection->run('insert into pl...', Array, Object(Closure)) 2 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into pl...', Array) 3 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into pl...', Array) 4 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2494): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into `pl...', Array, 'id') 5 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1283): Illuminate\Database\Query\Builder->insertGetId(Array, 'id') 6 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(787): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array) 7 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(752): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array) 8 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(615): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder)) 9 /home/yahav/www/project/vendor/gerardojbaez/laraplans/src/Laraplans/SubscriptionUsageManager.php(59): Illuminate\Database\Eloquent\Model->save() 10 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(157): Gerardojbaez\Laraplans\SubscriptionUsageManager->record(Object(Gerardojbaez\Laraplans\Feature), 242328) 11 /home/yahav/www/project/app/Classes/Platforms/Processors/YoutubeProcessor.php(156): App\Jobs\ProcessReportJob->saveCreditUsage(242328) 12 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(171): App\Classes\Platforms\Processors\YoutubeProcessor->process() 13 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(108): App\Jobs\ProcessReportJob->processJob() 14 [internal function]: App\Jobs\ProcessReportJob->handle() 15 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 16 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 17 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 18 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 19 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array) 20 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}(Object(App\Jobs\ProcessReportJob)) 21 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(App\Jobs\ProcessReportJob)) 22 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure)) 23 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\ProcessReportJob), false) 24 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(83): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\BeanstalkdJob), Array) 25 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(322): Illuminate\Queue\Jobs\Job->fire() 26 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(272): Illuminate\Queue\Worker->process('beanstalkd', Object(Illuminate\Queue\Jobs\BeanstalkdJob), Object(Illuminate\Queue\WorkerOptions)) 27 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\BeanstalkdJob), 'beanstalkd', Object(Illuminate\Queue\WorkerOptions)) 28 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('beanstalkd', 'reportProcessin...', Object(Illuminate\Queue\WorkerOptions)) 29 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('beanstalkd', 'reportProcessin...') 30 [internal function]: Illuminate\Queue\Console\WorkCommand->handle() 31 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 32 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 33 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 34 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 35 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(184): Illuminate\Container\Container->call(Array) 36 /home/yahav/www/project/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 37 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(171): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 38 /home/yahav/www/project/vendor/symfony/console/Application.php(886): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 39 /home/yahav/www/project/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 40 /home/yahav/www/project/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 41 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 42 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 43 /home/yahav/www/project/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 44 {main}
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-credits' for key 'plan_subscription_usages_subscription_id_code_unique' in /home/yahav/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:142 Stack trace: 0 /home/yahav/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(142): PDOStatement->execute(NULL) 1 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(458): Doctrine\DBAL\Driver\PDOStatement->execute() 2 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(657): Illuminate\Database\Connection->Illuminate\Database{closure}('insert into pl...', Array) 3 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into pl...', Array, Object(Closure)) 4 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\Database\Connection->run('insert into pl...', Array, Object(Closure)) 5 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into pl...', Array) 6 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into pl...', Array) 7 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2494): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into pl...', Array, 'id') 8 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1283): Illuminate\Database\Query\Builder->insertGetId(Array, 'id') 9 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(787): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array) 10 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(752): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array) 11 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(615): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder)) 12 /home/yahav/www/project/vendor/gerardojbaez/laraplans/src/Laraplans/SubscriptionUsageManager.php(59): Illuminate\Database\Eloquent\Model->save() 13 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(157): Gerardojbaez\Laraplans\SubscriptionUsageManager->record(Object(Gerardojbaez\Laraplans\Feature), 242328) 14 /home/yahav/www/project/app/Classes/Platforms/Processors/YoutubeProcessor.php(156): App\Jobs\ProcessReportJob->saveCreditUsage(242328) 15 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(171): App\Classes\Platforms\Processors\YoutubeProcessor->process() 16 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(108): App\Jobs\ProcessReportJob->processJob() 17 [internal function]: App\Jobs\ProcessReportJob->handle() 18 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 19 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 20 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 21 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 22 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array) 23 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}(Object(App\Jobs\ProcessReportJob)) 24 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(App\Jobs\ProcessReportJob)) 25 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure)) 26 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\ProcessReportJob), false) 27 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(83): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\BeanstalkdJob), Array) 28 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(322): Illuminate\Queue\Jobs\Job->fire() 29 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(272): Illuminate\Queue\Worker->process('beanstalkd', Object(Illuminate\Queue\Jobs\BeanstalkdJob), Object(Illuminate\Queue\WorkerOptions)) 30 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\BeanstalkdJob), 'beanstalkd', Object(Illuminate\Queue\WorkerOptions)) 31 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('beanstalkd', 'reportProcessin...', Object(Illuminate\Queue\WorkerOptions)) 32 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('beanstalkd', 'reportProcessin...') 33 [internal function]: Illuminate\Queue\Console\WorkCommand->handle() 34 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 35 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 36 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 37 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 38 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(184): Illuminate\Container\Container->call(Array) 39 /home/yahav/www/project/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 40 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(171): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 41 /home/yahav/www/project/vendor/symfony/console/Application.php(886): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 42 /home/yahav/www/project/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 43 /home/yahav/www/project/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 44 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 45 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 46 /home/yahav/www/project/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 47 {main}
pl...', Array) 3 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into
pl...', Array, Object(Closure)) 5 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into
pl...', Array) 7 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2494): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into
Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-credits' for key 'plan_subscription_usages_subscription_id_code_unique' in /home/yahav/www/project/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:144 Stack trace: 0 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(458): Doctrine\DBAL\Driver\PDOStatement->execute() 1 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(657): Illuminate\Database\Connection->Illuminate\Database{closure}('insert into pl...', Array) 2 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into pl...', Array, Object(Closure)) 3 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\Database\Connection->run('insert into pl...', Array, Object(Closure)) 4 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into pl...', Array) 5 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into pl...', Array) 6 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2494): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into pl...', Array, 'id') 7 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1283): Illuminate\Database\Query\Builder->insertGetId(Array, 'id') 8 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(787): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array) 9 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(752): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array) 10 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(615): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder)) 11 /home/yahav/www/project/vendor/gerardojbaez/laraplans/src/Laraplans/SubscriptionUsageManager.php(59): Illuminate\Database\Eloquent\Model->save() 12 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(157): Gerardojbaez\Laraplans\SubscriptionUsageManager->record(Object(Gerardojbaez\Laraplans\Feature), 242328) 13 /home/yahav/www/project/app/Classes/Platforms/Processors/YoutubeProcessor.php(156): App\Jobs\ProcessReportJob->saveCreditUsage(242328) 14 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(171): App\Classes\Platforms\Processors\YoutubeProcessor->process() 15 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(108): App\Jobs\ProcessReportJob->processJob() 16 [internal function]: App\Jobs\ProcessReportJob->handle() 17 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 18 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 19 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 20 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 21 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array) 22 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}(Object(App\Jobs\ProcessReportJob)) 23 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(App\Jobs\ProcessReportJob)) 24 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure)) 25 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\ProcessReportJob), false) 26 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(83): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\BeanstalkdJob), Array) 27 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(322): Illuminate\Queue\Jobs\Job->fire() 28 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(272): Illuminate\Queue\Worker->process('beanstalkd', Object(Illuminate\Queue\Jobs\BeanstalkdJob), Object(Illuminate\Queue\WorkerOptions)) 29 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\BeanstalkdJob), 'beanstalkd', Object(Illuminate\Queue\WorkerOptions)) 30 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('beanstalkd', 'reportProcessin...', Object(Illuminate\Queue\WorkerOptions)) 31 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('beanstalkd', 'reportProcessin...') 32 [internal function]: Illuminate\Queue\Console\WorkCommand->handle() 33 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 34 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 35 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 36 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 37 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(184): Illuminate\Container\Container->call(Array) 38 /home/yahav/www/project/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 39 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(171): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 40 /home/yahav/www/project/vendor/symfony/console/Application.php(886): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 41 /home/yahav/www/project/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 42 /home/yahav/www/project/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 43 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 44 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 45 /home/yahav/www/project/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 46 {main}
pl...', Array) 2 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into
pl...', Array, Object(Closure)) 4 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into
pl...', Array) 6 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2494): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into
Next Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-credits' for key 'plan_subscription_usages_subscription_id_code_unique' (SQL: insert into plan_subscription_usages (code, subscription_id, used, updated_at, created_at) values (credits, 1, 242328, 2018-09-11 12:17:11, 2018-09-11 12:17:11)) in /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 Stack trace: 0 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('insert into pl...', Array, Object(Closure)) 1 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\Database\Connection->run('insert into pl...', Array, Object(Closure)) 2 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(411): Illuminate\Database\Connection->statement('insert into pl...', Array) 3 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into pl...', Array) 4 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2494): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into `pl...', Array, 'id') 5 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1283): Illuminate\Database\Query\Builder->insertGetId(Array, 'id') 6 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(787): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array) 7 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(752): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array) 8 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(615): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder)) 9 /home/yahav/www/project/vendor/gerardojbaez/laraplans/src/Laraplans/SubscriptionUsageManager.php(59): Illuminate\Database\Eloquent\Model->save() 10 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(157): Gerardojbaez\Laraplans\SubscriptionUsageManager->record(Object(Gerardojbaez\Laraplans\Feature), 242328) 11 /home/yahav/www/project/app/Classes/Platforms/Processors/YoutubeProcessor.php(156): App\Jobs\ProcessReportJob->saveCreditUsage(242328) 12 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(171): App\Classes\Platforms\Processors\YoutubeProcessor->process() 13 /home/yahav/www/project/app/Jobs/ProcessReportJob.php(108): App\Jobs\ProcessReportJob->processJob() 14 [internal function]: App\Jobs\ProcessReportJob->handle() 15 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 16 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 17 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 18 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 19 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array) 20 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Bus\Dispatcher->Illuminate\Bus{closure}(Object(App\Jobs\ProcessReportJob)) 21 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(App\Jobs\ProcessReportJob)) 22 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure)) 23 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\ProcessReportJob), false) 24 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(83): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\BeanstalkdJob), Array) 25 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(322): Illuminate\Queue\Jobs\Job->fire() 26 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(272): Illuminate\Queue\Worker->process('beanstalkd', Object(Illuminate\Queue\Jobs\BeanstalkdJob), Object(Illuminate\Queue\WorkerOptions)) 27 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\BeanstalkdJob), 'beanstalkd', Object(Illuminate\Queue\WorkerOptions)) 28 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('beanstalkd', 'reportProcessin...', Object(Illuminate\Queue\WorkerOptions)) 29 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('beanstalkd', 'reportProcessin...') 30 [internal function]: Illuminate\Queue\Console\WorkCommand->handle() 31 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) 32 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() 33 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) 34 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) 35 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(184): Illuminate\Container\Container->call(Array) 36 /home/yahav/www/project/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 37 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(171): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) 38 /home/yahav/www/project/vendor/symfony/console/Application.php(886): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 39 /home/yahav/www/project/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 40 /home/yahav/www/project/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 41 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 42 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 43 /home/yahav/www/project/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 44 {main}
plan_subscription_usages
code
subscription_id
used
updated_at
created_at
pl...', Array, Object(Closure)) 1 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Connection.php(459): Illuminate\Database\Connection->run('insert into
pl...', Array) 3 /home/yahav/www/project/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into
Any idea what went wrong?
The text was updated successfully, but these errors were encountered:
This still happening. Is this package still active?
Sorry, something went wrong.
I know this is quite old. There's a check in place to prevent duplicated usage records:
laraplans/src/Laraplans/SubscriptionUsageManager.php
Lines 36 to 40 in 6d0112d
I've been trying to replicate the issue but nothing so far, all tests are passing. Also, I haven't seen this issue in production.
I'll continue investigating before closing the issue.
No branches or pull requests
getting this while trying to record feature usage:
$this->report->user->subscriptionUsage('main')->record('credits', $credits_used);
the full error and stack trace:
Any idea what went wrong?
The text was updated successfully, but these errors were encountered: