When I type
drush en webprofiler
I get a fatal error and stack trace listed below
Has core changed its behaviour recently ? Does StateWrapper need to now implement destruct()
I am just posting early - while I look into this some more
/var/www/html # drush en webprofiler
The following extensions will be enabled: webprofiler, devel
Do you really want to continue? (y/n): y
devel was enabled successfully. [ok]
devel defines the following permissions: access devel information, execute php code, switch users
webprofiler was enabled successfully. [ok]
webprofiler defines the following permissions: access webprofiler, view webprofiler toolbar
Error: Call to undefined method Drupal\webprofiler\State\StateWrapper::destruct() in Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate() [error]
(line 50 of /var/www/html/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php) #0 [internal function]:
Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...',
Object(Drupal\webprofiler\TraceableEventDispatcher))
#1 /var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php(61): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\PostResponseEvent),
'kernel.terminat...', Object(Drupal\webprofiler\TraceableEventDispatcher))
#2 /var/www/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111):
Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...',
Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /var/www/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php(140):
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent))
#4 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(84): Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.terminat...',
Object(Symfony\Component\HttpKernel\Event\PostResponseEvent))
#5 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32):
Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#6 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(634): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request),
Object(Symfony\Component\HttpFoundation\Response))
#7 phar:///usr/local/bin/drush/lib/Drush/Boot/DrupalBoot8.php(201): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request),
Object(Symfony\Component\HttpFoundation\Response))
#8 phar:///usr/local/bin/drush/includes/preflight.inc(75): Drush\Boot\DrupalBoot8->terminate()
#9 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main()
#10 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#11 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#12 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#13 {main}.
[06-Jan-2017 19:14:22 UTC] Error: Call to undefined method Drupal\webprofiler\State\StateWrapper::destruct() in /var/www/html/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php on line 50 #0 [internal function]: Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\webprofiler\TraceableEventDispatcher))
#1 /var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php(61): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\webprofiler\TraceableEventDispatcher))
#2 /var/www/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(Object(Symfony\Component\HttpKernel\Event\PostResponseEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /var/www/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php(140): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent))
#4 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(84): Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.terminat...', Object(Symfony\Component\HttpKernel\Event\PostResponseEvent))
#5 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#6 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(634): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#7 phar:///usr/local/bin/drush/lib/Drush/Boot/DrupalBoot8.php(201): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#8 phar:///usr/local/bin/drush/includes/preflight.inc(75): Drush\Boot\DrupalBoot8->terminate()
#9 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main()
#10 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#11 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#12 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#13 {main}
Error: Call to undefined method Drupal\webprofiler\State\StateWrapper::destruct() in Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate() (line 50 of /var/www/html/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php).
Drush command terminated abnormally due to an unrecoverable error. [error]
Comment | File | Size | Author |
---|
Comments
Comment #2
willzyx CreditAttribution: willzyx commentedThis seems to be caused by a recent change in core in the 8.3.x branch (see #2834580: Move locale.translation_status state key to a separate key/value collection). Change the StateWrapper and add the changes of the 8.3.x core branch doesn't seems a good idea considering that devel have a unique branch :(
Comment #3
willzyx CreditAttribution: willzyx commentedthe idea behind this patch is quite simple.. StateWrapper should implement all the methods declared in the interface and delegate all the other methods calls to the decorated object. should work I think, and could make the decorator a little bit more solid
Comment #4
martin107 CreditAttribution: martin107 commentedThank you sir,
and for such a quick response,
Yes I analysed the problem independently and my bad solution involved adding a destruct method to StateWapper,
but your solution is much better. Thanks you for teaching me something new :)
I have applied your patch and can confirm everything starts working again ...
willzyx++
Comment #5
martin107 CreditAttribution: martin107 commentedSorry I did not mean to upload my solution, it was already attached before I read your comment
Comment #7
lussolucaCommitted and pushed to 8.x-1.x
Thanks!
Comment #9
pritam.tiwari CreditAttribution: pritam.tiwari commentedHi,
I am facing the same issue in Drupal 8.3. I get following error message.
Fatal error: Call to undefined method Drupal\webprofiler\State\StateWrapper::destruct() in C:\xampp\htdocs\d831\core\lib\Drupal\Core\EventSubscriber\KernelDestructionSubscriber.php on line 50
Comment #10
lussolucaAre you using the latest rc1 version?
Comment #11
T-loconfirmed issue no longer present on devel-8.x-1.0-rc2