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]

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

martin107 created an issue. See original summary.

willzyx’s picture

This 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 :(

willzyx’s picture

Status: Active » Needs review
FileSize
1.55 KB

the 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

martin107’s picture

Assigned: martin107 » Unassigned
Status: Needs review » Reviewed & tested by the community
FileSize
891 bytes

Thank 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,

  public function destruct() {
    $this->state->destruct();
  }

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++

martin107’s picture

Sorry I did not mean to upload my solution, it was already attached before I read your comment

  • lussoluca committed 5d768ef on 8.x-1.x authored by martin107
    Issue #2841689 by martin107: StateWrapper does not implement destruct()
    
lussoluca’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x-1.x
Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

pritam.tiwari’s picture

Hi,

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

lussoluca’s picture

Are you using the latest rc1 version?

T-lo’s picture

confirmed issue no longer present on devel-8.x-1.0-rc2