Can post the stack trace.
PasswordController: Maximum function nesting level of '100' reached, aborting!
Hi everyone,
I'm attempting to upgrade a 5.0 project to 5.1. Things seem OK so far but for some reason the PasswordController is throwing our friend Maximum function nesting level of '100' reached, aborting!.
Everything works with the old code -
<?php namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Auth;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Foundation\Auth\ResetsPasswords;
class PasswordController extends Controller {
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
protected $subject = "EYFA Members Password Reset";
protected $redirectTo = "/members";
/**
* Create a new password controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
*/
public function __construct(Guard $auth, PasswordBroker $passwords)
{
$this->auth = $auth;
$this->passwords = $passwords;
$this->middleware('guest');
}
}
Notice that this has the deprecated constructor dependancies. If I add the new code, without these, I get the error.
What am I missing here? I've tried all the usual commands - composer dump-autoload, php artisan optimize, php artisan clear-compiled, php artisan cache:clear, etc.
Maximum function nesting level of '100' reached, aborting!
in ClassLoader.php line 347
at FatalErrorException->__construct() in HandleExceptions.php line 127
at HandleExceptions->fatalExceptionFromError() in HandleExceptions.php line 112
at HandleExceptions->handleShutdown() in HandleExceptions.php line 0
at ClassLoader->findFileWithExtension() in ClassLoader.php line 329
at ClassLoader->findFile() in ClassLoader.php line 300
at ClassLoader->loadClass() in Swift.php line 0
at spl_autoload_call() in Swift.php line 17
in Swift.php line 56
at Swift::autoload() in DependencyContainer.php line 0
at spl_autoload_call() in DependencyContainer.php line 309
at ReflectionClass->__construct() in DependencyContainer.php line 309
at Swift_DependencyContainer->_createNewInstance() in DependencyContainer.php line 112
at Swift_DependencyContainer->lookup() in DependencyContainer.php line 370
at Swift_DependencyContainer->_lookupRecursive() in DependencyContainer.php line 365
at Swift_DependencyContainer->_lookupRecursive() in DependencyContainer.php line 348
at Swift_DependencyContainer->_resolveArgs() in DependencyContainer.php line 129
at Swift_DependencyContainer->createDependenciesFor() in DependencyContainer.php line 312
at Swift_DependencyContainer->_createNewInstance() in DependencyContainer.php line 112
at Swift_DependencyContainer->lookup() in DependencyContainer.php line 370
at Swift_DependencyContainer->_lookupRecursive() in DependencyContainer.php line 365
at Swift_DependencyContainer->_lookupRecursive() in DependencyContainer.php line 348
at Swift_DependencyContainer->_resolveArgs() in DependencyContainer.php line 129
at Swift_DependencyContainer->createDependenciesFor() in SmtpTransport.php line 37
at Swift_SmtpTransport->__construct() in SmtpTransport.php line 56
at Swift_SmtpTransport::newInstance() in TransportManager.php line 32
at TransportManager->createSmtpDriver() in Manager.php line 87
at Manager->createDriver() in Manager.php line 63
at Manager->driver() in MailServiceProvider.php line 95
at MailServiceProvider->Illuminate\Mail\{closure}() in Container.php line 274
at Container->Illuminate\Container\{closure}() in Container.php line 733
at Container->build() in Container.php line 626
at Container->make() in Application.php line 674
at Application->make() in Container.php line 1157
at Container->offsetGet() in Container.php line 31
at MailServiceProvider->Illuminate\Mail\{closure}() in Container.php line 733
at Container->build() in Container.php line 626
at Container->make() in Application.php line 674
at Application->make() in Container.php line 1157
at Container->offsetGet() in Container.php line 50
at PasswordResetServiceProvider->Illuminate\Auth\Passwords\{closure}() in Container.php line 733
at Container->build() in Container.php line 626
at Container->make() in Application.php line 674
at Application->make() in Container.php line 1157
at Container->offsetGet() in Facade.php line 149
at Facade::resolveFacadeInstance() in Facade.php line 118
at Facade::getFacadeRoot() in Facade.php line 203
at Facade::__callStatic() in ResetsPasswords.php line 35
at Password::sendResetLink() in ResetsPasswords.php line 35
at PasswordController->postEmail() in Controller.php line 256
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:256}() in Controller.php line 256
at Controller->callAction() in ControllerDispatcher.php line 164
at ControllerDispatcher->call() in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing\{closure}() in Pipeline.php line 139
at call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}() in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}() in RedirectIfAuthenticated.php line 41
at RedirectIfAuthenticated->handle() in Pipeline.php line 124
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103
at call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack() in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch() in Route.php line 201
at Route->runWithCustomDispatcher() in Route.php line 134
at Route->run() in Router.php line 704
at Router->Illuminate\Routing\{closure}() in Pipeline.php line 139
at call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}() in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103
at call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in Router.php line 706
at Router->runRouteWithinStack() in Router.php line 671
at Router->dispatchToRoute() in Router.php line 631
at Router->dispatch() in Kernel.php line 229
at Kernel->Illuminate\Foundation\Http\{closure}() in Pipeline.php line 139
at call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}() in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}() in HttpsProtocol.php line 20
at HttpsProtocol->handle() in Pipeline.php line 124
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle() in VerifyCsrfToken.php line 29
at VerifyCsrfToken->handle() in Pipeline.php line 124
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in ShareErrorsFromSession.php line 54
at ShareErrorsFromSession->handle() in Pipeline.php line 124
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in StartSession.php line 62
at StartSession->handle() in Pipeline.php line 124
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle() in Pipeline.php line 124
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in EncryptCookies.php line 59
at EncryptCookies->handle() in Pipeline.php line 124
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle() in Pipeline.php line 124
at call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}() in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 103
at call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in Kernel.php line 118
at Kernel->sendRequestThroughRouter() in Kernel.php line 86
at Kernel->handle() in index.php line 53
at {main}() in index.php line 0
Read the existing thread for solution https://laracasts.com/discuss?search=Maximum+function+nesting+level+of+%27100%27
@crynobone yeah see the problem is that this can also be caused by some sort of a bug, not just changing how the system works.
@jimmck @Kryptonit3 I was using Mailtrap.io in dev, settings for its SMTP were stored in my .env. I noticed in the stack trace that there were mentions of Swift so I tried removing these settings and using the production settings for Mailgun (stored in config/mail.php), this eliminated the error.
Thoughts on this?
@opheliadesign No, it because 5.1 require more nested function called compared to before. XDebug themselves has agree that the current 100 limits is too low for modern application, even latest Homestead increase the default to 250.
The bugs is not specific to any code, it depends on how much nested function has been called in any given request.
@crynobone can you explain then why it works if it's not using mail settings that are stored in the .env as opposed to in config/mail.php? Why would one throw that error and the other not?
I understand the whole maximum nested level issue but can't this also occur if it simply can't find a class for whatever reason?
If you get this error, chances are there is room for improvement somewhere. I had this exact error a while back because I was calling a sort of static clean up query in the model constructor. Not a great idea. But since fixed. :) This is one of those errors that are hard to find the root cause.
@Kryptonit3 room for improvement in my code? It's pretty much out of the box.. nothing fancy going on with my User model or PasswordController. Again, it seems to have something to do with getting the mail settings from .env, or perhaps the Mailtrap.io SMTP mechanism works differently?
That wasn't directed at you directly (sorry if it sounded so, or offensive), I meant in all situations I had encountered the exact error, it was because of something I messed up. What is the flow of the email that is being sent? Besides the provider change (mailgun instead of mailtrap) is anything else different? Maybe the mailgun class/wrapper is slimmer than the mailtrap one? I am lost. This error was one of my worst nightmares. :)
@opheliadesign Thank You for the Full Trace! Ah mail again?!?! I too have setup Mail Trap for this. I realize the Laravel heap trail runs deep, but this is bothersome.
Okay so I got the password reset issue resolved by not using .env for Mailtrap and instead using Mailgun in email.php, now I'm getting another Maximum level in another unrelated controller. I'm pretty sure this whole thing began with Laravel 5.0 and I did not have any issues until upgrading to 5.1.
Here's the new one:
[2015-07-05 22:18:20] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Maximum function nesting level of '100' reached, aborting!' in /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Container/Container.php:1057
Stack trace:
#0 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(127): Symfony\Component\Debug\Exception\FatalErrorException->__construct()
#1 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(112): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError()
#2 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(0): Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#3 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Container/Container.php(1157): Illuminate\Foundation\Application->make()
#4 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(251): Illuminate\Container\Container->offsetGet()
#5 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(85): Illuminate\Database\DatabaseManager->getDefaultConnection()
#6 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(61): Illuminate\Database\DatabaseManager->parseConnectionName()
#7 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3142): Illuminate\Database\DatabaseManager->connection()
#8 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3108): Illuminate\Database\Eloquent\Model::resolveConnection()
#9 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1856): Illuminate\Database\Eloquent\Model->getConnection()
#10 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1799): Illuminate\Database\Eloquent\Model->newBaseQueryBuilder()
#11 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1773): Illuminate\Database\Eloquent\Model->newQueryWithoutScopes()
#12 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(796): Illuminate\Database\Eloquent\Model->newQuery()
#13 /home/vagrant/essex-youth-football/app/CampChild.php(13): Illuminate\Database\Eloquent\Model->belongsTo()
#14 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(474): App\CampChild->shirtSize()
#15 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php(162): Illuminate\Database\Eloquent\Builder->Illuminate\Database\Eloquent\{closure}()
#16 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php(162): call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php:162}()
#17 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(475): Illuminate\Database\Eloquent\Relations\Relation::noConstraints()
#18 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(446): Illuminate\Database\Eloquent\Builder->getRelation()
#19 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(426): Illuminate\Database\Eloquent\Builder->loadRelation()
#20 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(174): Illuminate\Database\Eloquent\Builder->eagerLoadRelations()
#21 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php(284): Illuminate\Database\Eloquent\Builder->get()
#22 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php(284): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php:284}()
#23 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php(105): Illuminate\Database\Eloquent\Relations\Relation->__call()
#24 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php(105): Illuminate\Database\Eloquent\Relations\HasMany->get()
#25 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(457): Illuminate\Database\Eloquent\Relations\Relation->getEager()
#26 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(426): Illuminate\Database\Eloquent\Builder->loadRelation()
#27 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(174): Illuminate\Database\Eloquent\Builder->eagerLoadRelations()
#28 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(140): Illuminate\Database\Eloquent\Builder->get()
#29 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(87): Illuminate\Database\Eloquent\Builder->first()
#30 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(119): Illuminate\Database\Eloquent\Builder->find()
#31 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3356): Illuminate\Database\Eloquent\Builder->findOrFail()
#32 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(3356): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:3356}()
#33 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php(65): Illuminate\Database\Eloquent\Model->__call()
#34 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php(65): App\CampParent->findOrFail()
#35 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php(40): App\Events\CampRegistrationWasPayed->getRestoredPropertyValue()
#36 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/CallQueuedHandler.php(42): App\Events\CampRegistrationWasPayed->__wakeup()
#37 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/CallQueuedHandler.php(42): unserialize()
#38 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(129): Illuminate\Events\CallQueuedHandler->call()
#39 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php(44): Illuminate\Queue\Jobs\Job->resolveAndFire()
#40 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(26): Illuminate\Queue\Jobs\SyncJob->fire()
#41 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php(230): Illuminate\Queue\SyncQueue->push()
#42 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php(230): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php:230}()
#43 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(415): Illuminate\Queue\QueueManager->__call()
#44 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(415): Illuminate\Queue\QueueManager->push()
#45 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(346): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()
#46 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(346): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:346}()
#47 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(221): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()
#48 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(221): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:221}()
#49 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(671): Illuminate\Events\Dispatcher->fire()
#50 /home/vagrant/essex-youth-football/app/Http/Controllers/CampController.php(418): event()
#51 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(256): App\Http\Controllers\CampController->processPayment()
#52 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(256): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:256}()
#53 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(164): Illuminate\Routing\Controller->callAction()
#54 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(112): Illuminate\Routing\ControllerDispatcher->call()
#55 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}()
#56 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}()
#57 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#58 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}()
#59 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Pipeline\Pipeline->then()
#60 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(69): Illuminate\Routing\ControllerDispatcher->callWithinStack()
#61 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Route.php(201): Illuminate\Routing\ControllerDispatcher->dispatch()
#62 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Route.php(134): Illuminate\Routing\Route->runWithCustomDispatcher()
#63 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Router.php(704): Illuminate\Routing\Route->run()
#64 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#65 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}()
#66 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#67 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}()
#68 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Router.php(706): Illuminate\Pipeline\Pipeline->then()
#69 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Router.php(671): Illuminate\Routing\Router->runRouteWithinStack()
#70 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Routing/Router.php(631): Illuminate\Routing\Router->dispatchToRoute()
#71 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(229): Illuminate\Routing\Router->dispatch()
#72 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#73 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:139}()
#74 /home/vagrant/essex-youth-football/app/Http/Middleware/HttpsProtocol.php(20): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#75 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): App\Http\Middleware\HttpsProtocol->handle()
#76 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}()
#77 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#78 /home/vagrant/essex-youth-football/app/Http/Middleware/VerifyCsrfToken.php(29): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
#79 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): App\Http\Middleware\VerifyCsrfToken->handle()
#80 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}()
#81 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(54): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#82 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): Illuminate\View\Middleware\ShareErrorsFromSession->handle()
#83 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}()
#84 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#85 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): Illuminate\Session\Middleware\StartSession->handle()
#86 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}()
#87 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#88 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
#89 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}()
#90 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#91 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): Illuminate\Cookie\Middleware\EncryptCookies->handle()
#92 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}()
#93 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(42): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#94 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle()
#95 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:124}()
#96 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#97 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func:{/home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:103}()
#98 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(118): Illuminate\Pipeline\Pipeline->then()
#99 /home/vagrant/essex-youth-football/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(86): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#100 /home/vagrant/essex-youth-football/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle()
#101 /home/vagrant/essex-youth-football/public/index.php(0): {main}()
#102 {main}
Exactly @Kryptonit3 Exactly.
@opheliadesign are you trying to send an email to a lot of people? This may be a looping issue.
@Kryptonit3 only if one is a lot..
I tracked the second one down to an event that I was broadcasting, which I believe also uses mail.. digging into that now
stack traces are unfortunately not terribly readable. :\
can you explain then why it works if it's not using mail settings that are stored in the .env as opposed to in config/mail.php? Why would one throw that error and the other not?
It could be due to more calls to env() which would call getenv(), strtolower(), substr() etc repeatedly in config/mail.php when you use .env, as the error suggest this is due to having more nested function call within a single request.
I just found this post and laughed ( https://laracasts.com/discuss/channels/general-discussion/how-the-hell-do-you-debug-properly-in-laravel/replies/3377 )
I actually do that a lot to make sure things are flowing right. ( I know, I need to start writing tests :\ )
@Kryptonit3 yeah, at this point I'm just getting annoyed. Now it's breaking on trying to broadcast an event, even eliminated all of the logic from the listener. WTF?
Okay, to make things even more confusing, the event works OUTSIDE of the controller (in routes.php), throws the error INSIDE. I'm importing the event and firing it with the only model it requires.
Okay, to make things even more confusing, the event works OUTSIDE of the controller (in routes.php)
Because resolving/calling Controller require more interval nested function calls (compare to with simple closure), isn't that obvious by now? You just need to increase your XDebug configuration to support more nested function calls.
@crynobone so again why would this be happening with 5.1 versus 5.0? Because those issues popped up with 5.0, wouldn't I have had them before?
I hear what you're saying but I don't think that is the problem here.
@opheliadesign What is the logic sequence of the event? And it makes sense about the controller. I am trying to write something to force the blowup. It gets looped up in the Pipeline.php code calling user_func over and over. I can't see your code though.
so again why would this be happening with 5.1 versus 5.0?
- More config require
env()in 5.1 versus 5.0. - More complex code in 5.1 than 5.0, as an example, some DB related functionality now return Collection instead of normal array, some even prepare a Eloquent Collection than convert to basic Collection via
collect(). - In 5.0, it could be that normal request averaging to 80-90 nested function calls which in 5.1 it averaging around 100. This would be the reason why many people see this issue randomly.
Let not forget if you have more Bootstrap class or Middleware class that will be executed on every request.
<?php namespace App\Http\Controllers;
use App\Camp;
use App\CampChild;
use App\CampParent;
use App\Events\CampRegistrationWasPayed;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Requests\CampParentRequest;
use App\Library\InlineEmail;
use App\Library\ogData;
use App\ShirtSize;
use Carbon\Carbon;
use Cartalyst\Stripe\Exception\CardErrorException;
use Cartalyst\Stripe\Stripe;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\Request;
use Mail;
use Opengraph;
class CampController extends Controller
{
public function processPayment(Request $request)
{
$parent = CampParent::with(['Camp', 'Children', 'ChildrenCount'])->whereToken($parentToken)->first();// Broadcast the event to generate receipt and notifications
event(new CampRegistrationWasPayed($parent));
}
}
<?php namespace App\Events;
use App\CampParent;
use App\Events\Event;
use Illuminate\Queue\SerializesModels;
class CampRegistrationWasPayed extends Event {
use SerializesModels;
public $parent;
/**
* Create a new event instance.
* @param CampParent $parent
*/
public function __construct(CampParent $parent)
{
$this->parent = $parent;
}
}
<?php
namespace App\Listeners;
use App\Events\CampRegistrationWasPayed;
use App\Library\InlineEmail;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Mail;
class SendCampPurchaseConfirmation implements ShouldQueue
{
use InteractsWithQueue;
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param CampRegistrationWasPayed $event
* @return void
*/
public function handle(CampRegistrationWasPayed $event)
{
$parent = $event->parent;
$subject = "EYFA Football Camp Receipt - {$parent->camp->title}";
$title = $parent->camp->title;
$amount = number_format($parent->camp->price * $parent->childrenCount, 2);
$campPrice = number_format($parent->camp->price, 2);
$childrenCount = $parent->childrenCount;
$card = $parent->stripe_args['card'];
$token = $parent->token;
$campers = $parent->children;
$recipient = $parent->email;
$name = "{$parent->first_name} {$parent->last_name}";
$data = compact('subject', 'title', 'amount', 'campPrice', 'childrenCount', 'card', 'token', 'campers', 'recipient', 'name');
$inliner = new InlineEmail('emails.camp.receipt', $data);
$content = $inliner->convert();
// Send the email
Mail::send('emails.raw', ['content' => $content], function ($message) use ($data) {
$message->from('support@demo.org', 'EYFA Website Support');
$message->to($data['recipient'], $data['name']);
$message->subject($data['subject']);
});
}
}
@crynobone Yeah and because Laravel is so Dynamic with messaging and events. The firing and triggering of the events will cause these problems. I am writing a Mongo document library. Inn a given document, you have random fieldx of random types. They are handled by overrides and user defined functions to process the document. If I do not code the APIs to do some sanity checking in how they are called and chained together. I blow the stack by recursion everytime. Which is why I am asking @opheliadesign about his logic. The use case can point to the root cause.
Guys I'm working on trying to figure out where to bump up that value.. I have the latest homestead box, should it have been changed on an update?
@opheliadesign Perfect! Thanks!
@crynobone I went to /etc/php5/fpm/conf.d/20-xdebug.ini and the only line there is zend_extension=xdebug.so. Also, again, should this have been updated when I ran vagrant box update?
You should also run vagrant provision, right?
Please or to participate in this conversation.