Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception thrown when running database updates via drush #5848

Closed
wu-edward opened this issue Jan 3, 2024 · 3 comments
Closed

Uncaught exception thrown when running database updates via drush #5848

wu-edward opened this issue Jan 3, 2024 · 3 comments

Comments

@wu-edward
Copy link

Describe the bug
After the fix in Drupal core #3410022: Regression from #3295790 content-length header set earlier than expected, running database updates via drush updb throws an uncaught exception.

Also posted Drupal core issue https://www.drupal.org/node/3412160

To Reproduce
What did you do?

  1. Install Drupal 10.2.x (or 11.x) that contains commits from [#3410022] with standard profile
  2. Run drush updb
  3. Observe exceptions thrown in console
Fatal error: Uncaught Symfony\Component\VarExporter\Exception\LogicException: Cannot generate lazy proxy: class "Drupal\big_pipe\StackMiddleware\ContentLength" is final. in /var/
  www/html/vendor/symfony/var-exporter/ProxyHelper.php:92
  Stack trace:
  #0 /var/www/html/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/LazyServiceDumper.php(136): Symfony\Component\VarExporter\ProxyHelper::generateLazyProxy(Object(Reflectio
  nClass), Array)
  #1 /var/www/html/vendor/symfony/dependency-injection/LazyProxy/Instantiator/LazyServiceInstantiator.php(33): Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\LazyService
  Dumper->getProxyCode(Object(Symfony\Component\DependencyInjection\Definition), 'http_middleware...')
  #2 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1086): Symfony\Component\DependencyInjection\LazyProxy\Instantiator\LazyServiceInstantiator->instantiate
  Proxy(Object(Drupal\Core\DependencyInjection\ContainerBuilder), Object(Symfony\Component\DependencyInjection\Definition), 'http_middleware...', Object(Closure))
  #3 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\Dep
  endencyInjection\Definition), Array, true, 'http_middleware...')
  #4 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tru
  e)
  #5 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Componen
  t\DependencyInjection\Reference), Array, true)
  #6 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #7 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\Dep
  endencyInjection\Definition), Array, true, 'http_middleware...')
  #8 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tru
  e)
  #9 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Componen
  t\DependencyInjection\Reference), Array, true)
  #10 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #11 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\De
  pendencyInjection\Definition), Array, true, 'http_middleware...')
  #12 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tr
  ue)
  #13 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Compone
  nt\DependencyInjection\Reference), Array, true)
  #14 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #15 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\De
  pendencyInjection\Definition), Array, true, 'http_middleware...')
  #16 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tr
  ue)
  #17 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Compone
  nt\DependencyInjection\Reference), Array, true)
  #18 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #19 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\De
  pendencyInjection\Definition), Array, true, 'http_middleware...')
  #20 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tr
  ue)
  #21 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Compone
  nt\DependencyInjection\Reference), Array, true)
  #22 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #23 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\De
  pendencyInjection\Definition), Array, true, 'http_kernel')
  #24 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(531): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_kernel', 1)
  #25 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(1403): Symfony\Component\DependencyInjection\ContainerBuilder->get('http_kernel')
  #26 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(694): Drupal\Core\DrupalKernel->getHttpKernel()
  #27 /var/www/html/vendor/drush/drush/src/Boot/DrupalBoot8.php(326): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Rende
  r\HtmlResponse))
  #28 [internal function]: Drush\Boot\DrupalBoot8->terminate()
  #29 {main}

  Next Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: Cannot generate lazy proxy for service "http_middleware.big_pipe". in /var/www/html/vendor/symfony/
  dependency-injection/LazyProxy/PhpDumper/LazyServiceDumper.php:138
  Stack trace:
  #0 /var/www/html/vendor/symfony/dependency-injection/LazyProxy/Instantiator/LazyServiceInstantiator.php(33): Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\LazyService
  Dumper->getProxyCode(Object(Symfony\Component\DependencyInjection\Definition), 'http_middleware...')
  #1 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1086): Symfony\Component\DependencyInjection\LazyProxy\Instantiator\LazyServiceInstantiator->instantiate
  Proxy(Object(Drupal\Core\DependencyInjection\ContainerBuilder), Object(Symfony\Component\DependencyInjection\Definition), 'http_middleware...', Object(Closure))
  #2 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\Dep
  endencyInjection\Definition), Array, true, 'http_middleware...')
  #3 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tru
  e)
  #4 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Componen
  t\DependencyInjection\Reference), Array, true)
  #5 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #6 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\Dep
  endencyInjection\Definition), Array, true, 'http_middleware...')
  #7 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tru
  e)
  #8 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Componen
  t\DependencyInjection\Reference), Array, true)
  #9 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #10 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\De
  pendencyInjection\Definition), Array, true, 'http_middleware...')
  #11 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tr
  ue)
  #12 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Compone
  nt\DependencyInjection\Reference), Array, true)
  #13 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #14 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\De
  pendencyInjection\Definition), Array, true, 'http_middleware...')
  #15 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tr
  ue)
  #16 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Compone
  nt\DependencyInjection\Reference), Array, true)
  #17 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #18 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\De
  pendencyInjection\Definition), Array, true, 'http_middleware...')
  #19 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1258): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_middleware...', 1, Array, tr
  ue)
  #20 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1210): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Object(Symfony\Compone
  nt\DependencyInjection\Reference), Array, true)
  #21 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(1110): Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices(Array, Array, true)
  #22 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(586): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\De
  pendencyInjection\Definition), Array, true, 'http_kernel')
  #23 /var/www/html/vendor/symfony/dependency-injection/ContainerBuilder.php(531): Symfony\Component\DependencyInjection\ContainerBuilder->doGet('http_kernel', 1)
  #24 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(1403): Symfony\Component\DependencyInjection\ContainerBuilder->get('http_kernel')
  #25 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(694): Drupal\Core\DrupalKernel->getHttpKernel()
  #26 /var/www/html/vendor/drush/drush/src/Boot/DrupalBoot8.php(326): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Rende
  r\HtmlResponse))
  #27 [internal function]: Drush\Boot\DrupalBoot8->terminate()
  #28 {main}
    thrown in /var/www/html/vendor/symfony/dependency-injection/LazyProxy/PhpDumper/LazyServiceDumper.php on line 138

Expected behavior
No exceptions thrown and outstanding database updates can be run.

Actual behavior
What happened instead?

Workaround
Is there another way to do the desired action?

System Configuration

Q A
Drush version? 12.4.3.0
Drupal version? 10.2.x
PHP version 8.1.26
OS? Linux (ddev)

Additional information
Add any other context about the problem here.

@wu-edward
Copy link
Author

This is addressed in Drupal core #3412160: Uncaught exception thrown when running database updates via drush by removing the final from the Drupal\big_pipe\StackMiddleware\ContentLength class declaration.

Ideally, Drush does not have an expectation that this and other similar classes/services aren't final, and so final can be added back in https://www.drupal.org/project/drupal/issues/3412168

@weitzman
Copy link
Member

weitzman commented Jan 3, 2024

Is this bug caused by drush in any way? I am not seeing that. I think some Drupal code is trying to extend a final class.

@wu-edward
Copy link
Author

After more investigation, the issue is not drush specific and was occurring on update.php as well. More at https://www.drupal.org/project/drupal/issues/3412168.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants