When you have at least a node type defined by a non-enabled module (which is generally the case if you update core and contrib separately), the drupal_flush_all_caches() at the end of the installation will trigger a node_types_rebuild(), that will call node_type_delete(), that will call comment_node_type_delete(), that will fail with a call to field_attach_delete_bundle().

Not completely sure why.

Fatal error: Call to undefined function field_attach_delete_bundle() in /home/drupalorg/www7/modules/comment/comment.module on line 274

Call Stack: 0.0000 99120
1. {main}() /home/drupalorg/www7/update.php:0 2.7236 4460440
2. _batch_page() /home/drupalorg/www7/update.php:425 2.7240 4552352
3. _batch_finished() /home/drupalorg/www7/includes/batch.inc:90 2.7246 4589872
4. update_finished() /home/drupalorg/www7/includes/batch.inc:451 2.7246 4590264
5. drupal_flush_all_caches() /home/drupalorg/www7/includes/update.inc:830 5.0526 8739120
6. node_types_rebuild() /home/drupalorg/www7/includes/common.inc:6242 5.0532 8743776
7. node_type_delete() /home/drupalorg/www7/modules/node/node.module:470 5.0535 8746888
8. module_invoke_all() /home/drupalorg/www7/modules/node/node.module:639 5.0539 8749920
9. call_user_func_array() /home/drupalorg/www7/includes/module.inc:698 5.0539 8750712
10. comment_node_type_delete() /home/drupalorg/www7/includes/module.inc:0
CommentFileSizeAuthor
#3 module_load_include.patch2.74 KByched

Comments

damien tournoud’s picture

Hm. It seems that system_update_7008() failed on my test upgrade of the d.o database.

damien tournoud’s picture

Title: Call to undefined function field_attach_delete_bundle() at the end of the installation » system_update_7008() is broken
yched’s picture

Status: Active » Needs review
StatusFileSize
new2.74 KB

We're talking about a D6 update, right ? OP and initial title mention "at the end of the installation".

I guess field.attach.inc is not loaded at that time.
It's probably because field.module uses module_load_include() to load its helper files. I think I remember an issue somewhere where the conclusion was "no module_load_include() at file root".
Attached patch fixes this, and file.module while we're at it. image.module already uses require_once.

Now, the real issue IMO is the 1st part of the report : "When you have at least a node type defined by a non-enabled module (which is generally the case if you update core and contrib separately), we call node_type_delete() at the end of the update".
Er, scary.

damien tournoud’s picture

In my case, it was system_update_7008() failing that was failing the rest of the upgrade in the system module, including the enabling of the field module.

scor’s picture

I think I remember an issue somewhere where the conclusion was "no module_load_include() at file root".

see #599122: Do not use module_load_include() in global context

catch’s picture

Status: Needs review » Closed (duplicate)

This is a duplicate per #5, patches are identical except for additional comments over there.