Update 12 Aug 2013: The registry has been removed from Drupal 8 and is less critical. However it is still critical for D7.

catch notes in comment #130 that while we no longer write the info to the {system} table, some alters may affect what does get saved to config. The patch at #134 needs review.

Problem/Motivation

If a file containing a class is moved (either during development or by contrib/core updates), then the registry will be out of date before it is rebuilt.

If the registry is out of date, it is possible (and on some sites, likely) that it will try to request an out of date file during hook_boot(), hook_init() or a hook that is called during page rendering. This often results in a situation where the registry can be built neither via triggering a rebuild from the UI (i.e. saving the modules page), nor from drush cc all - since Drupal will throw fatal errors before getting to that point.

The original proposal (and committed patch) in this issue added a registry_rebuild() to update.php - so that hitting that file would trigger a rebuild in a reduced environment (i.e. not requiring a full bootstrap). However, registry_rebuild() causes two hooks to be invoked - hook_system_info_alter() and hook_registry_files_alter(). If all modules aren't loaded when these hooks are called, then those alter hooks won't be invoked, and this can also leave the registry in an inconsistent state - for example ctools_registry_files_alter().

Proposed resolution

Update 12 Aug 2013: "Throw away the system info cache if not yet at full bootstrap" see comment #130

Add as much as possible of a full bootstrap (making an attempt not to invoke hooks like _boot() and init()) to system_rebuild_module_data() or similar, then re-add registry_rebuild() somewhere to update.php.

If you just need to rebuild a broken registry for now take a look at Registry Rebuild.

Remaining tasks

A better solution to this problem needs to be figured out for Drupal 8.
There is a patch at comment #134

User interface changes

No user facing changes. Inclusion of an easy 'rebuild registry' / 'fix my site' button was discussed but not implemented.

API changes

None

Original report by Frando

The attached patch adds a new file to drupal called recovery.php. This file clears all caches and rebuilds the registry and the menu. Most of this is done already on admin/build/modules, but there are situations where that won't be accessible.

Very simple proof that this is needed: Make sure toolbar.module is activated, then delete modules/toolbar/toolbar.module and bam, your site is unusable. Visit recovery.php and it will work again. Now, of course you say why should you delete such a file, but especially during development you can break the registry a lot of times, e.g. when moving code around. There is no good way to fix this without such a script (as, with a broken registry, you usually cannot boot up to DRUPAL_BOOTSTRAP_FULL and therefore neither visit admin/build/modules nor get to the "clear all caches" button). This is why recovery.php first boots up to DRUPAL_BOOTSTRAP_DATABASE, loads needed includes and then performs a registry_rebuild() before finishing the bootstrap and clearing the other caches and doing a menu rebuild.

Some credit goes to chx for the initial idea and the initial (but not working) code at http://drupalbin.com/9754.

CommentFileSizeAuthor
#173 534594-173-D7-system-info-cache_0.patch1.03 KBmgifford
#170 534594-170-D7-system-info-cache.patch1.04 KBmgifford
#165 534594-165-D7-system-info-cache.patch1.07 KBmgifford
#159 534594-159-D7-system-info-cache.patch1.07 KBmgifford
#153 534594-153-system-info-cache.patch1.28 KBAnonymous (not verified)
#151 534594-151-system-info-cache.patch1.42 KBAnonymous (not verified)
#134 534594-133.patch1.24 KBstar-szr
#130 system_info.patch1.24 KBcatch
#118 registry-recovery-534594-118.patch6.91 KBAnonymous (not verified)
#116 registry-recovery-534594-116.patch6.65 KBAnonymous (not verified)
#114 registry-534594-114-tests.patch3.53 KBxjm
#114 registry-534594-114-combined.patch6.36 KBxjm
#114 interdiff.txt1.68 KBxjm
#113 registry-recovery-534594-113.patch6.76 KBAnonymous (not verified)
#112 registry-recovery-534594-112.patch6.3 KBAnonymous (not verified)
#108 534594-108.patch3.27 KBAnonymous (not verified)
#106 534594_106.patch2.96 KBAnonymous (not verified)
#103 update-rebuild-registry-fixed.patch2.93 KBxjm
#99 update-rebuild-registry-99.patch2.9 KBxjm
#97 update_rebuild_registry.patch2.86 KBchx
#89 534594-89.patch5.44 KBxjm
#88 534594-88.patch1.27 KBxjm
#87 interdiff.txt704 bytesxjm
#86 registry.resource.patch4.07 KBAnonymous (not verified)
#85 registry.resource.patch3.84 KBAnonymous (not verified)
#81 534594-81.patch1.19 KBxjm
#79 534594-79.patch759 bytesxjm
#68 534594-node-68.patch739 bytespwolanin
#62 or_perhaps_a_noose.patch2.41 KBcatch
#45 or_perhaps_a_noose.patch2.85 KBcatch
#43 registry_can_go_slit_its_throat_too.patch2.81 KBcatch
#42 system_module_please_die.patch1.16 KBcatch
#38 drupal.registry-rebuild.38.patch1.48 KBsun
#28 registry.patch954 bytescatch
#23 rollback.patch516 bytescatch
#21 docs.patch583 bytescatch
#5 registry_rebuild.patch685 bytescatch
recovery.patch2.44 KBFrando
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

CorniI’s picture

great, subscribing :)

chx’s picture

Hm, this might want to go into update.php? Esp since that has access control and I feel like some access control would be great for this...

Frando’s picture

Yeah, access control is likely needed, otherwise we'd make any drupal site more or less a free for all victim to DoS attacks I fear as menu_rebuild is really expensive. So yes, merging with update.php sounds good (or at least sharing some code). I'm really low on free time currently and am so at least for the next week, so not sure when I'll come around to do that. If anyone wants to go for it, go for it.

coltrane’s picture

Status: Needs review » Needs work

Setting to CNW then. I agree access control is needed.

catch’s picture

Title: Add a recovery script » Add registry_rebuild() to update.php
Status: Needs work » Needs review
FileSize
685 bytes

Added the registry_rebuild() to update.php. Not sure where it's best to put the menu_rebuild() and drupal_flush_all_caches(), but this works for the registry recovery anyway

moshe weitzman’s picture

Pretty quickly, visiting update.php is going to be as slow as modules page. I think we should add a recovery button to the current first page of update.php. that submit handler can flush caches and rebuild menu.

catch’s picture

I think it's fine for update.php to be slow, not averse to a 'fix my site' button either though.

coltrane’s picture

I don't like running the update process to rebuild the registry so I favor Moshe's idea of a submit handler on a button. But update.php having the use of a "recovery" or rebuild is misleading.

