When I use pda/pheanstalk queue (3.0.x or 3.1.x ) and queued event listeners, which sends slack Notifications, I receive this error in bugsnag.
Illuminate\Contracts\Container\BindingResolutionExceptionvendor/laravel/framework/src/Illuminate/Container/Container.php:835
Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\Manager
And I cant find place which is causing this error.
Full stacktrace:
Illuminate\Contracts\Container\BindingResolutionException Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\Manager
vendor/laravel/framework/src/Illuminate/Container/Container.php:835 Illuminate\Container\Container::resolveNonClass
vendor/laravel/framework/src/Illuminate/Container/Container.php:802 Illuminate\Container\Container::getDependencies
vendor/laravel/framework/src/Illuminate/Container/Container.php:773 Illuminate\Container\Container::build
vendor/laravel/framework/src/Illuminate/Container/Container.php:629 Illuminate\Container\Container::make
vendor/laravel/framework/src/Illuminate/Foundation/Application.php:699 Illuminate\Foundation\Application::make
vendor/laravel/framework/src/Illuminate/Container/Container.php:573 Illuminate\Container\Container::addDependencyForCallParameter
vendor/laravel/framework/src/Illuminate/Container/Container.php:533 Illuminate\Container\Container::getMethodDependencies
vendor/laravel/framework/src/Illuminate/Container/Container.php:505 Illuminate\Container\Container::call
vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php:94 Illuminate\Bus\Dispatcher::Illuminate\Bus\{closure}
vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104 Illuminate\Pipeline\Pipeline::then
vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php:98 Illuminate\Bus\Dispatcher::dispatchNow
vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php:47 Illuminate\Queue\CallQueuedHandler::call
vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php:72 Illuminate\Queue\Jobs\Job::fire
vendor/laravel/framework/src/Illuminate/Queue/Worker.php:207 Illuminate\Queue\Worker::process
vendor/laravel/framework/src/Illuminate/Queue/Worker.php:160 Illuminate\Queue\Worker::runNextJob
vendor/laravel/framework/src/Illuminate/Queue/Worker.php:111 Illuminate\Queue\Worker::runNextJobForDaemon
vendor/laravel/framework/src/Illuminate/Queue/Worker.php:74 Illuminate\Queue\Worker::daemon
vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:97 Illuminate\Queue\Console\WorkCommand::runWorker
vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:78 Illuminate\Queue\Console\WorkCommand::fire
[internal] call_user_func_array
vendor/laravel/framework/src/Illuminate/Container/Container.php:507 Illuminate\Container\Container::call
vendor/laravel/framework/src/Illuminate/Console/Command.php:169 Illuminate\Console\Command::execute
vendor/symfony/console/Command/Command.php:256 Symfony\Component\Console\Command\Command::run
vendor/laravel/framework/src/Illuminate/Console/Command.php:155 Illuminate\Console\Command::run
vendor/symfony/console/Application.php:818 Symfony\Component\Console\Application::doRunCommand
vendor/symfony/console/Application.php:186 Symfony\Component\Console\Application::doRun
vendor/symfony/console/Application.php:117 Symfony\Component\Console\Application::run
vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122 Illuminate\Foundation\Console\Kernel::handle
artisan:35 [main]
Fire an event, which has queued event listener that uses new 5.3 introduced notification class and sends slack notification.
What does your code look like please?
This might be a case of upgrading from 5.2 to 5.3 where you need to include Illuminate\Notifications\ NotificationServiceProvider
to config/app.php
.
I have the same issue and Illuminate\Notifications\NotificationServiceProvider included in config/app.php
Any one solved this issue ?
@progamer still have this issue on my production server. Can't find reason why I'm having that error.
@crynobone NotificationServiceProvider already included in config/app.php ,
@ddctd143 did you solve it on your development env ?
@progamer Prod env uses beanstalk queue, development uses sync mode ( no queue ). It is only difference between those environments. I tried to switch prod env to sync queue driver, nothing changes.
Yes, NotificationServiceProvider is included, and I'm using it alot in my app. Prod environment successfully sends slack notifications, but error still occurs in bugsnag. It is very annoying to receive 50-60 errors each day.
Example:
@ddctd143 my happened with pusher, but the source is the same, i don't think its related to sync/async mode, because i have it on laravel notifications the error shown in both cases when notification is queued or triggered directly
`
[2016-12-07 20:29:28] local.ERROR: Illuminate\Contracts\Container\BindingResolutionException: Unresolvable dependency resolving [Parameter #0 [
Stack trace:
`
@progamer Do you have fresh installation of laravel 5.3 or you upgraded from 5.2 to 5.3.x as I did ?
@ddctd143 no upgraded , but in early stage of development.
I got this error after an in place upgrade where I forgot to restart my queue workers. Restarting the queue workers fixed it.
Anyone has solved the issue? Having the same problem on a fresh Lumen 5.4 installation.
@danielsdeboer Thanks mate! This works for me. Do you have any clue why?
@aldee07 queue workers seem to bootstrap and cache the entire application so probably that they held outdated versions of code.
Thats true. You should restart queue after each deployment.
Example:
...
cd /home/forge/your-site.com
git pull origin master
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force
php artisan cache:clear
php artisan queue:restart # <- this line will prevent from error.
...
Having the same problem when i use factory(App\Post::class,20)->create();
銆倃ho can help me ??
ErrorMessage Illuminate\Contracts\Container\BindingResolutionException with message 'Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\Manager'
@Paladinhanxiao, in my case the error was related to unconfigured Laravel Scout, if you are using Scout, try to remove Laravel\Scout\Searchable-trait from the model and re-run seeding.
Same error "Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\\Support\\Manager"
In my case, fixed it by removing the class parameter from the Controller constructor, which was tried to be loaded by DependencyInjection.
The issue was that the class required some parameters passed to it's constructor, so the DependencyInjection failed to create an instance. Laravel/Lumen 5.6
class MyController extends Controller {
public function __construct(Some $obj) {
.....
So, in the above code, the "Some" class requires parameters in constructor, which causes for the issue.
This might be a case of upgrading from 5.2 to 5.3 where you need to include
Illuminate\Notifications\ NotificationServiceProvider
toconfig/app.php
.
that works for me (y)
Most helpful comment
This might be a case of upgrading from 5.2 to 5.3 where you need to include
Illuminate\Notifications\ NotificationServiceProvider
toconfig/app.php
.