Getting [Guzzle\Http\Exception\RequestException] Error completing request - php

I wrote a simple script to download some .JPG files and reupload them to Amazon S3. It works almost every time but every once in a while I'm getting the error:
[Guzzle\Http\Exception\RequestException]
Error completing request
Since the error doesn't tell me much, where would I find more information as to what is causing the error. I don't even know if it is in the downloading of my files from the FTP server, the renaming, or the uploading to S3. Very confused on this error.
EDIT
Following the advice below, I added in the catch portion but I'm not sure what that's telling me exactly. This script is downloading jpg's and then uploading them to Amazon S3. Here's what the Catch is providing:
#0 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(378): Guzzle\Http\Message\Request->processResponse(Array)
#1 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php(49): Guzzle\Http\Message\Request->setState('complete', Array)
#2 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(286): Guzzle\Http\Message\EntityEnclosingRequest->setState('complete', Array)
#3 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(244): Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array)
#4 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(227): Guzzle\Http\Curl\CurlMulti->processMessages()
#5 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(211): Guzzle\Http\Curl\CurlMulti->executeHandles()
#6 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(105): Guzzle\Http\Curl\CurlMulti->perform()
#7 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMultiProxy.php(91): Guzzle\Http\Curl\CurlMulti->send()
#8 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Http/Client.php(282): Guzzle\Http\Curl\CurlMultiProxy->send()
#9 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/aws/aws-sdk-php/src/Aws/Common/Client/AbstractClient.php(284): Guzzle\Http\Client->send(Object(Guzzle\Http\Message\EntityEnclosingRequest))
#10 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(136): Aws\Common\Client\AbstractClient->send(Object(Guzzle\Http\Message\EntityEnclosingRequest))
#11 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(153): Guzzle\Service\Client->execute(Object(Aws\S3\Command\S3Command))
#12 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(189): Guzzle\Service\Command\AbstractCommand->execute()
#13 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(76): Guzzle\Service\Command\AbstractCommand->getResult()
#14 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/aws/aws-sdk-php/src/Aws/Common/Client/AbstractClient.php(105): Guzzle\Service\Client->__call('PutObject', Array)
#15 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/app/commands/ProcessListings.php(156): Aws\Common\Client\AbstractClient->__call('putObject', Array)
#16 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/app/commands/ProcessListings.php(156): Aws\S3\S3Client->putObject(Array)
#17 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/app/commands/ProcessListings.php(137): ProcessListings->UploadImageToS3('naples', '213506540', '213506540-naple...', 'app/processing/...')
#18 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/app/commands/ProcessListings.php(72): ProcessListings->DownloadImages('naples', '213506540', 'http://extimage...', '213506540-naple...', 12)
#19 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/laravel/framework/src/Illuminate/Console/Command.php(108): ProcessListings->fire()
#20 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(244): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/laravel/framework/src/Illuminate/Console/Command.php(96): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/symfony/console/Symfony/Component/Console/Application.php(898): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/symfony/console/Symfony/Component/Console/Application.php(191): Symfony\Component\Console\Application->doRunCommand(Object(ProcessListings), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/vendor/symfony/console/Symfony/Component/Console/Application.php(121): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /Volumes/Data/Users/chrisfarrugia/Sites/listingnaples.com/artisan(59): Symfony\Component\Console\Application->run()
#26 {main}

Related

PHP Laravel Exception handler issue or something else

I upgraded my application from laravel 5 to 6 and PHP version from 7 to 8.0, after upgrading I faced below pasted error and there is not abnormal behavior observed in web application and web app is working fine.I can't investigate the because of this error.
I will appreciate laravel community to help me out in this regard.
Thanks
Error:
Error Type : General Application Error
DateTime : 2023-01-13 03:03:20 Message : File Name : RouteCollection.php Error Trace : #0 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\RouteCollection->match() #1 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\Routing\Router->findRoute() #2 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\Routing\Router->dispatchToRoute() #3 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\Routing\Router->dispatch() #4 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}() #5 /var/www/html/laravel/vendor/proengsoft/laravel-jsvalidation/src/RemoteValidationMiddleware.php(61): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #6 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Proengsoft\JsValidation\RemoteValidationMiddleware->handle() #7 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #8 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() #9 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #10 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() #11 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #12 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle() #13 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #14 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle() #15 /var/www/html/laravel/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #16 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle() #17 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #18 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Pipeline\Pipeline->then() #19 /var/www/html/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() #20 /var/www/html/laravel/public/index.php(55): Illuminate\Foundation\Http\Kernel->handle() #21 {main} Line Number : 179
I tried to many hit and try by googling same error to stop it but unfortunately it didnt works for me.