catch’s picture

Well, update.php needs to handle rebuilding the registry anyway, because a module adding or removing a hook implementation can hose your site completely.

coltrane’s picture

Sure, so to clarify the point of this issue is the ability for someone to just run registry_rebuild() because something got hosed. update.php does that, I'm just stating that I think update.php has been and should stay about updating modules and something new created for this issue. But, I understand not duplicating code and not adding another top-level file so perhaps Moshe's idea is the route to go.

Frando’s picture

I actually still quite like the idea of a seperate recovery script. Or a button/link on update.php that calls the code in the OP. Registry rebuilding is use case #1, but it'll be also very handy during development to simply have that "one click to rebuild 'em all".

cburschka’s picture

What's the status of this?

The suggestions seem to be

  1. Add recovery.php that will rebuild all registries and flush all caches.
  2. Add a recovery button to update.php.
  3. Automatically flush caches whenever update.php is called.

Number 3 has the drawback of being hard to find and incurring a performance cost. Number 2 may also be hard to find, while number 1 introduces a new top-level file when we already have three (authorize.php).

pwolanin’s picture

We still also really need a "fix my site" button (and may also a function that can be called by drush and the like)

pwolanin’s picture

Priority: Normal » Critical

This is really impeding development for D7.

catch’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7
catch’s picture

Dries’s picture

Status: Needs review » Fixed

Committed to 7.x and 8.x. Thanks!

David_Rothstein’s picture

Version: 8.x-dev » 7.x-dev
Status: Fixed » Reviewed & tested by the community

Still needs to go in D7.

catch’s picture

Issue tags: -Needs backport to D7

#5: registry_rebuild.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs backport to D7

The last submitted patch, registry_rebuild.patch, failed testing.

catch’s picture

Title: Add registry_rebuild() to update.php » Fix documentation for registry_rebuild() call in update.php
Version: 7.x-dev » 8.x-dev
Category: task » bug
Priority: Critical » Normal
Status: Needs work » Needs review
FileSize
583 bytes

I pulled 7.x and this made it in, not sure why David thought this hadn't been applied - maybe git log isn't handling commits to both branches so well?

Unfortunately the comment in the patch dates back to when we had the function registry, now we don't.

Anonymous’s picture

Title: Fix documentation for registry_rebuild() call in update.php » registry_rebuild() call in update.php breaks contrib modules that implement hook_registry_files_alter()
Status: Needs review » Active

i think we need to roll this back.

registry_rebuild() in update.php happens before a full bootstrap, so modules that rely on a fully bootstrapped drupal to properly implement hook_registry_files_alter() don't put all the resources they need into the registry.

symptom is issues like #1170312: After updating to Drupal 7.2 Fatal error: Class 'ctools_export_ui' not found.

catch’s picture

Priority: Normal » Critical
Status: Active » Reviewed & tested by the community
FileSize
516 bytes

Reasons not to commit patches from 'code needs review' part 293.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Ok, committed the rollback to 8.x and 7.x. This broke (as in fatal error, destroy-your-site kind of broke) sites with CTools module, at least.

catch’s picture

Discussed this with beejeebus, merlinofchaos and webchick in irc and this whole issue is even more of a snake pit than we thought.

http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/regist...

registry_rebuild() depends on system module.

system_rebuild_module_data() invokes hook_system_info_alter() - but there is no guarantee that all modules are loaded when that hook runs.

_registry_update() invokes hook_registry_files_alter(), but again there is no guarantee that all modules are loaded when that runs.

This patch added a call to registry_rebuild() before a full bootstrap.

ctools implements hook_registry_files_alter(), and the classes it is registering are used all over the place.

Boom!

At least for Drupal 7, I think we need to do something like the following. For Drupal 8 this will require dismantling most of system module and having a module system that doesn't depend on itself and a class autoloader that either doesn't depend on the module system or doesn't pretend to be useful for anything other than classes in modules.

But for now:

1. registry_rebuild() should add a full bootstrap right inside, possible we should even move it to system.module or common.inc to enforce this slightly more.

2. No class that can ever be used before full bootstrap can use the registry for autoload, that includes core classes, otherwise we can never, ever move them safely.

3. No hook_boot() implementation can rely on the registry for autoload, that's the same as #2, hmm.

Another possibility is to add bootstrap_alter(), make both hook_registry_files_alter() and hook_system_info_alter() bootstrap hooks, and then registry_rebuild() might work at a lower bootstrap level, but that won't remove the recursive dependency, it'll just be adding a (quite ugly) bandaid to it.

None of these solutions are good so it is a case of which makes us throw up least.

Modules that own classes that want to move them, will have to add registry_rebuild() in a hook_update_N() until this is sorted out, this worked for #1134798: EntityCacheTaxonomyTermController not found.

catch’s picture

Title: registry_rebuild() call in update.php breaks contrib modules that implement hook_registry_files_alter() » registry_rebuild() depends on full bootstrap

Re-titling slightly.

Anonymous’s picture

i think we need to do 1. from #25, and lots of doco.

really want to kill the concept of a registry for D8, and make it more of a classical class autoloader.

catch’s picture

Status: Needs work » Needs review
FileSize
954 bytes

Not enough docs but I wonder if this is enough to make it work.

sun’s picture

