array_shift(): Argument #1 ($array) must be of type array, null given in array_shift()

Created on 13 October 2022, about 2 years ago
Updated 19 March 2024, 10 months ago

Problem/Motivation

After PHP upgrade to 8.1.11, admin/config and admin/reports/dblog pages are throwing below error. However, this error disappear if we disable s3fs for for public use.

TypeError: array_shift(): Argument #1 ($array) must be of type array, null given in array_shift() (line 102 of /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php)
#0 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(102): array_shift()
#1 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(50): GuzzleHttp\Handler\StreamHandler->createResponse()
#2 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(52): GuzzleHttp\Handler\StreamHandler->__invoke()
#3 /var/www/html/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(37): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}()
#4 /var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php(29): GuzzleHttp\PrepareBodyMiddleware->__invoke()
#5 /var/www/html/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}()
#6 /var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php(59): GuzzleHttp\RedirectMiddleware->__invoke()
#7 /var/www/html/vendor/guzzlehttp/guzzle/src/HandlerStack.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}()
#8 /var/www/html/vendor/guzzlehttp/guzzle/src/Client.php(351): GuzzleHttp\HandlerStack->__invoke()
#9 /var/www/html/vendor/guzzlehttp/guzzle/src/Client.php(112): GuzzleHttp\Client->transfer()
#10 /var/www/html/vendor/aws/aws-sdk-php/src/Handler/GuzzleV6/GuzzleHandler.php(43): GuzzleHttp\Client->sendAsync()
#11 /var/www/html/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php(87): Aws\Handler\GuzzleV6\GuzzleHandler->__invoke()
#12 /var/www/html/vendor/aws/aws-sdk-php/src/ClientSideMonitoring/AbstractMonitoringMiddleware.php(126): Aws\WrappedHttpHandler->__invoke()
#13 /var/www/html/vendor/aws/aws-sdk-php/src/S3/PermanentRedirectMiddleware.php(43): Aws\ClientSideMonitoring\AbstractMonitoringMiddleware->__invoke()
#14 /var/www/html/vendor/aws/aws-sdk-php/src/S3/PutObjectUrlMiddleware.php(41): Aws\S3\PermanentRedirectMiddleware->__invoke()
#15 /var/www/html/vendor/aws/aws-sdk-php/src/Middleware.php(126): Aws\S3\PutObjectUrlMiddleware->__invoke()
#16 /var/www/html/vendor/guzzlehttp/promises/src/FulfilledPromise.php(41): Aws\Middleware::Aws\{closure}()
#17 /var/www/html/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise\{closure}()
#18 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run()
#19 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#20 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#21 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#22 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#23 /var/www/html/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(58): GuzzleHttp\Promise\Promise->wait()
#24 /var/www/html/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(711): Aws\AwsClient->execute()
#25 /var/www/html/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(160): Aws\S3\StreamWrapper->openReadStream()
#26 /var/www/html/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(940): Aws\S3\StreamWrapper->Aws\S3\{closure}()
#27 /var/www/html/vendor/aws/aws-sdk-php/src/S3/StreamWrapper.php(164): Aws\S3\StreamWrapper->boolCall()
#28 /var/www/html/web/modules/contrib/s3fs/src/StreamWrapper/S3fsStream.php(705): Aws\S3\StreamWrapper->stream_open()
#29 [internal function]: Drupal\s3fs\StreamWrapper\S3fsStream->stream_open()
#30 /var/www/html/web/core/modules/system/system.install(723): file_get_contents()
#31 [internal function]: system_requirements()
#32 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array()
#33 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
#34 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#35 /var/www/html/web/core/modules/system/src/SystemManager.php(109): Drupal\Core\Extension\ModuleHandler->invokeAll()
#36 /var/www/html/web/core/modules/system/src/SystemManager.php(93): Drupal\system\SystemManager->listRequirements()
#37 /var/www/html/web/core/modules/system/src/Controller/SystemController.php(124): Drupal\system\SystemManager->checkRequirements()
#38 [internal function]: Drupal\system\Controller\SystemController->overview()
#39 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#40 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#41 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#42 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#43 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(159): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#44 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#45 /var/www/html/web/modules/contrib/redirect_after_login/src/RedirectMiddleware.php(46): Symfony\Component\HttpKernel\HttpKernel->handle()
#46 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Drupal\redirect_after_login\RedirectMiddleware->handle()
#47 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#48 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#49 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#50 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#51 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#52 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#53 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#54 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#55 {main}

🐛 Bug report
Status

Closed: cannot reproduce

Version

3.0

Component

Code

Created by

🇳🇱Netherlands rsingh27

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024