Upgrade 1.x to 2.x fails and breaks site

Created on 13 October 2024, about 1 month ago

Problem/Motivation

Hi everyone,

I followed the instructions and tried to upgrade ECA from 1.x to 2.x. The update fails and breaks the site.

Here are my composer commands and output:

sudo -u www-data composer require \
  drupal/eca:^2.0 \
  drupal/bpmn_io:^2.0 \
  drupal/eca_commerce:^2.0 \
  drupal/eca_flag:^2.0 \
  drupal/eca_tamper:^2.0 \
  drupal/eca_vbo:^2.0 \
  --update-with-all-dependencies
./composer.json has been updated
Running composer update drupal/eca drupal/bpmn_io drupal/eca_commerce drupal/eca_flag drupal/eca_tamper drupal/eca_vbo --with-all-dependencies
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 10 updates, 0 removals
  - Upgrading dragonmantank/cron-expression (v3.3.3 => v3.4.0)
  - Upgrading drupal/bpmn_io (dev-1.1.x 6f2515d => 2.0.1)
  - Upgrading drupal/eca (dev-1.1.x 9f26878 => 2.0.6)
  - Upgrading drupal/eca_commerce (1.0.0 => 2.0.1)
  - Upgrading drupal/eca_flag (1.0.0 => 2.0.0)
  - Upgrading drupal/eca_modeller_bpmn (1.1.9 => 2.0.6)
  - Upgrading drupal/eca_tamper (1.0.6 => 2.0.1)
  - Upgrading drupal/eca_ui (2.0.5 => 2.0.6)
  - Upgrading drupal/eca_vbo (1.1.1 => 2.1.1)
  - Upgrading laminas/laminas-feed (2.22.0 => 2.23.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 10 updates, 0 removals
  - Syncing drupal/eca (2.0.6) into cache
  - Syncing drupal/bpmn_io (2.0.1) into cache
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Upgrading dragonmantank/cron-expression (v3.3.3 => v3.4.0): Extracting archive
    drupal/eca has modified files:
    M .gitlab-ci.yml
    M composer.json
    M config/install/eca.settings.yml
    M config/schema/eca.schema.yml
    M drush.services.yml
    M eca.info.yml
    M eca.install
    M eca.module
    M eca.services.yml
    M eca.tokens.inc
    620 more files modified, choose "v" to view the full list
    Discard changes [y,n,v,d,s,?]? y
  - Upgrading drupal/eca (dev-1.1.x 9f26878 => 2.0.6): Checking out 2.0.6 from cache
  - Upgrading drupal/eca_ui (2.0.5 => 2.0.6)
  - Upgrading drupal/eca_modeller_bpmn (1.1.9 => 2.0.6)
    drupal/bpmn_io has modified files:
    M .gitignore
    M .gitlab-ci.yml
    M .phpstan.neon
    M NOTICE.txt
    M bpmn_io.info.yml
    M bpmn_io.module
    M bpmn_io.permissions.yml
    M bpmn_io.routing.yml
    M build/.gitignore
    M build/package-lock.json
    26 more files modified, choose "v" to view the full list
    Discard changes [y,n,v,d,s,?]? y
  - Upgrading drupal/bpmn_io (dev-1.1.x 6f2515d => 2.0.1): Checking out 2.0.1 from cache
  - Upgrading laminas/laminas-feed (2.22.0 => 2.23.0): Extracting archive
  - Upgrading drupal/eca_commerce (1.0.0 => 2.0.1): Extracting archive
  - Upgrading drupal/eca_flag (1.0.0 => 2.0.0): Extracting archive
  - Upgrading drupal/eca_tamper (1.0.6 => 2.0.1): Extracting archive
  - Upgrading drupal/eca_vbo (1.1.1 => 2.1.1): Extracting archive
Generating autoload files
Hardening vendor directory with .htaccess and web.config files.
76 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Cleaning installed packages.

When I try to run drush cr the following error occurs:

TypeError: Drupal\eca\Processor::__construct(): Argument #4 ($event_plugin_manager) must be of type Drupal\eca\PluginManager\Event, int given, called in /var/www/***/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 in Drupal\eca\Processor->__construct() (line 113 of /var/www/***/modules/contrib/eca/src/Processor.php).

Running drush updatedb does list schema updates but the process fails.

Thanks for any insights on what I can do to upgrade my site to 2.x

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇹🇭Thailand AlfTheCat

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

Comments & Activities

  • Issue created by @AlfTheCat
  • 🇩🇪Germany jurgenhaas Gottmadingen

    There are some messages in the logs above that are strange, especially those that you have modified files for eca and bpmn_io. That sounds like you had checked out git repositories for those modules and not released versions. To be sure that you have clean code bases, please delete the directories for modules/contrib/bpmn_io and modules/contrib/eca and all other eca-related module-directories there.

    Also, make sure that you don't have any outdated patches in your composer that would be falsely applied.

    After that, run composer update and that should cleanly download and install the latest code for all those modules.

    If after that your drush cr still doesn't work, then clear caches manually. You need to truncate all database tables that are named as cache* and if you use other caching stores like e.g. Redis, truncate their storages as well. After that, drush cr should be working again.

  • 🇹🇭Thailand AlfTheCat

    Hi Jurgen, thanks for this, I will try this method and report back.

  • 🇹🇭Thailand AlfTheCat

    Hi Jurgen,

    I got through the update this morning. In my case, I had to:

    1 - remove the ai_interpolator_eca module from composer
    2 - truncate all cache tables
    3 - apply a patch to the openai module 🐛 Return type declaration error for Drupal\openai_eca\Plugin\Action\OpenAIActionBase::create RTBC
    4 - apply a patch to the prompt module 📌 Get ready for ECA 2.0 Needs review
    5 - fix issues caused by 📌 Rename data name to ai_automators Active that were preventing drush updatedb from running (I documented the fixes there)

    After all that, the update ran great and it looks like all my models are in good shape and I've reached my coffee limit far before noon.

    Thanks for your guidance, it certainly helped.

Production build 0.71.5 2024