error while running php artisan backup:run - php

Hi every one I am currently working on laravel 5.8 and recently installed spatie/laravel-backup package to backup my files and db and i did all the steps which are needed to use the package but when I run the command
php artisan backup:run it gives many errors as below
Starting backup... Dumping database u452010341_qkcg... Backup failed
because The dump process failed with exitcode 1 : General error :
'"mysqldump"' is not recognized as an internal or external command,
operable program or batch file.
#0 C:\xampp\htdocs\b\vendor\spatie\db-dumper\src\DbDumper.php(246): Spatie\DbDumper\Exceptions\DumpFailed::processDidNotEndSuccessfully(Object(Symfony\Component\Process\Process))
#1 C:\xampp\htdocs\b\vendor\spatie\db-dumper\src\Databases\MySql.php(190): Spatie\DbDumper\DbDumper->checkIfDumpWasSuccessFul(Object(Symfony\Component\Process\Process), 'C:\\xampp\\htdocs...')
#2 C:\xampp\htdocs\b\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(250): Spatie\DbDumper\Databases\MySql->dumpToFile('C:\\xampp\\htdocs...')
#3 [internal function]: Spatie\Backup\Tasks\Backup\BackupJob->Spatie\Backup\Tasks\Backup\{closure}(Object(Spatie\DbDumper\Databases\MySql), 'mysql')
#4 C:\xampp\htdocs\b\vendor\laravel\framework\src\Illuminate\Support\Collection.php(1120): array_map(Object(Closure), Array, Array)
#5 C:\xampp\htdocs\b\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(253): Illuminate\Support\Collection->map(Object(Closure))
#6 C:\xampp\htdocs\b\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(167): Spatie\Backup\Tasks\Backup\BackupJob->dumpDatabases()
#7 C:\xampp\htdocs\b\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(143): Spatie\Backup\Tasks\Backup\BackupJob->createBackupManifest()
#8 C:\xampp\htdocs\b\vendor\spatie\laravel-backup\src\Commands\BackupCommand.php(52): Spatie\Backup\Tasks\Backup\BackupJob->run()
#9 [internal function]: Spatie\Backup\Commands\BackupCommand->handle()
#10 C:\xampp\htdocs\b\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(32): call_user_func_array(Array, Array)
#11 C:\xampp\htdocs\b\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(90): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#12 C:\xampp\htdocs\b\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#13 C:\xampp\htdocs\b\vendor\laravel\framework\src\Illuminate\Container\Container.php(576): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#14 C:\xampp\htdocs\b\vendor\laravel\framework\src\Illuminate\Console\Command.php(183): Illuminate\Container\Container->call(Array)
#15 C:\xampp\htdocs\b\vendor\symfony\console\Command\Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#16 C:\xampp\htdocs\b\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))
#17 C:\xampp\htdocs\b\vendor\spatie\laravel-backup\src\Commands\BaseCommand.php(16): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 C:\xampp\htdocs\b\vendor\symfony\console\Application.php(1012): Spatie\Backup\Commands\BaseCommand->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 C:\xampp\htdocs\b\vendor\symfony\console\Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(Spatie\Backup\Commands\BackupCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 C:\xampp\htdocs\b\vendor\symfony\console\Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 C:\xampp\htdocs\b\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))
#22 C:\xampp\htdocs\b\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(133): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 C:\xampp\htdocs\b\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 {main}
Backup failed because: The dump process failed with exitcode 1 : General error : '"mysqldump"' is not recognized as an internal or external command,
operable program or batch file.
I searched for solutions and found the code below:
'connections' => [
'mysql' => [
'driver' => 'mysql'
...,
'dump' => [
'dump_binary_path' => '/path/to/the/binary', // only the path, so without `mysqldump` or `pg_dump`
'use_single_transaction',
'timeout' => 60 * 5, // 5 minute timeout
'exclude_tables' =>['table1', 'table2'],`enter code here`
'add_extra_option' =>'--optionname=optionvalue',
]
],
But still I'm getting same error... I tried more than 100times, still nothing.
So any one who gone through this problem or any body who knows how to solve this please help me out.

in the code you found, where says:
'dump_binary_path' => '/path/to/the/binary',
Change to:
'dump_binary_path' => 'C:\xampp\mysql\bin',
Next time, look to the errors because int his case, the problem is well described!
Regards

Now you also need to comment this line:
//'add_extra_option' =>'--optionname=optionvalue',
working for me.

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.

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.

Error message: "MemCache requires PHP memcache extension to be loaded." after migration.

From phpinfo():
phpinfo, memcache is loaded
However, when I try to migrate, show this error:
Exception 'yii\base\InvalidConfigException' with message 'MemCache requires PHP memcache extension to be loaded.'
in /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/caching/MemCache.php:217
Stack trace:
#0 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/caching/MemCache.php(113): yii\caching\MemCache->getMemcache()
#1 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/base/Object.php(107): yii\caching\MemCache->init()
#2 [internal function]: yii\base\Object->__construct(Array)
#3 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/di/Container.php(372): ReflectionClass->newInstanceArgs(Array)
#4 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/di/Container.php(151): yii\di\Container->build('yii\\caching\\Mem...', Array, Array)
#5 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/BaseYii.php(344): yii\di\Container->get('yii\\caching\\Mem...', Array, Array)
#6 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/di/ServiceLocator.php(133): yii\BaseYii::createObject(Array)
#7 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/db/Schema.php(275): yii\di\ServiceLocator->get('cache', false)
#8 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/db/Migration.php(71): yii\db\Schema->refresh()
#9 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/base/Object.php(107): yii\db\Migration->init()
#10 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/console/controllers/MigrateController.php(113): yii\base\Object->__construct(Array)
#11 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(491): yii\console\controllers\MigrateController->createMigration('m170316_221710_...')
#12 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(129): yii\console\controllers\BaseMigrateController->migrateUp('m170316_221710_...')
#13 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#14 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)
#15 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/base/Controller.php(151): yii\base\InlineAction->runWithParams(Array)
#16 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/console/Controller.php(91): yii\base\Controller->runAction('', Array)
#17 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/base/Module.php(455): yii\console\Controller->runAction('', Array)
#18 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/console/Application.php(167): yii\base\Module->runAction('migrate', Array)
#19 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/console/Application.php(143): yii\console\Application->runAction('migrate', Array)
#20 /Library/WebServer/Documents/r2d2/vendor/yiisoft/yii2/base/Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))
#21 /Library/WebServer/Documents/r2d2/yii(27): yii\base\Application->run()
#22 {main}
Could someone help me find out why?
Thanks!
The error is from console application and phpinfo output is from webserver. So, you basically enabled memcache module for webserver but didn't for console. To give exact solution more information about your setup is needed: what do you​ use, php-fpm, modapache? Please provide full phpinfo output either from web and cli
UPDATE
Check which directories your console PHP scans for additional ini-files:
php -i | grep "Scan this dir for additional .ini files"
Then you need to put configuration file (for example memcache.ini) with module config into one of those. Content should be like:
extension=memcache.so
You can check the one webserver uses for reference.
If you use memcached instead memcache, then you need to add this line to config/console.php:
'useMemcached' => true,
it should look like:
'components' => [
'cache' => [
'class' => 'yii\caching\MemCache',
'useMemcached' => true,
'servers' => [
[
....

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

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}

Categories