Plesk reports that updates were not installed for the following items

I received this message yesterday on email from Plesk and there are a lot of items listed.
It appears to be to do largely with Wordpress Toolkit on the server. Plesk is the interface I use on my Ionos Hosted Server.
Sites are working from the server ok but obviously updates will not happen whilst these errors are present.
Does anyone have a clue what could be causing this and how to fix it please.
Thanks
Website "eeeSafe Community Safety Sustainability and Skills" (https://eeesafe.com): PHP Fatal error: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php:418
Stack trace:
#0 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(418): date()
#1 [internal function]: Cron_Event_Command::format_event()
#2 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(460): array_map()
#3 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(366): Cron_Event_Command::get_cron_events()
#4 [internal function]: Cron_Event_Command->delete()
#5 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
#6 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}()
#7 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
#8 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(419): WP_CLI\Dispatcher\Subcommand->invoke()
#9 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php(1443): WP_CLI\Runner->run_command()
#10 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/plesk/wp-cli-toolkit-command/src/Wpt_Cron_Command.php(30): WP_CLI::run_command()
#11 [internal function]: Wpt_Cron_Command->reschedule()
#12 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
#13 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}()
#14 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
#15 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(419): WP_CLI\Dispatcher\Subcommand->invoke()
#16 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(442): WP_CLI\Runner->run_command()
#17 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1276): WP_CLI\Runner->run_command_and_exit()
#18 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#19 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process()
#20 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#21 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php(17): require_once('...')
#22 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wpt-wp-cli.php(31): require_once('...')
#23 {main}
thrown in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php on line 418
Fatal error: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php:418
Stack trace:
#0 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(418): date()
#1 [internal function]: Cron_Event_Command::format_event()
#2 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(460): array_map()
#3 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(366): Cron_Event_Command::get_cron_events()
#4 [internal function]: Cron_Event_Command->delete()
#5 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
#6 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}()
#7 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
#8 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(419): WP_CLI\Dispatcher\Subcommand->invoke()
#9 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/class-wp-cli.php(1443): WP_CLI\Runner->run_command()
#10 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/plesk/wp-cli-toolkit-command/src/Wpt_Cron_Command.php(30): WP_CLI::run_command()
#11 [internal function]: Wpt_Cron_Command->reschedule()
#12 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
#13 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}()
#14 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
#15 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(419): WP_CLI\Dispatcher\Subcommand->invoke()
#16 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(442): WP_CLI\Runner->run_command()
#17 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1276): WP_CLI\Runner->run_command_and_exit()
#18 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#19 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process()
#20 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#21 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php(17): require_once('...')
#22 /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wpt-wp-cli.php(31): require_once('...')
#23 {main}
thrown in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php on line 418
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
I thought it might be something to do with enablin mysqli on my server, where Plesk Web Pro is being used.
I can't find how to do that, but not convinced yet that this might be the answer.

Laravel 6 | Undefined property: Illuminate\Notifications\ChannelManager::$container

Recently I've upgraded Laravel from 5.8 to 6.0 and made some adjusts to make it running smoothly.
In my local environment, it works fine. But when I publish in my server, when I try to send some notifications (mail and broadcast) I receive the following error:
ErrorException: Undefined property: Illuminate\Notifications\ChannelManager::$container in /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php:53
Stack trace:
#0 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php(53): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined prope...', '/var/www/vialoc...', 53, Array)
#1 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php(73): Illuminate\Notifications\ChannelManager->sendNow(Object(App\Models\User), Object(App\Notifications\UserConfirmationNotification), Array)
#2 [internal function]: Illuminate\Notifications\SendQueuedNotifications->handle(Object(Illuminate\Notifications\ChannelManager))
#3 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#4 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#5 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#6 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Container/Container.php(580): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#7 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array)
#8 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Illuminate\Notifications\SendQueuedNotifications))
#9 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Notifications\SendQueuedNotifications))
#10 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#11 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(83): Illuminate\Bus\Dispatcher->dispatchNow(Object(Illuminate\Notifications\SendQueuedNotifications), false)
#12 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}(Object(Illuminate\Notifications\SendQueuedNotifications))
#13 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Notifications\SendQueuedNotifications))
#14 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(85): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#15 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(59): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Notifications\SendQueuedNotifications))
#16 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(88): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#17 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(327): Illuminate\Queue\Jobs\Job->fire()
#18 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(277): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Queue\WorkerOptions))
#19 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Illuminate\Queue\WorkerOptions))
#20 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(102): Illuminate\Queue\Worker->daemon('redis', 'vialoc-api,defa...', Object(Illuminate\Queue\WorkerOptions))
#21 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(86): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'vialoc-api,defa...')
#22 [internal function]: Illuminate\Queue\Console\WorkCommand->handle()
#23 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#24 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#25 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#26 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Container/Container.php(580): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#27 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)
#28 /var/www/vialoc_api/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#29 /var/www/vialoc_api/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))
#30 /var/www/vialoc_api/vendor/symfony/console/Application.php(908): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /var/www/vialoc_api/vendor/symfony/console/Application.php(269): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 /var/www/vialoc_api/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 /var/www/vialoc_api/vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#34 /var/www/vialoc_api/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))
#35 /var/www/vialoc_api/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#36 {main}
And one note: To upgrade to Laravel 6 on my server, I needed to upgrade to PHP 7.2. I've done this and I think there is some PHP module missing. But I'm stuck to resolve this issue.
To notifications, I'm using Redis for Queue. And I've tried to sent the emails through mailtrap and mailgun, but the response is the same.
Please someone can help me? Tks a lot in advance.
I've discovered the problem.
My queue was being managed by a supervisor process. And with the upgrade and the code change, the process didn't update the code being processed.
When I ran the following command:
sudo supervisorctl restart all
Everything starts working again.
Running composer install on your server should list any missing modules.

Laravel SQLSTATE[HY000] [2002] Connection refused but tinker works

I have a production site using Database from an Amazon Server, I have two more sites on the same server and both of them connects without issues.
On this particular site the connection to mysql is not working, I thought that the env file was missing or not being see by the laravel app but is not the case, when I run php artisan tinker and try any command it works:
DB::table('categories')->get();
=> Illuminate\Support\Collection {#842
all: [
{#828
+"id": 1,
+"parent_id": null,
+"order": 1,
+"name": "Noticias",
+"slug": "noticias",
+"created_at": "2018-01-09 19:26:32",
+"updated_at": "2018-01-09 19:26:32",
},
],
}
The App::environment() method also works:
>>> App::environment();
=> "production"
The env files clearly says APP_DEBUG=false but it is returning a lot of debug, it is like the webserver is not reading the env file besides the artisan is.
This is driving me crazy because it started failing by itself, nothing was changed on the server or the code, it's the only project that is failing.
What else can I check?
[2018-08-25 12:22:04] production.ERROR: SQLSTATE[HY000] [2002] Connection refused {"exception":"[object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:67)
[stacktrace]
#0 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(67): PDO->__construct('mysql:host=127....', 'root', 'C4f2469dcF!', Array)
#1 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(43): Illuminate\\Database\\Connectors\\Connector->createPdoConnection('mysql:host=127....', 'root', 'C4f2469dcF!', Array)
#2 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\\Database\\Connectors\\Connector->createConnection('mysql:host=127....', Array, Array)
#3 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(183): Illuminate\\Database\\Connectors\\MySqlConnector->connect(Array)
#4 [internal function]: Illuminate\\Database\\Connectors\\ConnectionFactory->Illuminate\\Database\\Connectors\\{closure}()
#5 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connection.php(915): call_user_func(Object(Closure))
#6 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connection.php(940): Illuminate\\Database\\Connection->getPdo()
#7 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connection.php(399): Illuminate\\Database\\Connection->getReadPdo()
#8 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connection.php(325): Illuminate\\Database\\Connection->getPdoForSelect(true)
#9 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connection.php(657): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}('select * from `...', Array)
#10 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\\Database\\Connection->runQueryCallback('select * from `...', Array, Object(Closure))
#11 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Connection.php(333): Illuminate\\Database\\Connection->run('select * from
`...', Array, Object(Closure))
#12 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1719): Illuminate\\Database\\Connection->select('select
* from `...', Array, true)
#13 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1704): Illuminate\\Database\\Query\\Builder->runSelect()
#14 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(483): Illuminate\\Database\\Query\\Builder->get(Array)
#15 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(467): Illuminate\\Database\\Eloquent\\Builder->getModels(Array)
#16 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(360): Illuminate\\Database\\Eloquent\\Builder->get(Array)
#17 /var/app/html/releases/20180824022105/app/Category.php(13): Illuminate\\Database\\Eloquent\\Model::all()
#18 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(327): App\\Category::App\\{closure}()
#19 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(304): Illuminate\\Cache\\Repository->remember('list-categories', NULL, Object(Closure))
#20 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\\Cache\\CacheManager->__call('remember', Array)
#21 /var/app/html/releases/20180824022105/app/Category.php(20): Illuminate\\Support\\Facades\\Facade::__callStatic('remember', Array)
#22 /var/app/html/releases/20180824022105/routes/web.php(150): App\\Category::getCategories()
#23 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Routing/Router.php(389): Illuminate\\Routing\\Router->{closure}(Object(Illuminate\\Routing\\Router))
#24 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Routing/Router.php(349): Illuminate\\Routing\\Router->loadRoutes(Object(Closure))
#25 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\\Routing\\Router->group(Array, Object(Closure))
#26 /var/app/html/releases/20180824022105/routes/web.php(162): Illuminate\\Support\\Facades\\Facade::__callStatic('group', Array)
#27 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Routing/Router.php(393): require('/var/www/turico...')
#28 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Routing/Router.php(349): Illuminate\\Routing\\Router->loadRoutes('/var/www/turico...')
#29 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Routing/RouteRegistrar.php(105): Illuminate\\Routing\\Router->group(Array, '/var/www/turico...')
#30 /var/app/html/releases/20180824022105/app/Providers/RouteServiceProvider.php(56): Illuminate\\Routing\\RouteRegistrar->group('/var/www/turico...')
#31 /var/app/html/releases/20180824022105/app/Providers/RouteServiceProvider.php(40): App\\Providers\\RouteServiceProvider->mapWebRoutes()
#32 [internal function]: App\\Providers\\RouteServiceProvider->map()
#33 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#34 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#35 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#36 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#37 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php(74): Illuminate\\Container\\Container->call(Array)
#38 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php(33): Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider->loadRoutes()
#39 /var/app/html/releases/20180824022105/app/Providers/RouteServiceProvider.php(28): Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider->boot()
#40 [internal function]: App\\Providers\\RouteServiceProvider->boot()
#41 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#42 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#43 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#44 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#45 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(792): Illuminate\\Container\\Container->call(Array)
#46 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\\Foundation\\Application->bootProvider(Object(App\\Providers\\RouteServiceProvider))
#47 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}(Object(App\\Providers\\RouteServiceProvider), 26)
#48 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(776): array_walk(Array, Object(Closure))
#49 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#50 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(213): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(Object(Illuminate\\Foundation\\Application))
#51 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(162): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#52 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(146): Illuminate\\Foundation\\Http\\Kernel->bootstrap()
#53 /var/app/html/releases/20180824022105/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#54 /var/app/html/releases/20180824022105/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#55 {main}
"}
You should verify if you have bootstrap/cache/config.php file. If yes, it means, your config is cached. Than you can run:
php artisan config:cache
to refresh config and sync data you have set in .env or
php artisan config:clear
if you don't want to use cached config (keep in mind it's recommended to cache config on production)
The solution for me was to restart the laravel development server, ie: run php artisan serve again.
I had changed the db config after I had originally run the dev server.
I had a similar problem, I installed php7.2-mysql after I installed everything else. Tinker was working perfectly but my application would not connect.
I spent 2 hours trying to debug until a simple apache restart did the trick.
The problem is that mysql's root user can't be used anymore, since mysql v5.7. More about this here.

Can't connect to local MySQL server error on Magento

My website uses Magento and is hosted on Godaddy. It was working fine till yesterday but today, it is showing the following error :
There has been an error processing your request
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Trace:
#0 /home/greenveggy/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(109): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/greenveggy/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/greenveggy/public_html/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/greenveggy/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/greenveggy/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14 /home/greenveggy/public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
#18 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#19 /home/greenveggy/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 /home/greenveggy/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/greenveggy/public_html/index.php(87): Mage::run('', 'store')
#22 {main}
How do i resolve this ?
you can use the tool n98-magerun.phar (link) with task sys:check to test yout db-connection
you have to copy the file to path /home/greenveggy/public_html/ and make it executable
then cd to this path and execute ./n98-magerun.phar sys:check
if the connection fails check your properties in /home/greenveggy/public_html/app/etc/local.xml
Pressing the "check" button for the Database solved the problem. Site is functional again. Can anyone explain what just happened?

Categories