Installer is broken in RC2 since release of 11.1.1

Created on 7 January 2025, 14 days ago

Problem/Motivation

RC2 can no longer be installed freshly, because it uses 11.1.1. The installer fails on:
TypeError: Cannot assign null to property Drupal\Core\Recipe\InputConfigurator::$values of type array in unserialize() (line 68 of profiles/drupal_cms_installer/src/RecipeLoader.php).

From ๐Ÿ› Recipes that depend on other recipes break RecipeInputFormTrait Active

Steps to reproduce

  1. Download Drupal CMS RC2
  2. Go through the installer steps
  3. See the error when the install starts

Downgrading to 11.1.0 resolves the issue. The install also works from command line.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Component

Track: Installer

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia pameeela

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @pameeela
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    This is due to the recipe caching that we do in tagged releases to speed the installer up.

    The workaround is to delete web/profiles/drupal_cms_installer/cache completely before doing the installation. The installer will be slower than it otherwise would be, but shouldn't break.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand siramsay

    Just tried this and got the error
    TypeError: Cannot assign null to property Drupal\Core\Recipe\InputConfigurator::$values of type array in unserialize() (line 68 of profiles/drupal_cms_installer/src/RecipeLoader.php).

    ran rm -rf web/profiles/drupal_cms_installer/cache
    refreshed browser, installer ran.

    Works!

  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia ijortengab

    Bug because if we want to string replace the serialized string, we have to replace the length of string.
    example:

    php -r '$a="quick"; $flat = serialize($a); echo $flat; $flat = str_replace("quick","slow",$flat); echo $flat;'
    

    Output:
    s:5:"quick";s:5:"slow";
    Code above is wrong.
    Code below is that we have to fix it.
    s:5:"quick";s:4:"slow";

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    @drumm feels strongly that the RC2 release cannot be fixed retroactively, so I will respect that point of view. I'll leave this issue open, since the workaround does work, and we can point people to it until we cut our next release (which is likely to be 1.0.0).

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    De-escalating because we will not be able to fix this for RC2.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States ultimike Florida, USA

    Workaround worked for me as well.

    -mike

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    One thing we could do to prevent this in the future is wrap the unserialize() call in \Drupal\drupal_cms_installer\RecipeLoader::load():

          try {
            $recipe = unserialize($data);
          }
          catch (\Throwable) {
            $recipe = FALSE;
          }
    

    This would have caught the TypeError and bypassed the cache, which would have made for a slow install, but it wouldn't have broken with a fatal error. I think this is a worthwhile hardening, because we can't reasonably guarantee that this won't happen again.

  • Merge request !397Catch errors arising from unserialize() โ†’ (Merged) created by phenaproxima
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Gonna commit that little improvement, and credit everyone who reported this bug and tested the workaround. Credit for everyone!

    I'll leave the issue open so it's findable, and close it once 1.0.0 is released since nobody will care about RC2 after that.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts
  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia ijortengab

    This issue is essential for everyone who wants to try Drupal CMS specially install it with composer and drush.
    I hope the next RC can release as soon as possible.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    We are so close to release (next Wednesday!) that another RC is unlikely. The workaround in the issue summary seems to work just fine, and is easy for anyone to do, so it'll have to do for now.

  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia ijortengab

    Ok, the workaround has implement to our software:
    https://github.com/ijortengab/drupal-autoinstaller/commit/df2f45b584ac03...

    diff --git a/rcm/drupal/rcm-drupal-autoinstaller-nginx.sh b/rcm/drupal/rcm-drupal-autoinstaller-nginx.sh
    index 03a0289..f1a68e6 100755
    --- a/rcm/drupal/rcm-drupal-autoinstaller-nginx.sh
    +++ b/rcm/drupal/rcm-drupal-autoinstaller-nginx.sh
    @@ -1071,6 +1071,16 @@ else
     fi
     ____
    
    +# Hapus cache.
    +# https://www.drupal.org/project/drupal_cms/issues/3497786
    +if [ -n "drupalcms_version" ];then
    +    chapter Remove Drupal CMS Cache
    +    path="${project_dir}/drupal/web/profiles/drupal_cms_installer/cache"
    +    code rm -rf '"'$path'"'
    +    rm -rf "$path"
    +    ____
    +fi
    +
     if [[ "$install_type" == 'singlesite' && -z "$default_installed" ]];then
         chapter Install Drupal site default.
         code drush site:install --yes --site-name="$site_name" \
    @@ -1080,6 +1090,7 @@ if [[ "$install_type" == 'singlesite' && -z "$default_installed" ]];then
             drush site:install --yes --site-name="$site_name" \
                 --account-name="$account_name" --account-pass="$account_pass" \
                 --db-url="mysql://${db_user}:${db_user_password}@${DRUPAL_DB_USER_HOST}/${drupal_db_name}"
    +    [ ! $? -eq 0 ] && x
         if drush status --field=db-status | grep -q '^Connected$';then
             __; green Drupal site default installed.
         else
  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland 4aficiona2

    rm -rf web/profiles/drupal_cms_installer/cache works fine like mentioned in #3 ๐Ÿ› Installer is broken in RC2 since release of 11.1.1 Active by @siramsay

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States paulmckibben Atlanta, GA

    If you need to automate this workaround in composer, you can do so with a post-install command:

        "scripts": {
            "post-install-cmd": [
                "rm -rf web/profiles/drupal_cms_installer/cache"
            ]
        }
    
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia antojose

    The workaround made it proceed from the said error, but after installing the modules, when it redirected to /admin/dashboard/welcome?check_logged_in=1, it showed the following error on a white page:

    The "dashboard" parameter was not converted for the path "/admin/dashboard/{dashboard}" (route name: "entity.dashboard.canonical")

  • ๐Ÿ‡ต๐Ÿ‡ฐPakistan shakeeltariq

    Just returned to the Drupal world after years of absence, inspired by @dries' post on LinkedIn yesterday about his role changes and renewed commitment to Drupal Starshot and Drupal CMS. His message was a powerful reminder of the strong community spirit and the culture of lifelong contributions that make Drupal so unique. Itโ€™s exciting to feel that renewed energy! and sure enough, after hitting a frustrating snag on my return, encountering this issue, I found this threadโ€”a perfect example of the supportive and collaborative Drupal community still going strong.

    Enough ranting...

    In short, the proposed workaround worked!

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia pameeela

    @shakeeltariq thanks for the message :) Glad that you were able to resolve your issue. Our problem at the moment is we're moving too fast and we do occasionally break things!

    It should settle down once 1.0 is released next week. At least, I hope so....

  • ๐Ÿ‡ต๐Ÿ‡ฐPakistan shakeeltariq

    Hey @pameeela thanks :)
    "Move fast and break things" that's what Zuck said.

  • ๐Ÿ‡ฎ๐Ÿ‡ฉIndonesia ijortengab

    Small tips without remove cache directory.

    # Just download composer.json and assets.
    composer create-project --no-install -s rc drupal/cms:^1 .
    # Force to using 11.1.0
    composer require --no-install drupal/core-recommended:11.1.0
    # Drush
    composer require --no-install drush/drush
    # Download
    composer -v install
    # PATH
    PATH=$PWD/vendor/bin:$PATH
    # Install
    drush site:install
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    It's a safe bet that, as of day, nobody cares about RC2 anymore. :) Closing this out.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mgifford Ottawa, Ontario

    Worth noting that I just got this error on Pantheon by following https://docs.pantheon.io/release-notes/2025/01/drupal-cms-upstream

    And installing a new site.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mgifford Ottawa, Ontario

    Was specifically from https://docs.pantheon.io/supported-drupal#drupal-cms-on-pantheon

    Drupal CMS is currently available to install via this Dashboard Link or Terminus:

Production build 0.71.5 2024