I have a production website running Commons 7.x-3.3. I made a copy of it in another folder with another database running on a separate port for testing purposes (for testing upgrading to 3.5). I extracted Commons 3.5 and deleted the sites folder and moved the sites folder from the test website's docroot into the Commons folder. I moved robots.txt and then renamed the old folder to docroot_old and the new one to docroot. I ran a script to reset the permissions on the file structure and then attempted to browse to update.php. However, I got the following error:
Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479

I ran `drush rr`, `drush cc all`, and then tried `drush updatedb` and this is what I saw:

fclub@prod:~/fctest/docroot/sites/default$ drush rr
The registry has been rebuilt. [success]
'drush' cache was cleared [success]
fclub@prod:~/fctest/docroot/sites/default$ drush cc all
PHP Fatal error: Class 'RulesEventHandlerEntityBundle' not found in /var/www/html/fctest/docroot/profiles/commons/modules/contrib/rules/modules/node.rules.inc on line 147
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Class 'RulesEventHandlerEntityBundle' not found in
/var/www/html/fctest/docroot/profiles/commons/modules/contrib/rules/modules/node.rules.inc,
line 147

Fatal error: Class 'RulesEventHandlerEntityBundle' not found in /var/www/html/fctest/docroot/profiles/commons/modules/contrib/rules/modules/node.rules.inc on line 147
fclub@prod:~/fctest/docroot/sites/default$ drush updatedb
The following updates are pending:

system module :
7078 -

commons module :
3107 -
3108 -

commons_bw module :
7301 -
7302 -

commons_events module :
7010 -

commons_events_pages module :
7301 -

commons_follow_user module :
3102 -

commons_groups module :
3113 -
3114 -

commons_like module :
3000 -

commons_misc module :
7000 -

commons_notify module :
7301 -
7302 -
7303 -
7304 -

commons_polls module :
7002 -
7003 -

commons_posts module :
7003 -
7004 -

commons_q_a module :
3108 -
3109 -

commons_radioactivity_groups module :
7300 -

commons_search module :
7001 -

commons_site_homepage module :
7301 -

commons_wikis module :
7006 -
7007 -

dblog module :
7002 -

field module :
7003 -

image module :
7005 -

panels module :
7302 -

quicktabs module :
7303 -

rules module :
7210 -
7211 -
7212 -
7213 -

rules_scheduler module :
7203 -
7204 -

Do you wish to run all pending updates? (y/n): y
Performed update: commons_notify_update_7301 [ok]
Performed update: rules_update_7210 [ok]
Performed update: commons_notify_update_7302 [ok]
Performed update: rules_update_7211 [ok]
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Unsupported operand types in
/var/www/html/fctest/docroot/modules/field/field.info.class.inc, line
479
PHP Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479

Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479The external command could not be executed due to an application [error]
error.
Finished performing updates. [ok]
fclub@prod:~/fctest/docroot/sites/default$

Comments

jlea9378’s picture

Note: I encountered the same problem when I tried upgrading from 3.3 to 3.4. I gave up and started over with 3.3 to 3.5 instead. The issue upgrading from 3.3 to 3.4 is here: #2126711: Errrors upgrading to 7.x-3.4

WebSinPat’s picture

