laravel queue daemon mail stops functioning with SSL error - php

I am running a laravel queue daemon, which sends mail depending on the actions taken. This is running through supervisor to ensure it always runs. It works fine at first, but after some time the mail stops sending. The error is not reporting up the chain, but the logs show:
[2014-07-30 20:00:21] production.ERROR: exception 'ErrorException' with message 'fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry' in /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:232
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'fwrite(): SSL o...', '/srv/www/example...', 232, Array)
#1 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(232): fwrite(Resource id #376, 'MAIL FROM: <hel...')
#2 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php(171): Swift_Transport_StreamBuffer->_commit('MAIL FROM: <hel...')
#3 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php(90): Swift_ByteStream_AbstractFilterableInputStream->_doWrite('MAIL FROM: <hel...')
#4 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(274): Swift_ByteStream_AbstractFilterableInputStream->write('MAIL FROM: <hel...')
#5 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(243): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM: <hel...', Array, Array)
#6 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(323): Swift_Transport_EsmtpTransport->executeCommand('MAIL FROM: <hel...', Array)
#7 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(416): Swift_Transport_EsmtpTransport->_doMailFromCommand('hello#example.co...')
#8 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(444): Swift_Transport_AbstractSmtpTransport->_doMailTransaction(Object(Swift_Message), 'hello#example.co...', Array, Array)
#9 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(174): Swift_Transport_AbstractSmtpTransport->_sendTo(Object(Swift_Message), 'hello#example.co...', Array, Array)
#10 /srv/www/example.co.uk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(85): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
#11 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(328): Swift_Mailer->send(Object(Swift_Message), Array)
#12 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(150): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message))
#13 /srv/www/example.co.uk/bootstrap/compiled.php(3231): Illuminate\Mail\Mailer->send('emails.campaign...', Array, Object(Closure))
#14 /srv/www/example.co.uk/app/commands/Sender.php(252): Illuminate\Support\Facades\Facade::__callStatic('send', Array)
#15 /srv/www/example.co.uk/app/commands/Sender.php(252): Illuminate\Support\Facades\Mail::send('emails.campaign...', Array, Object(Closure))
#16 /srv/www/example.co.uk/app/commands/Sender.php(116): Sender->_sendEmail(Array, Array, Array, Array)
#17 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(96): Sender->queue(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#18 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Jobs/RedisJob.php(46): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#19 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(192): Illuminate\Queue\Jobs\RedisJob->fire()
#20 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(142): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), '2', 0)
#21 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(101): Illuminate\Queue\Worker->pop('redis', NULL, 0, '3', '2')
#22 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(73): Illuminate\Queue\Worker->runNextJobForDaemon('redis', NULL, 0, '3', '2')
#23 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(98): Illuminate\Queue\Worker->daemon('redis', NULL, 0, 128, '3', '2')
#24 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(68): Illuminate\Queue\Console\WorkCommand->runWorker('redis', NULL, 0, 128, true)
#25 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Console/Command.php(112): Illuminate\Queue\Console\WorkCommand->fire()
#26 /srv/www/example.co.uk/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /srv/www/example.co.uk/vendor/laravel/framework/src/Illuminate/Console/Command.php(100): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /srv/www/example.co.uk/vendor/symfony/console/Symfony/Component/Console/Application.php(887): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /srv/www/example.co.uk/vendor/symfony/console/Symfony/Component/Console/Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /srv/www/example.co.uk/vendor/symfony/console/Symfony/Component/Console/Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /srv/www/example.co.uk/artisan(59): Symfony\Component\Console\Application->run()
#32 {main} [] []
I'm suck for ideas? I'm using sendgrid for mailing
edit, Same as here: https://github.com/swiftmailer/swiftmailer/issues/490

This is a bug inside Laravel/Swift and the way that it is handling it's sockets inside the long running queue worker. The best way to avoid this issue is to make sure that you are closing your transport after each email has been sent.
There is a closed issue inside Laravel's bug tracker that has a couple of patches to the Laravel code base that will resolve this issue.
Alternatively, have a look at the YOzaz/Laravel-SwiftMailer package, which has an updated Mail facade that will most likely resolve the problem that you are having.

