I get this error

Warning: Trying to access array offset on value of type bool in Drupal\s3fs\StreamWrapper\S3fsStream->getS3fsObject() (line 1177 of modules/s3fs/src/StreamWrapper/S3fsStream.php).
Drupal\s3fs\StreamWrapper\S3fsStream->getS3fsObject('s3://styles/800x800/s3/me/1/3661.jpg') (Line: 380)
Drupal\s3fs\StreamWrapper\S3fsStream->getExternalUrl() (Line: 96)
file_create_url('s3://styles/800x800/s3/me/1/3661.jpg') (Line: 250)
Drupal\image\Entity\ImageStyle->buildUrl('s3://me/1/3661.jpg') (Line: 132)
template_preprocess_colorbox_formatter(Array, 'colorbox_formatter', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('colorbox_formatter', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 398)
render(Array) (Line: 930)
Drupal\views\Plugin\views\field\EntityField->render_item(5, Array) (Line: 1168)
Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object) (Line: 238)
template_preprocess_views_view_field(Array, 'views_view_field', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('views_view_field', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 1745)
Drupal\views\Plugin\views\field\FieldPluginBase->theme(Object) (Line: 772)
Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 711)
Drupal\views\Plugin\views\style\StylePluginBase->renderFields(Array) (Line: 578)
Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping(Array, Array, 1) (Line: 469)
Drupal\views\Plugin\views\style\StylePluginBase->render(Array) (Line: 2170)
Drupal\views\Plugin\views\display\DisplayPluginBase->render() (Line: 1533)
Drupal\views\ViewExecutable->render() (Line: 380)
Drupal\eva\Plugin\views\display\Eva->execute() (Line: 1630)
Drupal\views\ViewExecutable->executeDisplay('eva_drupal_project', Array) (Line: 77)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 450)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 100)
__TwigTemplate_5a449df067461dd9590674e20ead0eb89343cdd985d00d83513f784dfc036fe4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 65)
twig_render_template('themes/dbase/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 241)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 706)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I'm using Drupal Core 9.1.8
S3 File System 8.x-3.0-alpha17+34-dev (2021-Apr-30)
PHP 8.0

CommentFileSizeAuthor
#8 3212468-8.patch659 byteslarisse

Comments

RobertoGuzman created an issue. See original summary.

cmlara’s picture

A couple questions:

Are you using a custom S3 provide? ( 'Use a Custom Host' in GUI, 'use_customhost' in config)
If so did you run upgrade.php after upgrading to Alpha17+34 or update imported config? (the format changed in Alpah17+34 to require the use of the http/https protocol to decouple the setting from the 'use_https' setting)

robertoguzman’s picture

Hi cmlara,

Thank you for your reply, I'm not using custom HOST

cmlara’s picture

Thank you. I Just checked and realize the -dev branch is at 33 not 34 so I was off by one in my count it appears of where -dev is at.

The line counts of your error message do not appear to match the lines in -dev so it would appear you may be running an additional patch, if so what patch and does the error occur without that patch?

cmlara’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Moving to Normal as it appears this isn't just code from the -dev branch and I haven't seen it in my own lab yet. Setting postponed waiting on further info.

cmlara’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Unable to reproduce at this time, and appears to be modified code.

Please re-open if you can provide additional details.

cmlara’s picture

Reopening for further investigation.

A similar error report just came into the 7.x-2.x branch (with patch) #3217718: Notice: Trying to access array offset on value of type bool in S3fsStreamWrapper->_s3fs_get_object() (line 1239 of /var/www/html/docroot/sites/all/modules/s3fs/S3fsStreamWrapper.inc)

Possibly same error., Currently on line 1204 in 8.x-3.x.

Would require that cache be disabled to replicate for testing.

larisse’s picture

StatusFileSize
new659 bytes

Hi!

I can't able to reproduce this error, but looking through the issue in comment #7, I made the same on the patch for this version. I hope it works.

larisse’s picture

Status: Active » Needs review

cmlara credited csmdgl.

cmlara’s picture

  • cmlara committed c626cbf on 8.x-3.x authored by csmdgl
    Issue #3212468 by csmdgl, larisse, RobertoGuzman: Warning: Trying to...
cmlara’s picture

Status: Needs review » Fixed

Thanks to @csmdgl for catching this in 7.x and providing patch, that made it possible to find out what was going on in this issue in 8.x since the lines given in the original report were not lining up for me.

Status: Fixed » Closed (fixed)

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