hello @jlea9378, i have not tried the update myself yet (I found your issue by browsing the queue to see what issues people are reporting before I subject myself to the upgrade process), but the first thing that comes to mind is that from 3.3 to 3.5+, the profiles/commons directory structure was changed, so I think you have to delete the old profile/commons/* before unzipping the new version on top of it.
If you already did that, then I have no idea but with you the best of luck. and myself as well when I give it a shot.

jlea9378’s picture

I didn't mix the two versions together. Only the sites directory remains from the old installation. So that doesn't help. Thanks anyways.

WebSinPat’s picture

yes, I followed the upgrade instructions at aquia docs.

@jlea9378 I am trying the 3.3 -> 3.6 path and running into the same sort of errors you report here and in your 3.4 issue as well.

I cannot get anything to load and cannot get any drush commands to run, everything generates.
Error: Class 'RulesEventHandlerEntityBundle' not found

I'll go ahead and file a new issue against 3.6 too.
Has anyone successfully upgraded from 3.3??

jlea9378’s picture

@WebSinPat:
unfortunately the solution to the error you were getting didn't help me. I'm still getting the other error:
Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479
when upgrading.

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)

Hi folks - I'm sorry to hear that you're having difficulty updating between versions of Commons.

I researched this issue and found the following issue in Rules, which describes the symptoms here as a combination issues in Rules and Drush, both of which have been fixed: #2090511: <7.x-2.4 breaks site with "Fatal error: Class 'RulesEventHandlerEntityBundle' not found".

Are you able to resolve the issue by:
1) Updating Drush to the latest version (eg, of the 5.x branch, or any branch that includes a fix to this issue: https://github.com/drush-ops/drush/issues/132)?2)
2)With the latest Commons codebase in place, making sure that there are no duplicate copies of the Rules module in your codebase, running "drush updatedb"?

Marking as "needs more info." Please let us know if these steps resolve your update issues. We want to make sure you're able to run the latest and greatest version of Commons. Thanks!

ezra-g’s picture

jlea9378’s picture

Title: Issues upgrading from 3.3 to 3.5 » Issues upgrading from 3.3 to 3.6
Version: 7.x-3.5 » 7.x-3.6
Status: Postponed (maintainer needs more info) » Active

Ezra, I started over from a fresh copy of our production site and did the following:
-Disabled all non-Commons and non-Core modules
-Placed the site in maintenance mode
-Downloaded Commons 3.6 and extracted it
-Replaced the sites folder of 3.6 with the sites folder from our site.
-Ran drush rr and drush cc all

After that I got this error:
Fatal error: Class 'RulesEventHandlerEntityBundle' not found in /var/www/html/fctest/docroot/profiles/commons/modules/contrib/rules/modules/node.rules.inc on line 147

Afterward, we tried upgrading Drush to a more recent version and I did another drush rr and drush cc all.

After that I got this error instead:
Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479

The issue you referenced said to do drush dl rules followed by drush updatedb, so I tried that, but it didn't help. I even tried deleting rules from the profile Commons modules directory. But it didn't help.

fclub@prod:~/fctest/docroot/sites/default$ drush updatedb
System 7078 7078 -
Commons 3108 3108 -
Commons 3109 3109 -
Commons 3110 3110 -
Commons_bw 7301 7301 -
Commons_bw 7302 7302 -
Commons_events 7010 7010 -
Commons_events_pages 7301 7301 -
Commons_follow_node 3501 3501 -
Commons_follow_term 3501 3501 -
Commons_follow_user 3102 3102 -
Commons_follow_user 3501 3501 -
Commons_groups 3113 3113 -
Commons_groups 3114 3114 -
Commons_like 3000 3000 -
Commons_misc 7000 7000 -
Commons_notify 7302 7302 -
Commons_notify 7303 7303 -
Commons_notify 7304 7304 -
Commons_polls 7002 7002 -
Commons_polls 7003 7003 -
Commons_posts 7003 7003 -
Commons_posts 7004 7004 -
Commons_profile_base 7000 7000 -
Commons_q_a 3108 3108 -
Commons_q_a 3109 3109 -
Commons_radioactivity_groups 7300 7300 -
Commons_search 7001 7001 -
Commons_site_homepage 7301 7301 -
Commons_wikis 7006 7006 -
Commons_wikis 7007 7007 -
Dblog 7002 7002 -
Field 7003 7003 -
Image 7005 7005 -
Panels 7302 7302 -
Quicktabs 7303 7303 -
Rules 7211 7211 -
Rules 7212 7212 -
Rules 7213 7213 -
Rules_scheduler 7203 7203 -
Rules_scheduler 7204 7204 -
Do you wish to run all pending updates? (y/n): y
Performed update: commons_notify_update_7302 [ok]
Performed update: rules_update_7211 [ok]
PHP Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479

Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Unsupported operand types in
/var/www/html/fctest/docroot/modules/field/field.info.class.inc, line
479
The external command could not be executed due to an application [error]
error.
PHP Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479

Fatal error: Unsupported operand types in /var/www/html/fctest/docroot/modules/field/field.info.class.inc on line 479
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Unsupported operand types in
/var/www/html/fctest/docroot/modules/field/field.info.class.inc, line
479
[error]
Drush was not able to start (bootstrap) Drupal.
Hint: This error can only occur once the database connection has
already been successfully initiated, therefore this error generally
points to a site configuration issue, and not a problem connecting to
the database.

Drush was attempting to connect to:
Drupal version : 7.24
Site URI : http://default
Database driver : mysql
Database username : user
Database name : drupal_test
Database : Connected
Default theme : fosterclub
Administration theme : seven
PHP executable : /usr/bin/php
PHP configuration : /etc/php.ini
PHP OS : Linux
Drush version : 6.0-rc4
Drush configuration :
Drush alias files :
Drupal root : /var/www/html/fctest/docroot
Site path : sites/default
File directory path : sites/default/files
Temporary file directory path : /tmp

The external command could not be executed due to an application [error]
error.
Finished performing updates. [ok]
fclub@prod:~/fctest/docroot/sites/default$

It looks like it is definitely running into a problem on the rules module. But how do we get past it?

japerry’s picture

Personally, I've had better luck when using the GUI update.php instead of doing drush. If I run update.php 2 or 3 times (depending on how out of date it is), it should work.

Alternatively, in every update, you can try reverting the commons features. That field error is probably due to a missing field that is created by a new feature added (That hasn't been applied because the feature didn't revert properly, or may need to be reverted twice)

If you get the error, try revertting all overridden features and re-running updb.

jlea9378’s picture

Unfortunately the fatal error I'm getting prevents me from doing anything.

I tried going from 3.3 to 3.4 but I encountered the same problem. I tried doing a feature revert and disabling all contributed modules before doing the upgrade from 3.3 to 3.4 but that didn't help.

I seem to be completely stuck on 3.3.

jlea9378’s picture

Status: Active » Closed (cannot reproduce)

It turned out the problem was a result of some problems from our data migration. Some records in field_config_instance were pointing at the wrong fields in field_config. Once I fixed that the upgrade to 3.4 worked.

Matt V.’s picture

Version: 7.x-3.6 » 7.x-3.8
Status: Closed (cannot reproduce) » Active

I've had trouble upgrading a Commons site from 3.0. To eliminate any site-specific quirks from the equation, I just tried installing a fresh, plain vanilla install of Commons 3.0 with just the example content. I then tried upgrading that site to 3.8. I followed the Upgrading Drupal Commons documentation, putting the site in maintenance mode before opening update.php. Only some of the updates ran before I encountered the following error:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows.

Path: http://cmnstest.dev/update.php?op=selection&token=foo&id=8&op=do StatusText: OK

ResponseText: Fatal error: Class 'RulesEventHandlerEntityBundle' not found in /path/to/commonstest.dev/www/profiles/commons/modules/contrib/rules/modules/node.rules.inc on line 147 Call Stack: 0.0001 332424 1. {main}() /path/to/commonstest.dev/www/update.php:0 5.4998 9337556
…

I think the issue may be related to #2090511: <7.x-2.4 breaks site with "Fatal error: Class 'RulesEventHandlerEntityBundle' not found". I haven't yet tried the suggestion there to run the update without putting the site into maintenance mode. I'll try that next and report back.

Matt V.’s picture

I started from another fresh, plain vanilla install of Commons 3.0 with just the demo content and I tried to upgrade to 3.8. This time I tried *not* putting the site in maintenance mode, as recommended in #2090511: <7.x-2.4 breaks site with "Fatal error: Class 'RulesEventHandlerEntityBundle' not found". Again I got the same error mentioned in Comment #12 above.

Matt V.’s picture

For what it's worth, again starting with a fresh Commons 3.0 install, I've now also tried running update.php but with APC disabled, as suggested in some of the comments on #2090511: <7.x-2.4 breaks site with "Fatal error: Class 'RulesEventHandlerEntityBundle' not found". And I still get the same error.

ezra-g’s picture

Status: Active » Postponed
Issue tags: +commons 7.x-3.9 radar

Thanks for the troubleshooting efforts, Matt V.! It looks like the issue for the underlying bug in the Rules module has been re-opened (#2090511: <7.x-2.4 breaks site with "Fatal error: Class 'RulesEventHandlerEntityBundle' not found"). Therefore, I'm marking this issue as "postponed" so that we can consolidate troubleshooting information in the Rules module queue with the hopes of finding a definitive solution for all users of the Rules module.

Adding this issue to the Commons 3.9 radar so that it doesn't slip from our attention.

ezra-g’s picture

Title: Issues upgrading from 3.3 to 3.6 » Fatal error: Class 'RulesEventHandlerEntityBundle' not found" when Upgrading