Related

Laravel broadcasting on Pusher, failed job queue

I built a chatroom API that uses Laravel events and listeners,broadcasting via pusher and listening for those public and private channels via laravel echo and Vue.
However where I became stuck is after having to reinstall wamp64 and move the Laravel application to the newly installed wamp64/www/ path, composer was updated all dependencies are within the new folder as needed, however the issue occurs with event and job queue .A failed job ever time I trigger the event.
I would like to note that my Pusher account is working due to the listeners working while in the chatroom. The broadcasting/job queue it where it gets stuck.(Subscription is being made to the chatroom channel,however it isn't receiving messages from the event/broadcasting).
Below is the the failed job exception.
Illuminate\Broadcasting\BroadcastException in C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Broadcasting\Broadcasters\PusherBroadcaster.php:117
Stack trace:
#0 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Broadcasting\BroadcastEvent.php(48): Illuminate\Broadcasting\Broadcasters\PusherBroadcaster->broadcast(Array, 'App\\Events\\NewC...', Array)
#1 [internal function]: Illuminate\Broadcasting\BroadcastEvent->handle(Object(Illuminate\Broadcasting\Broadcasters\PusherBroadcaster))
#2 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(29): call_user_func_array(Array, Array)
#3 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#4 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#5 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\Container.php(572): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#6 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(94): Illuminate\Container\Container->call(Array)
#7 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Illuminate\Broadcasting\BroadcastEvent))
#8 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Broadcasting\BroadcastEvent))
#9 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#10 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(Illuminate\Broadcasting\BroadcastEvent), false)
#11 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Jobs\Job.php(83): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\DatabaseJob), Array)
#12 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(327): Illuminate\Queue\Jobs\Job->fire()
#13 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(277): Illuminate\Queue\Worker->process('database', Object(Illuminate\Queue\Jobs\DatabaseJob), Object(Illuminate\Queue\WorkerOptions))
#14 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\DatabaseJob), 'database', Object(Illuminate\Queue\WorkerOptions))
#15 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(102): Illuminate\Queue\Worker->daemon('database', 'default', Object(Illuminate\Queue\WorkerOptions))
#16 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(86): Illuminate\Queue\Console\WorkCommand->runWorker('database', 'default')
#17 [internal function]: Illuminate\Queue\Console\WorkCommand->handle()
#18 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(29): call_user_func_array(Array, Array)
#19 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#20 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#21 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\Container.php(572): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#22 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Console\Command.php(183): Illuminate\Container\Container->call(Array)
#23 C:\wamp64\www\nathanreynolds\vendor\symfony\console\Command\Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#24 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Console\Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#25 C:\wamp64\www\nathanreynolds\vendor\symfony\console\Application.php(901): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 C:\wamp64\www\nathanreynolds\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))
#27 C:\wamp64\www\nathanreynolds\vendor\symfony\console\Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 C:\wamp64\www\nathanreynolds\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))
#29 C:\wamp64\www\nathanreynolds\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))
#30 C:\wamp64\www\nathanreynolds\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 {main}
Payload
{"displayName":"App\\Events\\NewChat","job":"Illuminate\\Queue\\CallQueuedHandler#call","maxTries":null,"timeout":null,"timeoutAt":null,"data":{"commandName":"Illuminate\\Broadcasting\\BroadcastEvent","command":"O:38:\"Illuminate\\Broadcasting\\BroadcastEvent\":7:{s:5:\"event\";O:18:\"App\\Events\\NewChat\":4:{s:4:\"chat\";a:5:{s:3:\"rid\";s:1:\"1\";s:5:\"owner\";s:18:\"frezknow#gmail.com\";s:4:\"body\";s:9:\"tigfdhugs\";s:10:\"created_at\";s:19:\"2019-02-16 18:04:33\";s:4:\"user\";O:8:\"stdClass\":2:{s:4:\"name\";s:15:\"Nathan Reynolds\";s:3:\"img\";s:49:\"uploads\/frezknow#gmail.com\/1550337650_DSC0140.jpg\";}}s:6:\"status\";s:6:\"public\";s:4:\"user\";O:45:\"Illuminate\\Contracts\\Database\\ModelIdentifier\":4:{s:5:\"class\";s:8:\"App\\User\";s:2:\"id\";i:1;s:9:\"relations\";a:0:{}s:10:\"connection\";s:5:\"mysql\";}s:6:\"socket\";N;}s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:0:{}}"}}
Apparently I have a connection issue, which is odd due to the fact that I can connect with no issue in my Vue component.?
https://github.com/laravel/framework/blob/5.6/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php
line 117 states
throw new BroadcastException(
is_bool($response) ? 'Failed to connect to Pusher.' : $response['body']
);
Due to the follow file (cacert.pem) not being in my PHP_versionx.x.x.x/extras/ssl/ folder as well as the file needed to be referenced in the php.ini file, it could not connect to PUSHER.
Resources
https://github.com/laravel/framework/issues/16478 Please read [shadoWalker89]'s answer.
What exactly is cacert.pem for?

Testing Laravel with jMeter.. Error reading config

I´m trying to run a performance test in a simple web developed with Laravel 5.5 as backend.
It´s a simple test, only one sample getting the home page. When the test begins, all works correctly, but earlier or later, randomly, the request gets Error 500. No matters the concurrent users, ocurrs with 2 or 10 users.
This is the plan used: jMeter Laravel-Core Simple Request JMX
Download jMeter 3.13
File > Open > Select jmx
Configure the User Defined Variables
Run test
Screenshot with a fail example with 5 users.
Reviewing the laravel.log, the error is:
[2017-11-21 14:38:16] production.ERROR: No application encryption key has been specified. {"exception":"[object] (RuntimeException(code: 0): No application encryption key has been specified. at /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:42)
[stacktrace]
#0 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Support/helpers.php(1035): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}(NULL)
#1 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(46): tap(NULL, Object(Closure))
#2 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(24): Illuminate\\Encryption\\EncryptionServiceProvider->key(Array)
#3 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(749): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}(Object(Illuminate\\Foundation\\Application), Array)
#4 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\\Container\\Container->build(Object(Closure))
#5 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(586): Illuminate\\Container\\Container->resolve('encrypter', Array)
#6 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(732): Illuminate\\Container\\Container->make('encrypter', Array)
#7 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(885): Illuminate\\Foundation\\Application->make('encrypter')
#8 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(813): Illuminate\\Container\\Container->resolveClass(Object(ReflectionParameter))
#9 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(779): Illuminate\\Container\\Container->resolveDependencies(Array)
#10 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\\Container\\Container->build('App\\\\Http\\\\Middle...')
#11 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(586): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Middle...', Array)
#12 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(732): Illuminate\\Container\\Container->make('App\\\\Http\\\\Middle...', Array)
#13 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(138): Illuminate\\Foundation\\Application->make('App\\\\Http\\\\Middle...')
#14 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#15 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#16 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(660): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#17 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#18 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(601): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#19 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(590): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#20 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#21 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#22 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(58): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#23 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#24 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#25 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/fideloper/proxy/src/TrustProxies.php(56): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#26 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#27 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#28 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#29 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#30 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#31 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#32 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#33 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#34 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#35 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#36 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#37 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#38 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#39 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#40 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#41 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#42 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#43 /opt/http-2.4.12_2/htdocs/laravel-web/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#44 {main}
"}
[2017-11-21 14:38:16] production.ERROR: No application encryption key has been specified. {"exception":"[object] (RuntimeException(code: 0): No application encryption key has been specified. at /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:42)
[stacktrace]
#0 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Support/helpers.php(1035): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}(NULL)
#1 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(46): tap(NULL, Object(Closure))
#2 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(24): Illuminate\\Encryption\\EncryptionServiceProvider->key(Array)
#3 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(749): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}(Object(Illuminate\\Foundation\\Application), Array)
#4 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\\Container\\Container->build(Object(Closure))
#5 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(586): Illuminate\\Container\\Container->resolve('encrypter', Array)
#6 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(732): Illuminate\\Container\\Container->make('encrypter', Array)
#7 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(885): Illuminate\\Foundation\\Application->make('encrypter')
#8 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(813): Illuminate\\Container\\Container->resolveClass(Object(ReflectionParameter))
#9 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(779): Illuminate\\Container\\Container->resolveDependencies(Array)
#10 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\\Container\\Container->build('App\\\\Http\\\\Middle...')
#11 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Container/Container.php(586): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Middle...', Array)
#12 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(732): Illuminate\\Container\\Container->make('App\\\\Http\\\\Middle...', Array)
#13 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(215): Illuminate\\Foundation\\Application->make('App\\\\Http\\\\Middle...')
#14 /opt/http-2.4.12_2/htdocs/laravel-web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(189): Illuminate\\Foundation\\Http\\Kernel->terminateMiddleware(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\Response))
#15 /opt/http-2.4.12_2/htdocs/laravel-web/public/index.php(60): Illuminate\\Foundation\\Http\\Kernel->terminate(Object(Illuminate\\Http\\Request), Object(Illuminate\\Http\\Response))
#16 {main}
"}
In my .env file, I have APP_ENV=local not APP_ENV=production and the APP_KEY is set correctly (all earlier requests load correctly). I tried setting APP_ENV=production, but the problem persist...
In other laravel project tested, the error is:
[2017-11-20 16:19:37] production.ERROR: PDOException: SQLSTATE[HY000] [1044] Access denied for user ''#'localhost' to database 'forge' in C:\xampp_7.0.9\htdocs\backpack-demo\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:43
Stack trace:
#0 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php(43): PDO->__construct('mysql:host=loca...', 'forge', '', Array)
#1 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php(116): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'forge', '', Array)
#2 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php(56): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=loca...', 'forge', '', Array)
#3 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connectors\MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#4 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connectors\ConnectionFactory.php(61): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#6 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connection.php(956): call_user_func(Object(Closure))
#7 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connection.php(824): Illuminate\Database\Connection->getPdo()
#8 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connection.php(709): Illuminate\Database\Connection->reconnectIfMissingConnection()
#9 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connection.php(351): Illuminate\Database\Connection->run('select column_n...', Array, Object(Closure))
#10 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Schema\MySqlBuilder.php(38): Illuminate\Database\Connection->select('select column_n...', Array)
#11 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php(238): Illuminate\Database\Schema\MySqlBuilder->getColumnListing('settings')
#12 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\backpack\settings\src\SettingsServiceProvider.php(29): Illuminate\Support\Facades\Facade::__callStatic('getColumnListin...', Array)
#13 [internal function]: Backpack\Settings\SettingsServiceProvider->boot()
#14 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Container\Container.php(507): call_user_func_array(Array, Array)
#15 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(759): Illuminate\Container\Container->call(Array)
#16 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(742): Illuminate\Foundation\Application->bootProvider(Object(Backpack\Settings\SettingsServiceProvider))
#17 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Backpack\Settings\SettingsServiceProvider), 25)
#18 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(743): array_walk(Array, Object(Closure))
#19 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\BootProviders.php(17): Illuminate\Foundation\Application->boot()
#20 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(203): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#21 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(253): Illuminate\Foundation\Application->bootstrapWith(Array)
#22 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(144): Illuminate\Foundation\Http\Kernel->bootstrap()
#23 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#24 C:\xampp_7.0.9\htdocs\backpack-demo\public\index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#25 {main}
Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[HY000] [1044] Access denied for user ''#'localhost' to database 'forge' in C:\xampp_7.0.9\htdocs\backpack-demo\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:47
Stack trace:
#0 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php(116): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'forge', '', Array)
#1 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php(56): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=loca...', 'forge', '', Array)
#2 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connectors\MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#3 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connectors\ConnectionFactory.php(61): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#5 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connection.php(956): call_user_func(Object(Closure))
#6 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connection.php(824): Illuminate\Database\Connection->getPdo()
#7 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connection.php(709): Illuminate\Database\Connection->reconnectIfMissingConnection()
#8 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Connection.php(351): Illuminate\Database\Connection->run('select column_n...', Array, Object(Closure))
#9 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Database\Schema\MySqlBuilder.php(38): Illuminate\Database\Connection->select('select column_n...', Array)
#10 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php(238): Illuminate\Database\Schema\MySqlBuilder->getColumnListing('settings')
#11 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\backpack\settings\src\SettingsServiceProvider.php(29): Illuminate\Support\Facades\Facade::__callStatic('getColumnListin...', Array)
#12 [internal function]: Backpack\Settings\SettingsServiceProvider->boot()
#13 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Container\Container.php(507): call_user_func_array(Array, Array)
#14 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(759): Illuminate\Container\Container->call(Array)
#15 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(742): Illuminate\Foundation\Application->bootProvider(Object(Backpack\Settings\SettingsServiceProvider))
#16 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Backpack\Settings\SettingsServiceProvider), 25)
#17 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(743): array_walk(Array, Object(Closure))
#18 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\BootProviders.php(17): Illuminate\Foundation\Application->boot()
#19 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(203): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#20 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(253): Illuminate\Foundation\Application->bootstrapWith(Array)
#21 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(144): Illuminate\Foundation\Http\Kernel->bootstrap()
#22 C:\xampp_7.0.9\htdocs\backpack-demo\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#23 C:\xampp_7.0.9\htdocs\backpack-demo\public\index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#24 {main}
So, I think, the problem it´s that sometimes, the config read fails and get the default values especifies in the config/app.php.
Has anyone had this problem or can test a Laravel project with the jmx provided?
Thanks!
This is a laravel configuration issue:
You need to execute php artisan config:cache command. and check env configuration.
Add an env configuration option to your app.php configuration file that looks like the following:
'env' => env('APP_ENV', 'production'),
Caching And Env
If you are using the config:cache command during deployment, you must make sure that you are only calling the env function from within your configuration files, and not from anywhere else in your application.
If you are calling envfrom within your application, it is strongly recommended you add proper configuration values to your configuration files and call env from that location instead, allowing you to convert your env calls to config calls.

Magento Card Payments with Paypal Pro Giving Error

When completing a card purchase I get the following error:
There was an error processing your order. Please contact us or try again later.
The Magento error log is here:
exception 'Exception' with message 'Notice: Array to string conversion in /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php on line 1060' in /home/luluinth/public_html/app/code/local/Mage/Core/functions.php:247
Stack trace:
#0 [internal function]: mageCoreErrorHandler(8, 'Array to string...', '/home/luluinth/...', 1060, Array)
#1 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(1060): sprintf('PayPal NVP gate...', Array, '4f0c10ba893f2', '72.0')
#2 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(1008): Mage_Paypal_Model_Api_Nvp->_handleCallErrors(Array)
#3 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Api/Nvp.php(659): Mage_Paypal_Model_Api_Nvp->call('DoDirectPayment', Array)
#4 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Direct.php(343): Mage_Paypal_Model_Api_Nvp->callDoDirectPayment()
#5 /home/luluinth/public_html/app/code/core/Mage/Paypal/Model/Direct.php(202): Mage_Paypal_Model_Direct->_placeOrder(Object(Mage_Sales_Model_Order_Payment), '12')
#6 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(443): Mage_Paypal_Model_Direct->capture(Object(Mage_Sales_Model_Order_Payment), '12')
#7 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Invoice.php(385): Mage_Sales_Model_Order_Payment->capture(Object(Mage_Sales_Model_Order_Invoice))
#8 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(608): Mage_Sales_Model_Order_Invoice->capture()
#9 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(410): Mage_Sales_Model_Order_Payment->_invoice()
#10 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(348): Mage_Sales_Model_Order_Payment->capture(NULL)
#11 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order.php(886): Mage_Sales_Model_Order_Payment->place()
#12 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Order.php(1104): Mage_Sales_Model_Order->_placePayment()
#13 [internal function]: Mage_Sales_Model_Order->place()
#14 /home/luluinth/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(105): call_user_func(Array)
#15 /home/luluinth/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks()
#16 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#17 /home/luluinth/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#18 /home/luluinth/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php(785): Mage_Sales_Model_Service_Quote->submitAll()
#19 /home/luluinth/public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php(579): Mage_Checkout_Model_Type_Onepage->saveOrder()
#20 /home/luluinth/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->saveOrderAction()
#21 /home/luluinth/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#22 /home/luluinth/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#23 /home/luluinth/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#24 /home/luluinth/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#25 /home/luluinth/public_html/index.php(98): Mage::run('', 'store')
#26 {main}
You're trying to cast $value as a string for the comparison, but $value is an array. If $value has some kind of value you need in it (perhaps it's nested inside an array) for the comparison, then you must process it so that it is not array.
Go to that nvp.php file and do this before the if statement.
var_dump($value); die;
Or
Mage::log($value); // Check var/log/system.log with logging enabled
And just examine how the data is structured in $value. Make it into a string variable.
Here $value is a variable you can put the variable from the line number that exception is generated.
Check this and let me know if it works.

Magento 2 Error message when flushing cache

I'm running Magento 2.0.7. When I'm in the backend and I try to flush the cache using "Flush Megento Cache" or selecting all cache folders and click refresh I get a white pack with the below error:
There has been an error processing your request Exception printing is disabled by default for security reasons.
Error log record number: 707031421789
The website continues to function, and Magento recognises that cache is cleared as the notification disappears. But it's annoying and I don't know if its actually clearing all cache or not
The error report shows the below detail:
a:4:{i:0;s:166:"Warning: is_file() expects parameter 1 to be a valid path, string given in /var/www/vhosts/tbfdirect.co.uk/httpdocs/lib/internal/Cm/Cache/Backend/File.php on line 508";i:1;s:8000:"#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'is_file() expec...', '/var/www/vhosts...', 508, Array)
#1 /var/www/vhosts/tbfdirect.co.uk/httpdocs/lib/internal/Cm/Cache/Backend/File.php(508): is_file('/var/www/vhosts...')
#2 /var/www/vhosts/tbfdirect.co.uk/httpdocs/lib/internal/Cm/Cache/Backend/File.php(222): Cm_Cache_Backend_File->_cleanNew('matchingTag', Array)
#3 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/zendframework1/library/Zend/Cache/Core.php(465): Cm_Cache_Backend_File->clean('matchingTag', Array)
#4 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Cache/Core.php(98): Zend_Cache_Core->clean('matchingTag', Array)
#5 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(79): Magento\Framework\Cache\Core->clean('matchingTag', Array)
#6 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(91): Magento\Framework\Cache\Frontend\Adapter\Zend->clean('matchingTag', Array)
#7 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Cache/Frontend/Decorator/TagScope.php(73): Magento\Framework\Cache\Frontend\Decorator\Bare->clean('matchingTag', Array)
#8 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(91): Magento\Framework\Cache\Frontend\Decorator\TagScope->clean('all', Array)
#9 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Cache/Frontend/Decorator/Logger.php(47): Magento\Framework\Cache\Frontend\Decorator\Bare->clean('all', Array, 'all')
#10 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/module-backend/Controller/Adminhtml/Cache/FlushSystem.php(20): Magento\Framework\Cache\Frontend\Decorator\Logger->clean()
#11 /var/www/vhosts/tbfdirect.co.uk/httpdocs/var/generation/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem/Interceptor.php(25): Magento\Backend\Controller\Adminhtml\Cache\FlushSystem->execute()
#12 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/App/Action/Action.php(102): Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->execute()
#13 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#14 [internal function]: Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#15 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#16 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->___callParent('dispatch', Array)
#17 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor), Array, 'adminAuthentica...')
#18 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#19 [internal function]: Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#20 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array)
#21 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor), Array, 'designLoader')
#22 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/App/Action/Plugin/Design.php(39): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#23 [internal function]: Magento\Framework\App\Action\Plugin\Design->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#24 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array)
#25 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor), Array, 'adminMassaction...')
#26 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#27 [internal function]: Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#28 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array)
#29 /var/www/vhosts/tbfdirect.co.uk/httpdocs/var/generation/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem/Interceptor.php(40): Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->___callPlugins('dispatch', Array, Array)
#30 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/App/FrontController.php(55): Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#31 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#32 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#33 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#34 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#35 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#36 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#37 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array)
#38 /var/www/vhosts/tbfdirect.co.uk/httpdocs/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#39 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#40 /var/www/vhosts/tbfdirect.co.uk/httpdocs/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#41 /var/www/vhosts/tbfdirect.co.uk/httpdocs/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#42 {main}";s:3:"url";s:107:"/admin_bb88q1/admin/cache/flushSystem/key/3ea674fce8bdcfd57376928bc89c1f15f7e9664b76cf642ea78f5d76fe4a90da/";s:11:"script_name";s:10:"/index.php";}
This refers to line 508 of file.php which has the below
I'm sure you've long since solved this but for posterity I have just fixed a very similar problem by deleting the contents of var/cache. Since you are trying to clear caches anyway this should have no side effects.

Laravel Log Truncation

I'm getting an error back on an API scraping service I've setup due to the API source changing some element on their end. I've been working my way through trying to sort it all out, but I'm stuck on a particular object conversion error. When I try to look in the logs at what it's choking on, the relevant data is getting truncated. Any idea how to undo that? Here is my stack trace:
[2016-02-26 17:47:55] local.ERROR: exception 'ErrorException' with message 'Object of class stdClass could not be converted to string' in /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Support/helpers.php:671
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(4096, 'Object of class...', '/var/www/myapp....', 671, Array)
#1 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Support/helpers.php(671): preg_replace('/\?/', 'Object', 'insert into `pr...', 1)
#2 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/QueryException.php(56): str_replace_array('\?', Array, 'insert into `pr...')
#3 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/QueryException.php(39): Illuminate\Database\QueryException->formatMessage('insert into `pr...', Array, Object(ErrorException))
#4 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Connection.php(633): Illuminate\Database\QueryException->__construct('insert into `pr...', Array, Object(ErrorException))
#5 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Connection.php(591): Illuminate\Database\Connection->runQueryCallback('insert into `pr...', Array, Object(Closure))
#6 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Connection.php(381): Illuminate\Database\Connection->run('insert into `pr...', Array, Object(Closure))
#7 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Connection.php(337): Illuminate\Database\Connection->statement('insert into `pr...', Array)
#8 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php(32): Illuminate\Database\Connection->insert('insert into `pr...', Array)
#9 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1735): Illuminate\Database\Query\Processors\Processor->processInsertGetId(Object(Illuminate\Database\Query\Builder), 'insert into `pr...', Array, 'id')
#10 [internal function]: Illuminate\Database\Query\Builder->insertGetId(Array, 'id')
#11 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(940): call_user_func_array(Array, Array)
#12 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1584): Illuminate\Database\Eloquent\Builder->__call('insertGetId', Array)
#13 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1584): Illuminate\Database\Eloquent\Builder->insertGetId(Array, 'id')
#14 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1555): Illuminate\Database\Eloquent\Model->insertAndSetId(Object(Illuminate\Database\Eloquent\Builder), Array)
#15 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1461): Illuminate\Database\Eloquent\Model->performInsert(Object(Illuminate\Database\Eloquent\Builder), Array)
#16 /var/www/myapp/htdocs/app/RevelModel.php(87): Illuminate\Database\Eloquent\Model->save()
#17 [internal function]: App\RevelModel::scrapData(Array)
#18 /var/www/myapp/htdocs/app/Console/Commands/Fetcher.php(61): call_user_func('App\Revel\Entit...', Array)
#19 [internal function]: App\Console\Commands\Fetcher->handle()
#20 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Container/Container.php(502): call_user_func_array(Array, Array)
#21 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Console/Command.php(149): Illuminate\Container\Container->call(Array)
#22 /var/www/myapp/htdocs/vendor/symfony/console/Command/Command.php(259): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Console/Command.php(135): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/myapp/htdocs/vendor/symfony/console/Application.php(878): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /var/www/myapp/htdocs/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\Fetcher), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /var/www/myapp/htdocs/vendor/symfony/console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/myapp/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(98): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /var/www/myapp/htdocs/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 {main}
See how on line #2 the DB query in question is truncated with elipses? Is there any way to turn that off so I can see the entire query?
Thanks in advance for your help.

Categories