Error: Call to a member function getKeyValue() on null in Drupal\s3fs\S3fsService->getAmazonS3Client() (line 281 of /app/docroot/modules/contrib/s3fs/src/S3fsService.php) #0 /app/docroot/modules/contrib/s3fs/src/StreamWrapper/S3fsStream.php(277): Drupal\s3fs\S3fsService->getAmazonS3Client(Array)
#1 /app/docroot/modules/contrib/s3fs/src/StreamWrapper/S3fsStream.php(185): Drupal\s3fs\StreamWrapper\S3fsStream->getClient()
#2 /app/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(262): Drupal\s3fs\StreamWrapper\S3fsStream->__construct()
#3 /app/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'stream_wrapper....')
#4 /app/docroot/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php(131): Drupal\Component\DependencyInjection\Container->get('stream_wrapper....')
#5 /app/docroot/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php(96): Drupal\Core\StreamWrapper\StreamWrapperManager->getWrapper('public', 'public://')
#6 /app/docroot/core/modules/image/src/Routing/ImageStyleRoutes.php(53): Drupal\Core\StreamWrapper\StreamWrapperManager->getViaScheme('public')
#7 [internal function]: Drupal\image\Routing\ImageStyleRoutes->routes()
#8 /app/docroot/core/lib/Drupal/Core/Routing/RouteBuilder.php(146): call_user_func(Array)
#9 /app/docroot/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#10 /app/docroot/core/lib/Drupal/Core/Extension/ModuleInstaller.php(363): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#11 /app/docroot/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, false)
#12 /app/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(808): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, false)
#13 /app/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(572): Drupal\Core\Config\ConfigImporter->processExtension('module', 'install', 's3fs_file_proxy...')
#14 /app/docroot/core/lib/Drupal/Core/Config/ConfigImporter.php(509): Drupal\Core\Config\ConfigImporter->processExtensions(Array)
#15 /app/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php(333): Drupal\Core\Config\ConfigImporter->doSyncStep('processExtensio...', Array)
#16 /app/vendor/drush/drush/includes/drush.inc(206): Drush\Drupal\Commands\config\ConfigImportCommands->doImport(Object(Drupal\Core\Config\StorageComparer))
#17 /app/vendor/drush/drush/includes/drush.inc(197): drush_call_user_func_array(Array, Array)
#18 /app/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php(304): drush_op(Array, Object(Drupal\Core\Config\StorageComparer))
#19 [internal function]: Drush\Drupal\Commands\config\ConfigImportCommands->import(NULL, Array)
#20 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#21 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#22 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#23 /app/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#24 /app/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /app/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /app/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /app/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /app/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /app/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /app/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#31 /app/vendor/drush/drush/drush(4): require('/app/vendor/dru...')
Comments
Comment #2
awm commentedComment #3
cmlaraThank you for the report.
I have a minor nit that I feel it would be better to typehint as:
/** @var \Drupal\key\KeyInterface|NULL $key */and would be great to duplicate the typehint to the secret_key section as well.
This avoids a phpcs warning about using /* instead of /**
Uses the interface instead of the class
Clears a phpstan warning about "Ternary operator condition is always true."
Set as NW just on the typehint, from an execution standpoint this looks good to me.
Comment #4
csmdgl commentedThis patch uses the typehint suggestion by #3.
Comment #6
cmlaraThanks for the work on this all!
Committed to dev.