Status: Needs review » Needs work
+++ b/modules/system/system.module
@@ -2383,6 +2383,7 @@ function _system_rebuild_module_data() {
+    module_load_all();

IMHO we'll only introduce more weird and unexpected behaviors by automatically loading all modules here.

Instead, the calling code should have to ensure that the environment for executing a command is properly setup before executing the command.

In turn, I'd rather like to see a module_load_all(NULL) condition here (or at the beginning of registry_rebuild()) that merely checks whether all modules have been loaded, but doesn't autoload them. In case they were not, we throw an exception or do whatever else that halts processing and ensures the command is not executed and the caller gets to know of the bogus invocation attempt.

Powered by Dreditor.

catch’s picture

I'm not sure that will work for system_rebuild_module_data(), but there's an easy way to find out.

However throwing the error doesn't deal with the original point of this issue, is that moving classes around completely hoses installs, maybe my hook_update_N() (and a handbook page with instructions on how to hack index.php) is enough though? Then docs, then checking we don't use autoload for anything in /includes.

Anonymous’s picture

catch, i don't think there's a clean way to handle the 'class moved' case, if that class is required for a full bootstrap. the only way to make this better involves API changes that i don't think we can get in for D7.

that really sucks, but it is what it is. i think we just need to enforce the dependency on a full bootstrap in registry rebuilds, and make it clear in code comments and elsewhere why.

we could also add something like this to ease the dev pain:

  if ($file) {
    require_once DRUPAL_ROOT . '/' . $file;

    // Classes and interfaces may get moved during development, which can lead
    // to hard to debug fatal errors. If configured to do so, provide some
    // feedback to developers if we loaded a file but not the resource.
    if (variable_get('registry_check_resource_loaded', FALSE)) {
      if (($type == 'class' && !class_exists($name)) || ($type == 'interface' && !interface_exists($name))) {
        throw new Exception(t("File @file was loaded for @type @name, but it was not found.", array('@file' => $file, '@type'
      }
    }
    return TRUE;
  }
catch’s picture

Status: Needs work » Needs review

@sun, this is broken beyond repair in D7 so we need something to fix it now, not how we'd like it to eventually work (which is going to require very large API changes), I'm marking back to CNR to give some other people the chance to review that approach.

Fabianx’s picture

Status: Needs review » Needs work

Subscribe

catch’s picture

Status: Needs work » Needs review

Re-setting.

catch’s picture

@justinrandell - for cases that can't be fixed with loading all modules, then that seems like all we can do for classes that are needed prior to full bootstrap in Drupal 7.

Anonymous’s picture

@catch - ok, want me to add that to the patch, or start another issue?

catch’s picture

This is an issue where things are broken either way, so if we can handle both kinds of broken in this issue as much as is possible that sounds good to me!

For testing this, if we go with the module_load_all() and/or force a bootstrap, we could do the following:

Two testing modules, one implements hook_boot() and calls registry_rebuild().

The other implements hook_system_info_alter() and hook_registry_files_alter() - just does drupal_set_message('something'); in each.

Then enable both modules from the test, hit a page, check for existence of both of the messages, ensure they don't show up when the hook_boot() module is disabled, that'd be it.

If we can hit update.php from simpletest (can't remember if we can or not) we could add the same check for that, minus the hook_boot() module.

If instead we went for the module_load_all(NULL) check that sun suggested, we'd be enforcing that every one of these functions can only be called after a full bootstrap:

http://api.drupal.org/api/drupal/modules--system--system.module/function...

That's a lot of functions, like I said just uploading the patch that does that should tell whether that's possible or not.

sun’s picture

As an example. I don't think that update.php allows to invoke registry_rebuild() - only system.module is loaded.

Status: Needs review » Needs work

The last submitted patch, drupal.registry-rebuild.38.patch, failed testing.

yareckon’s picture

sub.

catch’s picture

Title: registry_rebuild() depends on full bootstrap » registry_rebuild() and system_rebuild_module_data depend on all modules being loaded

Changing the title.

catch’s picture

Status: Needs work » Needs review
FileSize
1.16 KB

This is why #38 breaks:


function install_profile_modules(&$install_state) {
  $modules = variable_get('install_profile_modules', array());
  $files = system_rebuild_module_data();
  variable_del('install_profile_modules');

So I'm re-uploading #28 with an extra comment. Still needs a test but running by the test bot.

If we want the install system to not depend on system module, and I think we do, then we can work on that as part of the overall effort at #679112: Time for system.module and most of includes to commit seppuku, but that is not a critical Drupal 7 issue.

Will add tests later this evening or tomorrow if it's doable.

catch’s picture

With tests.

aspilicious’s picture

+++ b/modules/system/system.testundefined
@@ -1868,10 +1868,21 @@ class UpdateScriptFunctionalTest extends DrupalWebTestCase {
   }
+ ¶
+  /**
+   * Confirm that the call to registry_rebuild() on update.php fires successfully.

Trailing whitespace.

Nice test :)

Powered by Dreditor.

catch’s picture

FileSize
2.85 KB

Fixed the whitespace.

aspilicious’s picture

This problem got me yesterday...
Fixed it my self, else I could test this.

catch’s picture

rfay posted http://drupal.org/project/registry_rebuild

However we still need registry_rebuild() / _system_rebuild_module_data() to either handle loading all modules or not allow itself to run even if we were to completely give up on fixing this problem in core for D7.

pwolanin’s picture

looks reasonable, but need to review further.

catch’s picture

Status: Needs review » Active

Just spent over an hour discussing this with chx and beejeebus in irc, chx may have come up with a way around this that kills at least some of the circular dependencies:

- Add a variant of system_rebuild_module_data() that doesn't invoke any hooks (i.e. hook_system_info_alter()) - but just finds module files etc.
- Deprecate files[] completely.
- Remove hook_registry_files_alter()
- registry_rebuild() scans all modules for .module and .inc files, and adds them to the registry regardless of whether the module is enabled or disabled.
- the registry no longer differentiates between enabled or disabled modules - classes are added regardless.
- registry rebuilds will be more expensive, but we can likely avoid doing so as often as we currently do, so there might be a performance trade-off but it won't be a straight hit, and it'll only really be on rebuilds (the table size is not going to grow so much that runtime registry queries get noticeably slower, they'll all indexed, and registry rebuilds shouldn't block processes from executing hopefully).

sun’s picture

- Remove hook_registry_files_alter()

Libraries API needs this alter hook to register additional PHP libraries in */libraries directories.

neclimdul’s picture

I'll regret this later but... sub.

catch’s picture

@sun: so if we wanted to account for that and still remove the hook, we'd need to scan the libraries directory if it exists and also scan .php files?

sun’s picture

That's a tough question and I'm not familiar enough with fundamental principles of PHP OO auto-loading. Libraries need to be considered as external code; "PHP soup" if you will. They may contain code that's incompatible or shouldn't be used. Modules that use a certain library may only need a subset of what the library provides. (custom integration example) Lastly, note that libraries may exist in /libraries (distros), /profiles/*/libraries (installation profiles), and /sites/*/libraries (sites). Overrides are supposed to behave like module and theme overrides, but I guess/hope the current registry file parsing implements that already. In the end, we could simply try to hard-code the additional libraries paths to scan, even though it feels slightly sub-optimal to me.

catch’s picture

Status: Active » Needs review

OK, I'm moving this back to CNR. I wasn't aware that libraries module was using this hook, and that's a different use-case to the ctools one (which is just trying to avoid putting things in files[]), so we need more discussion.

We could force libraries module to implement it's own autoloader, but I imagine you wouldn't be overly keen on that.

pwolanin’s picture

Status: Needs review » Active

I think that's going to break too much. If simpletest cannot use autoloading, let's just rework it, and not break the rest of core for that edge case.

pwolanin’s picture

Status: Active » Needs review

cross posted - back to CNR

neclimdul’s picture

I think I agree with pwolanin though I'm not sure what his comment was responding too. We should make the registry behave as sanely as possible. The alter hook isn't being abused by ctools/libraries but the simpletest exceptions seem to be complicating things. We should optimise for core and the rest of contrib and solve simpletest separately.

basicmagic.net’s picture

subscribe

omercioglu’s picture

sub

rfay’s picture

Ironically, I didn't even know that this issue existed and was involved with the problems that caused the creation of Registry Rebuild. I thought it was just an entity/rules thing coming around to bite us. Thanks to all for your work on this.

I'm interested that the rollback happened about June 1, but I got bit only about June 20. And it seemed like there were piles of people affected in that timeframe. Could be that it came with the Entity/Rules/Commerce updates that forced the old version of this, and that I hadn't updated. Could be I guess.

catch’s picture

So entity/rules/commerce may have been hitting the original bug this issue was intended to help with - which is that if you move/rename a class, you can end up in an unrecoverable position.

The patch that got committed to 7.2 and was rolled back, would have fixed this except for hook_registry_files_alter(), which ctools was using to register classes on behalf of other modules, and the fact this hook wasn't run from the registry_rebuild() on update.php meant that this also left people in an unrecoverable position.

I haven't checked the code of the registry_rebuild() project, but it sounds like the two rebuilds approach may cover both of these cases, I assumed you'd seen this issue when I saw that project, otherwise I'd have pinged you about it..

The current patch here does two things:

1. Enforces that hook_system_info_alter() and hook_registry_files_alter() actually get invoked when their parent functions are called, currently they are some of the time, but other times not - by forcing a module_load_all(). This was a new discovery that was only tracked down by Justin after 7.2 had hosed some sites. An earlier patch by sun caused them to throw an exception if they were called during early bootstrap, but core itself does this deep in the installer so IMO it's not happening for D7.

2. Adds the registry_rebuild() back to update.php again in the hope that D7 itself can provide roughly the same functionality as registry_rebuild project does when you hit update.php (which you should after updating modules). Randy if you're able to review that based on having done a similar thing in registry_rebuild that'd be really handy.

catch’s picture

FileSize
2.41 KB

#45 is still valid, but if we wanted to just ensure the ctools issue can't happen again, here's a minimal patch that enforces modules are loaded when invoking hook_system_info_files_alter() and hook_registry_files_alter().

Status: Needs review » Needs work

The last submitted patch, or_perhaps_a_noose.patch, failed testing.

moshe weitzman’s picture

I really think it is a bad pattern for random parts of the codebase to do the job of the bootstrap. not a fan of that module_invoke_all().

catch’s picture

@moshe. It's a bad pattern for functions available (and currently required) at any bootstrap level to be dependent on all modules being loaded. The patch names describe my feelings about the issue, perhaps you could suggest an alternative? Note that sun's patch to throw the exception would require refactoring large parts of the installer and modules system to break all these circular dependencies. That is something that desperately needs to happen in D8 but won't get backported.

moshe weitzman’s picture

As long as we fix it with the exception in D8 then I'm OK with hackola for D7 (i.e. module_invoke_all).

carlos8f’s picture

subscribing

pwolanin’s picture

Status: Needs work » Needs review
FileSize
739 bytes

I think we should go forward with #45, as long as that avoids the ctools breakage.

However, here's a re-roll of the last patch without the test part which is not relevant.

xjm’s picture

Tagging issues not yet using summary template.

mrf’s picture

removing issue summary initiative tag

mrf’s picture

Issue summary: View changes

Adding issue summary as part of http://groups.drupal.org/node/167534

catch’s picture

Priority: Critical » Major

Since there's no good solution for this in D7 (although I would still go for #45) and http://drupal.org/project/registry_rebuild exists, I'm demoting this to major.

q0rban’s picture

Subscribe

fago’s picture

subscribing

wojtha’s picture

Status: Needs review » Needs work

I'm not sure whats the motivation of the #68 patch, but it doesn't fix the issue in the D7. After moving the modules from /modules to /modules/contrib the site hangs and there is no standard way how to rebuild the registry cache (admin/modules, update.php, drush cc - none of them works).

www# drush cc
WD php: Warning:                                                                                            [warning]
require_once(/www/sites/dev/css1-001-dev/www/sites/all/modules/entity/includes/entity.inc): failed to open
stream: No such file or directory in _registry_check_code() (line 2913 of
/www/sites/dev/css1-001-2-dev/www/includes/bootstrap.inc).
Drush command terminated abnormally due to an unrecoverable error.                                          [error]
Error: require_once(): Failed opening required
'/www/sites/dev/css1-001-2-dev/www/sites/all/modules/entity/includes/entity.inc'
(include_path='.:/usr/local/share/pear') in /www/sites/dev/css1-001-2-dev/www/includes/bootstrap.inc, line
2913
Exit 255
catch’s picture

Status: Needs work » Needs review

@wojtha - you'd need the patch from #45 and visit update.php to actually repair a broken registry.

This issue now incorporates two bugs:

1. Can't rebuild a broken registry.

2. registry_rebuild() can easily create an incomplete registry if called before all modules are loaded.

Moving back to needs review since we have patches that try to fix both of those and mainly need to decide on whether we're fixing either.

wojtha’s picture

I though the #68 by pwolanin was the same as the #45, just with the tests stripped. Now I see that pwolanin forgot to add registry_rebuild() in the update.php ... I'll try again.

catch’s picture

Priority: Major » Critical

#1327958: D8 upgrade path before /core move is completely hosed leaves unrecoverable, so I'm bumping this back to critical.

xjm’s picture

Issue tags: +Needs issue summary update
FileSize
759 bytes

Attached just rerolls #68 for core/. Can someone clarify what is missing from this patch? I compared it with #45 and did not see anything that was removed other than tests.

catch’s picture

It's the update.php hunk that's different:

diff --git a/update.php b/update.php
index a777920..c85f4c3 100644
--- a/update.php
+++ b/update.php
@@ -370,6 +370,9 @@ if (empty($op) && update_access_allowed()) {
   // in updated code are picked up.
   module_implements('', FALSE, TRUE);
 
+  // Rebuild the registry so that any classes moved by modules are rescanned.
+  registry_rebuild();
+
   // Set up $language, since the installer components require it.
   drupal_language_initialize();
 

Dave Reid reminded me about #1049284: Running update.php to flush caches no longer works unless there are updates pending, we could leave the registry building to that issue possibly (at least, for that issue to get fixed we need to correctly rebuild the registry on update.php as well as flushing other caches and registries).

xjm’s picture

FileSize
1.19 KB

Doing a full cache clear for #1049284: Running update.php to flush caches no longer works unless there are updates pending early enough for this issue makes update.php blow up in entertaining ways. So, I think the solution is separate. Attached is #79 with the registry rebuild from #80 added back in.

Status: Needs review » Needs work

The last submitted patch, 534594-81.patch, failed testing.

xjm’s picture

So, for the record, #81 will break update.php with both hunks, but not with just the one or the other.

xjm’s picture

Drupal.org hates me and I've tried to post this like 80 times. Anyway. Drupal is not sufficiently bootstrapped by this point in update.php for module_load_all(). I haven't yet determined how it was bootstrapped enough back in June in #28. Also, catch's patch names resonate. Also too,

registry_rebuild() should add a full bootstrap right inside, possible we should even move it to system.module or common.inc to enforce this slightly more.

Edit: And gettin' our bad selves bootstrapped might also let us move up the general cache clear action in #1049284: Running update.php to flush caches no longer works unless there are updates pending for consistency and general not-clearing-cached-stuff-piecemeal-in-5-places-in-update.php.

Anonymous’s picture

Status: Needs work » Needs review
FileSize
3.84 KB

oooook. here's a test that fails. i'm kinda not sure 100% what we want to do here.

Anonymous’s picture

FileSize
4.07 KB

oooook. here's another go, this time the test actually does something to try and pass.

xjm’s picture

FileSize
704 bytes

This is the difference between 85 and 86, for reference.

xjm’s picture

FileSize
1.27 KB

Does the registry_rebuild() need to happen before update_check_requirements() to resolve this issue? If not, we can move the registry rebuild a little later, when we're flushing a couple other caches, and avoid the need to manually bootstrap inside registry_rebuild(). Attached patch does that.

We still need a failing test for the bug that broke ctools as well as what's described in #75. Honestly I am not positive these patches even resolve it. Hopefully we can extend @beejeebus's test case for that.

xjm’s picture

FileSize
5.44 KB

Moving registry_rebuild() to system.module also seems plausible to me... here's what that would look like. No idea if this will blow stuff up, but hey, the upgrade tests pass.

xjm’s picture

+++ b/core/modules/system/system.moduleundefined
@@ -2391,6 +2416,10 @@ function _system_rebuild_module_data() {
+    // system_rebuild_module_data() is often called before a full bootstrap,
+    // such as in the installer. So to allow hook_system_info_alter() to run
+    // successfully, ensure all modules are loaded before invoking the hook.
+    module_load_all();

Okay, also. This comment doesn't even seem to be correct anymore. module_load_all() doesn't get you around needing a full bootstrap, because it itself goes boom without a full bootstrap. What has changed since June on this point?

catch’s picture

Why does module_load_all() go boom without a full bootstrap? It should work as long as module.inc is loaded no?

Anonymous’s picture

re #83 - this is some of the most awesomest non-orthogonal drupal code ever.

why does it only die if you have both hunks?

a) because the fatal is in _system_rebuild_module_data(), and we need the registry_rebuild() hunk for that
b) because the fatal needs a real, honest-to-goodness rebuild with all modules, and we need module_load_all() for that

well. actually, field_ui. coz when feild_ui is enabled, *field* module calls into path.inc code in its implementation of hook_system_info_alter(). and path.inc isn't loaded before a full bootstrap.

if you didn't have field_ui enabled, you wouldn't even see this WSOD. obviously, right?

xjm’s picture

Issue tags: +DrupalWTF

I think this is well-earned.

catch’s picture

So the code in field_system_info_alter() was added in #943772: field_delete_field() and others fail for inactive fields which I RTBC'ed, and itself fixed a critical.

We could try to do that without calling l() or t(), but this boils down to hook_system_info_alter() also needing everything available.

Discussed a bit with beejeebus in irc. If we do a full bootstrap (i.e. call hook_boot() or hook_init()) then we risk calling code that relies on the registry (which might be broken), so Drupal can fatal before we try to fix it. However a middle-ground is for probably _system_rebuild_module_data() to do a mini-full-bootstrap - i.e. include as much code as possible but don't invoke any hooks. This is going to look extremely ugly, but that's what we're dealing with.

sun’s picture

we risk calling code that relies on the registry (which might be broken), so Drupal can fatal before we try to fix it.

Latest discussion on this issue makes it appear very similar to #996236: drupal_flush_all_caches() does not clear entity info cache, in which we're trying to solve the info/cache/registry/rebuild interdependency nightmare. There's at least one working patch already, which only has one remaining issue with the installer. I'd strongly suggest to solve that challenge in aforementioned issue.

And, given that #1049284: Running update.php to flush caches no longer works unless there are updates pending already deals with the invocation from update.php, I'm actually no longer sure what exactly this issue is about. The issue summary doesn't clarify either - can we clarify and update that?

sun’s picture

Issue summary: View changes

Updated issue summary. Fixed broken link and updated API changes to none.

catch’s picture

I've updated the summary.

chx’s picture

Status: Needs review » Needs work

The last submitted patch, update_rebuild_registry.patch, failed testing.

xjm’s picture

Status: Needs work » Needs review
FileSize
2.9 KB

Looks like #98 was against D7. Here's a D8 reroll. I checked the DRUPAL_ROOT but I think they are correct as-is since it is defined in update.php by getcwd() (and update.php itself is inside core/). If I'm wrong, testbot will tell us. :)

Status: Needs review » Needs work

The last submitted patch, update-rebuild-registry-99.patch, failed testing.

xjm’s picture

Okay I was wrong. Adding core/; will post reroll shortly.

xjm’s picture

Status: Needs work » Needs review
FileSize
2.93 KB
David_Rothstein’s picture

--- a/core/update.php
+++ b/core/update.php
@@ -348,6 +348,54 @@ function update_check_requirements($skip_warnings = FALSE) {
   }
 }
 
+function update_rebuild_registry() {

Should this function be in includes/update.inc rather than update.php? That way it would be available to Drush also.

Status: Needs review » Needs work

The last submitted patch, update-rebuild-registry-fixed.patch, failed testing.

Anonymous’s picture

Status: Needs work » Needs review
FileSize
2.96 KB

mkay. so it took way too long to figure out that those notices happen because it's not safe to rebuild the registry if maintenance mode is defined.

updated patch just checks that, tests pass locally, uploading to see what the bot thinks. haven't addressed #104.

Anonymous’s picture

chx pointed out that we can ditch the reference in foreach ($modules as &$module) { in subsequent rerolls.

Anonymous’s picture

FileSize
3.27 KB

updated patch to incorporate #104, first stab at a real docblock for the function.

aspilicious’s picture

so what happens if you put your site in maintenance mode before you update?
The update destroys the registry and now registry_rebuild() won't be called because we are in maintenance mode...
And we can't disable maintenance mode because the site is broken.

xjm’s picture

Maybe we need to use drupal_maintenance_theme()?

Anonymous’s picture

everything works fine for me in manual testing of the 'turn on maintenance mode before update.php case'. the registry that is rebuilt via update.php is not so broken that its impossible to switch the site back on.

working on a test though.

Anonymous’s picture

ok, here's a first cut at a test, lets see what the bot thinks.

Anonymous’s picture

xjm pointed out we can't rely on fatal error information being output to the screen, and suggested some code post the fatal that won't run.

implemented that with the attached patch.

xjm’s picture

The test looks good to me. Attached includes a bit of minor comment cleanup from #113, and I've uploaded the tests separately to expose the fails.

David_Rothstein’s picture

Looking at update_rebuild_registry() it seems to duplicate a LOT of code from the first part of _registry_update()... I'm not sure if it's worth the effort to make them share some of the code, but at the very least I feel like we need to explain what the differences are. Otherwise it's very hard to tell what this code is doing. It seems like the main differences are that it's a "hard rebuild" (forces all database entries in the registry to be wiped and regenerated), and that it skips stuff like hook_register_files_alter(). So basically, the bare minimum rebuild to get the site up and running. And that explains why it needs to set the 'registry_rebuild' variable at the end, so you can get a "real" rebuild on the next page load.

But the code comments currently don't tell me any of that, so I was left wondering if that was actually the case and which of the differences are critical or not.

For example, there are a bunch of other smaller differences: It uses RecursiveDirectoryIterator rather than file_scan_directory(), it uses drupal_parse_info_file() rather than relying on the data in the {system} table (is that because the data in the {system} table might be out of date?), etc. I'm not sure if those are just unintentional differences or if they actually matter because we're early in the bootstrap on a potentially broken site.

Beyond the missing info, this looks really good though. It's the kind of patch where if it works we shouldn't ask too many questions - I just want to make sure we capture what we do know as code comments :)

A minor issue is that the test is missing a comma after 'group' => 'System'.

Anonymous’s picture

thanks for the review. attached patch:

- adds more inline comments to explain why we're doing things the way we are
- takes out the .info parsing
- adds the comma to the test :-)

David_Rothstein’s picture

Nice, that looks a lot better to me.

My only remaining comment is that it would be a good idea to add a @see _registry_update() to the PHPDoc at the top of the function, as well as one additional sentence there - maybe something like:

"Since this function does not result in a fully-built registry (only the minimum needed for Drupal to bootstrap), it also sets a variable which will trigger a complete rebuild during the next full bootstrap after it runs."

That way anyone reading the PHPDoc gets the essential information about this function without having to read through the more detailed comments in the code.

Anonymous’s picture

thanks again, i like that phpdoc suggestion.

attached patch incorporates #117.

David_Rothstein’s picture

I was going to RTBC this patch, but then played around with it for a while and came up with a number of questions:

  1. I noticed that even just with Drupal core, the pseudo-rebuilt registry which results from this patch has fewer files in it than a normal rebuilt registry. I tracked this down to missing files from includes/database and includes/filetransfer. It seems that the RecursiveDirectoryIterator isn't actually recursing. I'm not sure if this matters in practice (I'm somewhat surprised the missing database stuff doesn't crash the whole site but I'm sure there's a good reason). Nonetheless, it's probably worth fixing. Other places in core use entertaining code like the following in this situation:
    new RecursiveIteratorIterator(new SkipDotsRecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST)
    

    So maybe something similar is required here.

  2. I think the variable_set('registry_rebuild', TRUE) line should go inside the database transaction, rather than after it? We probably want to ensure that no one acts on the rebuild request before the transaction is committed.
  3. Once that variable is set, is there a potential for a race condition during the next bootstrap, if a bunch of different processes try to kick off a registry rebuild at once? Perhaps the bootstrap code needs to acquire a lock before proceeding with the rebuild?
  4. The pseudo-rebuild is very destructive (since it blows away the whole registry and starts over). And it happens every time an administrator visits update.php, even if they aren't actually updating their site. If visitors hit the site in the middle of this rebuild (e.g. when the registry tables are mostly empty), will it whitescreen? I'm not sure how serious of a concern this is in practice. But I'm also not sure it's actually necessary to blow away the registry tables. If instead, the same logic as in _registry_update() were used, but this part were left out:
    // Add the hash for those files we have already parsed.
    if (isset($files[$filename])) {
      $files[$filename]['hash'] = $file['hash'];
    }
    

    wouldn't that also force each file to be rescanned, without having to destroy the tables beforehand?

    Additionally, perhaps the call to cache('bootstrap')->set('lookup_cache', array()) should happen at the end of the rebuild process initiated by update_rebuild_registry(), rather than the beginning. On a healthy site, that allows other requests to keep using the cache even while the major surgery is going on. That would seem to be more in line with how a normal rebuild works also, where the cache isn't rewritten until the end of the page request.

  5. If I visit update.php after updating my filesystem, then it looks like the registry is going to be rebuilt based on outdated data from {system}, since system_rebuild_module_data() hasn't been called. I believe it's then possible for me to go through the entire update.php process with the "wrong" registry? The registry will eventually be rebuilt correctly at the end, but I wondered if there are scenarios where update functions can fail as a result of the registry being wrong. It would be great if as soon as you are redirected to "update.php?op=info" a real registry rebuild happened right then. #106 says it's not safe to rebuild the registry when MAINTENANCE_MODE is defined, but I don't think it's that simple because after actual updates are run, update.php flushes all caches which results in a registry rebuild anyway, and MAINTENANCE_MODE is defined then too. So maybe there actually is a way to run it earlier also?

FYI, @aspilicious's concern in #109 is a bit related to my last point above, and I was worried about it too. But then I realized that when your site is in maintenance mode, the MAINTENANCE_MODE variable is not actually defined. (Go figure.) So that part is actually OK; even sites in maintenance mode will still get the full registry rebuild once someone tries to hit the main site. The only concern is over update.php itself, as I described above.

Anyway, sorry for all the questions, but given this issue's history we probably need to be pretty careful with this patch.

Anonymous’s picture

Status: Needs review » Needs work

thanks for the careful review, as usual.

i think some of what you point out raises again the question of whether we should have an explicit 'rebuild' idea, rather than just 'if you hit update.php, we rebuild'.

1. yep, definitely needs fixing

2. yes.

3. yes, i think that's a good idea.

4. i think that will be alright, but we need to make sure that what is rebuilt isn't still hosed, so there's an attraction to blowing it all away. as for the WSODs, should be fine on systems that support transactions - no other mysql threads will see the truncated tables until the transaction is committed.

5. hmm, i'll dig into this idea a bit.

i agree its worth 'overdoing' this patch, because while we can possibly kill the registry in D8, we're stuck with it in D7 forever.

David_Rothstein’s picture

i think some of what you point out raises again the question of whether we should have an explicit 'rebuild' idea, rather than just 'if you hit update.php, we rebuild'.

Have to say the same thought crossed my mind also. But from a user experience standpoint, it's so much better if this just works on its own. I would say that if all the issues I raised can be fixed (including #5) we are probably OK leaving it as an automatic step in update.php.

4. i think that will be alright, but we need to make sure that what is rebuilt isn't still hosed, so there's an attraction to blowing it all away. as for the WSODs, should be fine on systems that support transactions - no other mysql threads will see the truncated tables until the transaction is committed.

Right, I forgot to mention that the concern in #4 is only for databases that don't support transactions, which does lessen it a bit.

sun’s picture

tim.plunkett’s picture

In light of #1541674: Remove the registry is this still relevant in D8?

Berdir’s picture

No, it won't be relevant anymore I think. Not sure if we want to wait with moving back to 7.x until the remove registry patch is actually commited.

tim.plunkett’s picture

Version: 8.x-dev » 7.x-dev
Issue tags: -Needs backport to D7

If anyone thinks its best to postpone it, feel free, but I think this is fine.

catch’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7

I'd be so happy to move this back to Drupal 7, but system_rebuild_module_data() is still going to suffer from the same problem even when the registry is removed. That's less critical than the registry but it could still leave sites in an inconsistent state.

catch’s picture

The registry is gone now, so we need to figure out what to do here.

system_rebuild_module_data() still needs all modules loaded because it fires hook_system_info_alter(), but I'm not aware of any fatal errors caused by this in either 7.x or 8.x so that's really more of a major bug. However the fix is going to be similar to one of the patches already posted here, so we should probably keep things together in one issue, and the 7.x patch will just need to ensure the registry is taken care of as well.

sun’s picture

system_rebuild_module_data() is called in a controlled fashion though. It is only invoked from callers that operate in a DRUPAL_BOOTSTRAP_FULL environment, AFAICS. I don't see what would need to be fixed there.

That said, that's (vastly) less of a case for system_rebuild_theme_data(), which apparently depends on loaded modules + hook_system_info_alter(), too, but I'm already trying hard to fix that nightmare over in #1067408: Themes do not have an installation status

I'd recommend to move this issue to 7.x.

Damien Tournoud’s picture

Priority: Critical » Major

Major based on #127.

I wonder if we should just make hook_system_info_alter() a bootstrap hook.

catch’s picture

Priority: Major » Critical
Status: Needs work » Needs review
FileSize
1.24 KB

This is major for 8.x now, but it's still critical for 7.x unfortunately.

Whether we can completely fix it or not for 7.x it'll need to be tracked as such (although I still think my earlier patches on this issue were fine for a 7.x fix and just need proper review).

I considered splitting this into 8.x and 7.x issues but the alter hook is still fired in the same place under the same conditions so that'd just mean less context and more issues at the moment.

With 8.x, we no longer write the info to the {system} table. So while some alters might affect the stuff that gets saved to config, we could at least just throw away the system info cache if we're not at full bootstrap.

Untested patch for that.

YesCT’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update, +DrupalWTF, +Needs backport to D7

The last submitted patch, system_info.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
star-szr’s picture

FileSize
1.24 KB

Oops, patch.

kerasai’s picture

#134: 534594-133.patch queued for re-testing.

kerasai’s picture

Issue summary: View changes

Updated issue summary.

kattekrab’s picture

Issue summary: View changes

added link to patch to the issue summary.

kattekrab’s picture

Version: 8.x-dev » 7.x-dev
Issue tags: -Needs issue summary update

As discussed above, this is no longer relevant to Drupal 8, but is still a problem for D7. Updated the issue summary, and setting back to D7.

catch’s picture

Version: 7.x-dev » 8.x-dev

No this is still an 8.x bug per #130.

kattekrab’s picture

Oops. Sorry!

kattekrab’s picture

Issue summary: View changes

added "Update 12 Aug 2013: The registry has been removed from Drupal 8 so this issue is no longer valid. Setting back to D7."

kattekrab’s picture

Issue summary: View changes

a weak tidy up

kattekrab’s picture

#134: 534594-133.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +DrupalWTF, +Needs backport to D7

The last submitted patch, 534594-133.patch, failed testing.

star-szr’s picture

Issue tags: +Needs reroll

Tagging for reroll.

star-szr’s picture

Issue tags: -Needs reroll

Oh, hang on. The patch does still apply :)

catch’s picture

This likely shouldn't do anything in resolveCacheMiss(), but instead avoid writing to cache if !$this->persistable in destruct().

catch’s picture

Hmm actually patch ought to work, sending for re-test.

catch’s picture

Status: Needs work » Needs review

#134: 534594-133.patch queued for re-testing.

catch’s picture

Status: Needs review » Reviewed & tested by the community

#134 looks good to me, previous test failure was a bot with no space. Marking RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Let's see if we can write a test for this using an event that fires pre bootstrap finishing.

catch’s picture

So the test would be have an event listener that tries to get system info

- ensure the cache entry is empty
- request a page.
- make sure it's still empty

To go further, could also check that the cache entry is valid when the event listener doesn't run.

chx’s picture

Title: registry_rebuild() and system_rebuild_module_data depend on all modules being loaded » system info cache writing is broken without a full bootstrap
Anonymous’s picture

i think we should put the check on bootstrap phase in resolveCacheMiss().

we don't care about the bootstrap phase on __construct(), we care about it on a cache miss, which may be much later.

optionally, we could keep track of whether the system info we primed is untrusted, and if we get another cache miss after a full bootstrap, clear out the static cache in system_rebuild_module_data() and get it again. not sure how important this bit is though, so i'd be ok with just fixing when we first check for full bootstrap.

Anonymous’s picture

Status: Needs work » Needs review
FileSize
1.42 KB

here's a patch for the first bit of #150.

alexpott’s picture

+++ b/core/lib/Drupal/Core/Utility/ModuleInfo.php
@@ -22,11 +22,23 @@ class ModuleInfo extends CacheArray {
+  /**
+   * Overrides CacheArray::__construct().
+   */
+  function __construct($cid, $bin) {
+    parent::__construct($cid, $bin);
+  }

No need for this now

Anonymous’s picture

ah, good point.

catch’s picture

Status: Needs review » Reviewed & tested by the community

That's nicer.

catch’s picture

Status: Reviewed & tested by the community » Needs review

Whoops, still no tests...

catch’s picture

Issue summary: View changes

-

star-szr’s picture

Issue summary: View changes
Status: Needs review » Needs work

CNW for tests.

catch’s picture

Version: 8.x-dev » 7.x-dev

All bootstrap hooks have gone. And there are either few or none pre-module events (see https://api.drupal.org/api/drupal/core!includes!bootstrap.inc/function/d...)

So... I think this is a 7.x issue only now, moving there.

catch’s picture

Title: system info cache writing is broken without a full bootstrap » system info cache writing and registry rebuilding is broken without a full bootstrap
mgifford’s picture

Status: Needs work » Needs review
FileSize
1.07 KB

This looks like it will work...

mgifford’s picture

Status: Needs review » Needs work

Nope.

The last submitted patch, 159: 534594-159-D7-system-info-cache.patch, failed testing.

neclimdul’s picture

Didn't really review logic but functinoality: There is a } out of place in your class. Also, the $data in resolveCacheMiss doesn't resolve to anything.

mgifford’s picture

I was looking for the out of place } but still haven't found it. Where is it.

Also not sure where that $data should come from. Mostly I was trying to just backport what others had done.

Fabianx’s picture

+++ b/includes/bootstrap.inc
@@ -2972,17 +2972,35 @@ class SchemaCache extends DrupalCacheArray {
     $this->storage[$offset] = $value;
-    $this->persist($offset);
+    if ($this->persistable()) {
+      $this->storage[$offset] = $data;
+      $this->persist($offset);
+    }

This should be:

+++ b/includes/bootstrap.inc
@@ -2972,17 +2972,35 @@ class SchemaCache extends DrupalCacheArray {
-    $this->storage[$offset] = $value;
-    $this->persist($offset);
+    if ($this->persistable()) {
+      $this->storage[$offset] = $value;
+      $this->persist($offset);
+    }
+++ b/includes/bootstrap.inc
@@ -2972,17 +2972,35 @@ class SchemaCache extends DrupalCacheArray {
+  protected function persistable() {
+    if (is_null($this->persistable)) {
+      $this->persistable = drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL;

While it is great to cache this, I think this function should take a parameter so that the drupal_bootstrap_full can actually set that the schema cache now can be persisted.

Also shouldn't this fully go to DrupalCacheArray directly so that all cache arrays only persist if they are used within DRUPAL_BOOTSTRAP_FULL?

mgifford’s picture

Status: Needs work » Needs review
FileSize
1.07 KB

I've re-rolled the patch based on your first comment.

The second though seems like your suggesting to go further than we did in D8, right?

In which case that should be a new D8 issue that we could bring back.

Status: Needs review » Needs work

The last submitted patch, 165: 534594-165-D7-system-info-cache.patch, failed testing.

Fabianx’s picture

+++ b/includes/bootstrap.inc
@@ -2972,17 +2972,35 @@ class SchemaCache extends DrupalCacheArray {
     $this->storage[$offset] = $value;
-    $this->persist($offset);

The first line will also need to be removed.

mgifford’s picture

What first line? protected $persistable; or $this->persist($offset);

@Fabianx more clarification please.

Fabianx’s picture

$this->persist($offset); needs to be removed else you do set it then set it again in the if, but you want to only do it in the if case not in the other case.

mgifford’s picture

Ok, thanks for the clarification.

mgifford’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 170: 534594-170-D7-system-info-cache.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
FileSize
1.03 KB

This might not fail so badly.

Status: Needs review » Needs work

The last submitted patch, 173: 534594-173-D7-system-info-cache_0.patch, failed testing.

kattekrab’s picture

@mgifford that patch didn't pass Mike - maybe needs a reroll by now too.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 173: 534594-173-D7-system-info-cache_0.patch, failed testing.

mgifford’s picture

Issue tags: +Needs reroll

The code applies too, but now getting this error:

( ! ) Fatal error: Call to undefined method SchemaCache::persistable() in /DRUPAL7/includes/bootstrap.inc on line 2993

It definitely needs to be rerolled..

Fabianx’s picture

I am splitting of the latest patch into a new sub-issue:

#2450533: SchemaCache is prone to persistent cache corruption / drupal_get_complete_schema() is not robust against recursion

Because this one is for more services in Drupal 7, than just the schema cache ...

Fabianx’s picture

Title: system info cache writing and registry rebuilding is broken without a full bootstrap » [meta] system info cache writing and registry rebuilding is broken without a full bootstrap
Status: Needs work » Active

Making this one a meta.

  • webchick committed 858ba6e on 8.3.x
    Roll-back of Issue #534594 by beejeebus, catch: This causes fatal errors...
  • Dries committed fa18bb3 on 8.3.x
    - Patch #534594 by catch, Frando: add registry_rebuild() to update.php.
    
    

  • webchick committed 858ba6e on 8.3.x
    Roll-back of Issue #534594 by beejeebus, catch: This causes fatal errors...
  • Dries committed fa18bb3 on 8.3.x
    - Patch #534594 by catch, Frando: add registry_rebuild() to update.php.
    
    

  • webchick committed 858ba6e on 8.4.x
    Roll-back of Issue #534594 by beejeebus, catch: This causes fatal errors...
  • Dries committed fa18bb3 on 8.4.x
    - Patch #534594 by catch, Frando: add registry_rebuild() to update.php.
    
    

  • webchick committed 858ba6e on 8.4.x
    Roll-back of Issue #534594 by beejeebus, catch: This causes fatal errors...
  • Dries committed fa18bb3 on 8.4.x
    - Patch #534594 by catch, Frando: add registry_rebuild() to update.php.
    
    
vijaycs85’s picture

Issue tags: -Needs reroll
grahamvalue’s picture

Got here from #3028130: Class [warning] RulesPluginFeaturesIntegrationInterface does not exist and could not be loaded faces.inc:233.

Updating to rules-7.x-2.12 just caused several sites to crash.

It's understandable that there are technical reasons why rebuilding the registry cannot be done as part of the update process.

But isn't there some way that module maintainers can warn site maintainers that updating a certain module will require a registry rebuild, failing which their sites will crash?

  • webchick committed 858ba6e on 9.1.x
    Roll-back of Issue #534594 by beejeebus, catch: This causes fatal errors...
  • Dries committed fa18bb3 on 9.1.x
    - Patch #534594 by catch, Frando: add registry_rebuild() to update.php.
    
    
stephencamilo’s picture

Status: Active » Closed (won't fix)
drumm’s picture

(disregard, bumping to fix issue indexing)