8 – Fatal error after upgrading to Drupal 9


I am trying to upgrade a Drupal 8.9.3 multi-site installation to 9.0.3 using composer. Here are the steps that I took to do so:

  1. I wrote a script that adjusts the file permissions on the remote host for step 1 of “Upgrading a Composer-based Drupal 8 site” found here: Upgrading from Drupal 8 to Drupal 9 (or higher), and verified that all modes were correctly changed on the host. (script below)
folders=( "default" "site1" "site2" "site3" "site4" )

for i in "${folders(@)}"
  do
    echo "setting folder permissions on $i"
    chmod 777 public_html/sites/$i

    if ( "$(stat -c '%a' public_html/sites/$i)" == "777" )
      then
        echo -e "$i has permissions are set to 777n"
      else
        echo -e "$i doesn't have proper permissions set permissions are set to `stat -c '%a' public_html/sites/$i`n"
        break
    fi

    find public_html/sites/$i -name "*settings.php" -print | while read f; 
      do
        echo "setting file permissions on "$f""
        chmod 777 "$f"
      
        if ( "$(stat -c '%a' "$f")" == "777" )
          then
            echo -e "$i has permissions are set to 777n"
          else
            echo -e "$i doesn't have proper permissions set permissions are set to `stat -c '%a' public_html/sites/$i`n"
            break
        fi
      done

      find public_html/sites/$i -name "*services.yml" -print | while read f; 
      do
        echo "setting file permissions on "$f""
        chmod 777 "$f"
      
        if ( "$(stat -c '%a' "$f")" == "777" )
          then
            echo -e "$i has permissions are set to 777n"
          else
            echo -e "$i doesn't have proper permissions set permissions are set to `stat -c '%a' public_html/sites/$i`n"
            break
        fi
      done

  done
  1. Attempted to change file permissions on the local windows based host for all the files that the script changed on the remote host. I don’t know if this actually worked or not because the bash shell I was using to check that the setting were correct, never actually changed, but the files in windows explorer were set to full control for my administrative user account and “read only” was unchecked.

  2. I ran the composer command found on step 2 of Upgrading from Drupal 8 to Drupal 9 (or higher) on my local repo since my shared hosting service won’t seem to run composer commands due to php memory limits:

composer require drupal/core-recommended:^9.0.0 drupal/core-composer-scaffold:^9.0.0 drupal/core-project-message:^9.0.0 --update-with-dependencies --no-update
  1. Updated locally with composer update command
  2. Pushed the local branch to the remote upgrade branch
  3. Checked out the remote upgrade branch on the remote host

This is where things started to get finicky.

When refreshing the page, I started getting php fatal error messages. I navigated to update.php, since drush can’t run with the php memory limits imposed by my either, and the update script page did appear. I ran the database updates, and went back to administration pages… same php fatal error generic message. I checked the error log and this is the message it was giving me

(25-Aug-2020 07:55:04 America/Chicago) Error: Call to undefined function drupal_installation_attempted() in ~/public_html/modules/contrib/bootstrap_library/bootstrap_library.module on line 20 
#0 ~/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(297): bootstrap_library_page_attachments(Array)
#1 ~/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(273): DrupalCoreRenderMainContentHtmlRenderer->invokePageAttachmentHooks(Array)
#2 ~/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(117): DrupalCoreRenderMainContentHtmlRenderer->prepare(Array, Object(SymfonyComponentHttpFoundationRequest), Object(DrupalCoreRoutingCurrentRouteMatch))
#3 ~/public_html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): DrupalCoreRenderMainContentHtmlRenderer->renderResponse(Array, Object(SymfonyComponentHttpFoundationRequest), Object(DrupalCoreRoutingCurrentRouteMatch))
#4 ~/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php(78): DrupalCoreEventSubscriberMainContentViewSubscriber->onViewRenderArray(Object(SymfonyComponentHttpKernelEventViewEvent), 'kernel.view', Object(SymfonyComponentEventDispatcherLegacyEventDispatcherProxy))
#5 ~/vendor/symfony/http-kernel/HttpKernel.php(163): SymfonyComponentEventDispatcherLegacyEventDispatcherProxy->dispatch(Object(SymfonyComponentHttpKernelEventViewEvent), 'kernel.view')
#6 ~/vendor/symfony/http-kernel/HttpKernel.php(80): SymfonyComponentHttpKernelHttpKernel->handleRaw(Object(SymfonyComponentHttpFoundationRequest), 1)
#7 ~/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): SymfonyComponentHttpKernelHttpKernel->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#8 ~/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): DrupalCoreStackMiddlewareSession->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#9 ~/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): DrupalCoreStackMiddlewareKernelPreHandle->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#10 ~/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupalpage_cacheStackMiddlewarePageCache->pass(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#11 ~/public_html/core/modules/ban/src/BanMiddleware.php(50): Drupalpage_cacheStackMiddlewarePageCache->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#12 ~/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): DrupalbanBanMiddleware->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#13 ~/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): DrupalCoreStackMiddlewareReverseProxyMiddleware->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#14 ~/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): DrupalCoreStackMiddlewareNegotiationMiddleware->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#15 ~/public_html/core/lib/Drupal/Core/DrupalKernel.php(705): StackStackedHttpKernel->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
#16 ~/public_html/index.php(19): DrupalCoreDrupalKernel->handle(Object(SymfonyComponentHttpFoundationRequest))
#17 {main}

I attempted to clear the cache by truncating the db cache tables, but nothing seems to resolve this error, I know it has something to do with the bootstrap library module, and perhaps this module is D9 ready yet? Any thoughts would be appreciated.

Thanks in advance!