I'm using Workflow Node, and am always cautious about updating Workflow, so I chose to update it from 7.x-2.5 to 7.x-2.6 in an otherwise fully up-to-date development environment, using drush 7.1.0, running under PHP 5.5.30. 'drush status' indicated that everything was good prior to attempting the update. I cleared Drupal's caches prior to running the update.
The update appeared to run successfully, including running database updates 7016 and 7017, but then drush was unable to clear Drupal 7.41's caches, and Drupal was no longer able to complete its bootstrap sequence, due to this error:
PHP Fatal error: require_once(): Failed opening required '/**removed**/sites/all/modules/workflow/includes/Entity/WorkflowTransitionController.php'
Here's the full transcript with some unneeded information removed:
$ drush up workflow
Update information last refreshed: 21 November 2015 - 2:40pm
Name Installed Version Proposed version Message
Workflow API (workflow) 7.x-2.5 7.x-2.6 Update available
Code updates will be made to the following projects: Workflow [workflow-7.x-2.6]
Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project workflow was updated successfully. Installed version is now 7.x-2.6.
Backups were saved into the directory /**removed**/drush-backups/**removed**/20151121144009/modules/workflow. [ok]
Workflow 7016 Add an index to {workflow_node_history}.nid.
Workflow 7017 Add a primary key to {workflow_scheduled_transition}.
Do you wish to run all pending updates? (y/n): y
Performed update: workflow_update_7016 [ok]
Added stid primary key to {workflow_scheduled_transition} [ok]
Performed update: workflow_update_7017 [ok]
require_once(/**removed**/sites/**removed**/sites/all/modules/workflow/includes/Entity/WorkflowTransitionController.php):[warning]
failed to open stream: No such file or directory bootstrap.inc:3211
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: require_once(): Failed opening required
'/**removed**/sites/**removed**/sites/all/modules/workflow/includes/Entity/WorkflowTransitionController.php'
(include_path='.:/usr/local/share/pear') in /**removed**/sites/**removed**/includes/bootstrap.inc, line 3211
PHP Fatal error: require_once(): Failed opening required '/**removed**/sites/**removed**/sites/all/modules/workflow/includes/Entity/WorkflowTransitionController.php' (include_path='.:/usr/local/share/pear') in /**removed**/sites/**removed**/includes/bootstrap.inc on line 3211
The external command could not be executed due to an application error. [error]
Finished performing updates. [ok]
Subsequent attempts to manually clear Drupal's caches failed, with the same 'require once()' failure to open workflow/includes/Entity/WorkflowTransitionController.php which is not present in Workflow 7.x-2.6, but was in Workflow 7.x-2.5.
Drupal failed to bootstrap after this, yielding http 500 errors in Apache 2.4.
It appears that the entire set of Entity support files have been rewritten between the two versions of Workflow.
My solution was to temporarily drop a copy of 'WorkflowTransitionController.php' taken from 7.x-2.5 into Workflow 7.x-2.6's 'includes/Entity' directory, in order to satisfy Drupal's 'require once()' requirement, then I was able to run 'drush cc all', and after clearing the caches I was then able to remove 'WorkflowTransitionController.php' and everything appears to be working properly.
I'm not familiar with the intricacies of Drupal's bootstrap procedure, but it seems that the Workflow update left it stuck in a strange situation where it couldn't bootstrap in order to clear its cache, and clearing its cache was all that was required to enable it to bootstrap again. The new version of Workflow appears to be functioning properly, so it seems that some omission in Workflow's update procedures probably caused my problem.
Comment | File | Size | Author |
---|---|---|---|
#20 | workflow-fatal_errors_upgrading-2620530-20.patch | 1.21 KB | Mac_Weber |
Comments
Comment #2
activelink CreditAttribution: activelink as a volunteer commentedComment #3
johnvIndeed. The file workflow/includes/Entity/WorkflowTransitionController.php is removed.
I assume this is not supported. I will re-add an empty file to the next version.
Comment #5
johnvComment #7
johnvA 2.7 release is now created to avoid this core error.
Comment #8
NancyDruSorry, but I got this going from 2.5 to 2.7, so the new release did not fix it. I got around it by using the empty interface technique.
Comment #9
johnvFrom #2631844-8: Fatal Errors on Update using drush describing the 'empty interface technique':
This same issue also happens in Drupal multisites. The first site where the update is done is ok done manually, the succeeding sites cannot even login:
The temp fix is to insert :
before:
Comment #10
johnvAccording to #2604054-13: Update from 7.x-1.2 to 7.x-1.5 => PHP Fatal error: require_once(): Failed opening required, this is a core bug.
Comment #13
johnvAbove commit adds
include_once('WorkflowInterface.php');
to Workflow.php, as suggested by user activelink in #2638438: Upgrading from 7.x-2.6 to 7.x-2.7 with drush breaks Drupal 7.41 .Comment #14
johnvSetting this to NR, only to keep it open, for new drush upgrades.
Comment #15
NancyDruI didn't Drush, but the update 2.5 to 2.8 on my stage site was smooth.
Comment #16
johnvThat is good news, but i am afraid the error only appears when drushing..
Comment #17
johnvHappy new year!!
Comment #18
activelink CreditAttribution: activelink as a volunteer commentedThis is a response to your request in https://www.drupal.org/node/2638438#comment-10710444 - I guess that this is the 'other issue'?
I wasn't able to take my development site back to workflow 7.x-2.5, as the upgrade to 7.x-2.6 had made changes to the database, but I successfully ran the update from 7.x-2.7 to 7.x-2.8 with drush with no errors. I then manually removed workflow 7.x-2.8, replaced it with workflow 7.x-2.6, cleared caches, verified that my development site was working correctly, and ran "drush up workflow", and drush updated my development site back to workflow 7.x-2.8 without a hitch, so I can report that:
You also asked about how I cleared cache when I used drush to update... "drush up" always clears all caches as the final step of an update, so this does not normally need to be performed manually. You can see the entire process in the transcripts that I posted. The only item not shown in those is that I ran "drush cc all" prior to running the problematic updates, as I always do before I make updates. For consistency, I did the same before running the two tests that you requested above, to ensure a worst-case scenario that was most likely to break, if my assumptions about how core clears all caches are correct.
I hope this helps, and thanks for all your work on workflow (unintended pun impossible to avoid!) - Happy New Year!
Comment #19
Mac_Weber CreditAttribution: Mac_Weber as a volunteer commentedI just got this error running
drush updb
to update from2.5
to2.8
using drush.Output in first run:
Second run:
Comment #20
Mac_Weber CreditAttribution: Mac_Weber as a volunteer commentedThis patch drops the primary key before adding a new one: https://api.drupal.org/comment/45893#comment-45893
It also fixes the coding standards in this method.
Comment #22
johnv