Metadrop / drupal-boilerplate

Drupal projects up and running with Docker and many other tools in minutes
28 stars 23 forks source link

Since Drupal .9.4 an exception is thrown during Drupal install #73

Closed rsanzante closed 1 year ago

rsanzante commented 2 years ago

The error is:

 [error]  TYPO3\PharStreamWrapper\Exception: Unexpected file extension in "phar:///usr/local/bin/drush/bin/core/modules/mysql/src/Driver/Database/mysql//ExceptionHandler.php" in Drupal\Core\Security\PharExtensionInterceptor->assert() (line 44 of /var/www/html/web/core/lib/Drupal/Core/Security/PharExtensionInterceptor.php). 
[29-Jun-2022 10:38:33 UTC] PHP Fatal error:  Uncaught TYPO3\PharStreamWrapper\Exception: Unexpected file extension in "phar:///usr/local/bin/drush/bin/core/modules/mysql/src/Driver/Database/mysql//ExceptionHandler.php" in /var/www/html/web/core/lib/Drupal/Core/Security/PharExtensionInterceptor.php:44
Stack trace:
#0 /var/www/html/vendor/typo3/phar-stream-wrapper/src/Behavior.php(72): Drupal\Core\Security\PharExtensionInterceptor->assert('phar:///usr/loc...', 'url_stat')
#1 /var/www/html/vendor/typo3/phar-stream-wrapper/src/Manager.php(110): TYPO3\PharStreamWrapper\Behavior->assert('phar:///usr/loc...', 'url_stat')
#2 /var/www/html/vendor/typo3/phar-stream-wrapper/src/PharStreamWrapper.php(421): TYPO3\PharStreamWrapper\Manager->assert('phar:///usr/loc...', 'url_stat')
#3 /var/www/html/vendor/typo3/phar-stream-wrapper/src/PharStreamWrapper.php(410): TYPO3\PharStreamWrapper\PharStreamWrapper->assert('phar:///usr/loc...', 'url_stat')
#4 phar:///usr/local/bin/drush/vendor/composer/ClassLoader.php(444): TYPO3\PharStreamWrapper\PharStreamWrapper->url_stat('phar:///usr/loc...', 2)
#5 phar:///usr/local/bin/drush/vendor/composer/ClassLoader.php(444): include()
#6 phar:///usr/local/bin/drush/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('core/modules/my...')
#7 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\\mysql\\Dr...')
#8 [internal function]: spl_autoload_call('Drupal\\mysql\\Dr...')
#9 /var/www/html/web/core/lib/Drupal/Core/Database/Connection.php(1129): class_exists('Drupal\\mysql\\Dr...')
#10 /var/www/html/web/core/lib/Drupal/Core/Database/Connection.php(1193): Drupal\Core\Database\Connection->getDriverClass('ExceptionHandle...')
#11 /var/www/html/web/core/modules/mysql/src/Driver/Database/mysql/Insert.php(48): Drupal\Core\Database\Connection->exceptionHandler()
#12 /var/www/html/web/core/lib/Drupal/Core/Routing/MatcherDumper.php(147): Drupal\mysql\Driver\Database\mysql\Insert->execute()
#13 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Routing/MatcherDumper.php(84): Drupal\Core\Routing\MatcherDumper->dump(Array)
#14 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(194): Drupal\Core\ProxyClass\Routing\MatcherDumper->dump()
#15 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(210): Drupal\Core\Routing\RouteBuilder->rebuild()
#16 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(222): Drupal\Core\Routing\RouteBuilder->rebuildIfNeeded()
#17 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php(51): Drupal\Core\Routing\RouteBuilder->destruct()
#18 [internal function]: Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#19 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#20 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(100): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...')
#21 /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))
#22 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(687): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#23 /var/www/html/vendor/drush/drush/src/Boot/DrupalBoot8.php(298): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))
#24 [internal function]: Drush\Boot\DrupalBoot8->terminate()
#25 {main}
  thrown in /var/www/html/web/core/lib/Drupal/Core/Security/PharExtensionInterceptor.php on line 44

Although site is installed and seems to work, the error appears on some Drush commands. A registry clear seems to fix it.

Solution

Add a 'drush cr" after site installation.

Eduardo-Morales-Alberti commented 1 year ago

can not reproduce, and seems to be fixed https://www.drupal.org/project/drupal/issues/3026386 @rsanzante could you add more information?

Eduardo-Morales-Alberti commented 1 year ago

@rsanzante what version of Drush do you have?, it seems to be something related to Drush 8.

rsanzante commented 1 year ago

It seems this doesn't happen anymore. I guess we can close it.