I am using drupal 6.1 on my home computer
system configuration: windows xp / php 5.2.1 / apache 2.2.6 / mysql 5.0.37
I created a skeleton for a new module (add some actions)
enabled my module in the 'admin/build/modules' pressed save and waited.
my server was busy and after some time I got empty screen and got the following error
in site error log: "[error] [client 192.168.1.1] PHP Fatal error: Maximum execution time of 30 seconds exceeded in <...>"
I got this error many times and "<...>" is different every time
when refreshed my screen by pressing F5, I got "page not found" error
and couldn't access any page on my website after a short investigation I found
out that the {menu_router} table become empty
a quick fix was to call menu_rebuild(); from a temporary index.php
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
menu_rebuild();
I tried to recreate this error with debugger and I think I know the point of failure
in the function menu_router_build in system.admin.inc
function menu_router_build($reset = FALSE) {
static $menu;
if (!isset($menu) || $reset) {
if (!$reset && ($cache = cache_get('router:', 'cache_menu')) && isset($cache->data)) {
$menu = $cache->data;
}
else {
db_query('DELETE FROM {menu_router}');
// We need to manually call each module so that we can know which module
// a given item came from.
$callbacks = array();
foreach (module_implements('menu') as $module) {
$router_items = call_user_func($module .'_menu');
if (isset($router_items) && is_array($router_items)) {
foreach (array_keys($router_items) as $path) {
$router_items[$path]['module'] = $module;
}
$callbacks = array_merge($callbacks, $router_items);
}
}
// Alter the menu as defined in modules, keys are like user/%user.
drupal_alter('menu', $callbacks);
$menu = _menu_router_build($callbacks);
cache_set('router:', $menu, 'cache_menu');
}
}
return $menu;
}
The flow is :
- truncate the table
- collect menu callbacks (hook_menu) from all modules
- do some processing on the callbacks
- alter the menu
- recreate the menu_router table
- cache
I am not an expert with drupal core but I think that the script execution terminated
somewhere between the 'DELETE' and the call to _menu_router_build
To minimize the risk I think it is best to delete the table only after callback collection, altering process
is done.
I also think that in a crucial table like {menu_router} a database transaction can help
securing the process.
Suggested flow:
- collect menu callbacks (hook_menu) from all modules
- do some processing on the callbacks
- alter the menu
- begin database transaction
- truncate the table
- recreate the menu_router table
- commit database transaction
- cache
Comment | File | Size | Author |
---|---|---|---|
#72 | protect-masks-238760-71.patch | 806 bytes | pwolanin |
#62 | dup-entry-error.txt | 344.95 KB | scottrigby |
#58 | menu routher error.txt | 275.81 KB | designerbrent |
#53 | router-delete-238760-53.patch | 1.44 KB | pwolanin |
#46 | router-delete-238760-46.patch | 1.63 KB | pwolanin |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedI had the same issue today and must strongly agree: the procedure should be improved. Especially when debugging hook_menu implementations, it is very common to break and stop the execution at this critical point.
Comment #2
Optalgin CreditAttribution: Optalgin commentedThanks, Shnapoo
I was looking for the locking functions :-)
My suggestion is to change this function as follow:
What is the procedure to suggest this change into the core?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedTwo comments...
1.) The bug still exists in 6.2
2.) menu_router_build() is located in includes/menu.inc (perhaps moved there from system.admin.inc?)
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedPatch attached. Applies to HEAD. Will need to be backported to 6.x (easy).
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #6
catchExplicit locking of tables was removed from core in D6. So if we're going to put it back, it may stop Drupal from working on some hosts. I don't have an alternative suggestion to fix this specific issue though so leaving at needs review.
Comment #7
Optalgin CreditAttribution: Optalgin commentedI am not sure about the locks, I have couple hobby sites with low traffic that are installed on my home PC.
I don't know about hosting limitations and can't test it with hight traffic..
Currently this fix works fine for me for about 3 weeks, but it must be reviewed by experienced users
Comment #8
Optalgin CreditAttribution: Optalgin commentedIs there a reason why this bug moved to D7?
I think it should be there in one of the next 6.x
Please let me know if I'm wrong
Comment #9
catchOptalgin, usually bugs are fixed in the development branch then backported to D6 (also there are currently more people looking at issues for D7 core). There are exceptions, and if this really does require db_lock_table() it might be one of them, but it's worth trying to keep both branches consistent unless there's a particular reason not to.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedwe have a similar problem with the registry patch - registry is deleted first, then rebuilt, and if the code dies half-way through the rebuild Bad Things happen. we can refactor the code to make the window of destruction smaller, but not close it - we need transactions to do it safely.
support for transaction should come as part of Database Layer: The Next Generation - feel free to head on over and review that patch ;-) .
Comment #11
pwolanin CreditAttribution: pwolanin commentedTable locks are out in D6, so I think just shortening the window is a good start.
Comment #12
Damien Tournoud CreditAttribution: Damien Tournoud commentedA discussion is going on in http://drupal.org/node/248739, which is a duplicate of that one (or the other way around).
Comment #13
Damien Tournoud CreditAttribution: Damien Tournoud commentedA better patch (that further reduce the lock window), prepared for #248739.
Comment #14
Damien Tournoud CreditAttribution: Damien Tournoud commentedBetter title.
Comment #15
catchhttp://drupal.org/node/248739 was duplicate (and has discussion for potential fixes)
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedAny module interupting execution during hook_menu() would cause the menu router table to remain empty. That actually means that a yet unknown bug in any custom module is capable of crashing the core. So just sync'ing the call (as discussed in http://drupal.org/node/248739) doesn't solve the problem.
The new title therefore is misleading.
Comment #17
chx CreditAttribution: chx commentedYes. This sucks. However, it avoids a lock.
Comment #18
Optalgin CreditAttribution: Optalgin commentedMoving the query "DELETE FROM {menu_router}" below the part when hook_menu is invoked
reduce the risk because nothing is deleted until all modules finish their tasks.
This is also important for developers when debugging the hook_menu, stopping the debug
session at this point will leave an empty table and a broken site
Damien, I think the title should emphasize the possibility of site crash, I'm changing it back..
Comment #19
pwolanin CreditAttribution: pwolanin commentedCan we get in a first patch to just move the DELETE query? This would alleviate (I think) a large fraction of the possible concerns.
I don't mind using a table lock for D6 if we did not officially remove LOCK TABLES from the requirements (and for sites where the lock fails they are not any worse off than now).
For D7, as above, let's get this as a transaction.
Comment #20
Damien Tournoud CreditAttribution: Damien Tournoud commentedI suggested a patch implementing soft locking for that type of operation in #251792.
Comment #21
pwolanin CreditAttribution: pwolanin commented@Damien Tournoud - since D7 will almost certainly support transactions, I think the issue is really how do we get a stop-gap for D6.
Comment #22
Damien Tournoud CreditAttribution: Damien Tournoud commented@pwolanin: please read my discussion in the other issue: there is two types of concurrency issues, and transactions only fix one of them. Moreover, will transaction-safe database engines (ie InnoDB on MySQL) will be a strong requirement of Drupal 7? Let me doubt it.
Comment #23
pwolanin CreditAttribution: pwolanin commented@Damien Tournoud - it sounds somewhat like you want a better implementation of the sort of semaphore that cron uses to indicate that a concurrent execution is already in progress?
Comment #24
Damien Tournoud CreditAttribution: Damien Tournoud commented@pwolanin: exactly. Cron semaphore is broken because variable are asynchronous (they are cached). See issue #249185: Concurrency problem with variable caching leading to cache inconsistency for details.
I'm trying to solve the general problem once and for all. If the implemented solution gets positive review, the cron semaphore will also be replaced by the new locking framework.
Comment #25
emjayess CreditAttribution: emjayess commentedEchoing pwolanin in #19... I've had to recover from this problem (an empty menu_router table) several times. In my experiences, the problem is wiping out the menu_router table prior to loading all the modules via module_implements to get the menu items.
This can happen while developing modules -- whenever we need to reset the menu router/cache (like via submitting /admin/build/modules or using 'reset cache' from devel.module), and it can also happen if you install a buggy, bum module with code problems. That was the case for me tonight... I wanted to test the module_builder for 6.x, so I attempted to install it and it crashed my site... after menu_router was wiped and obviously before it could be rebuilt (sure it was a -dev version and I was merely on my local test environment, but modules should fail to install more gracefully than knocking out the rest of the site, I think).
Simply moving that DELETE function /after/ all the 'module_implements' calls sounds like it would have resolved all the cases I've had to deal with -- by effectively making it an 'all-or-nothing' menu_router rebuild (if php crashes before DELETE, so be it, but at least I still have menu_router).
All that discussion re:concurrency sounds important too, but maybe this can be split up into separate issues?
Comment #26
pwolanin CreditAttribution: pwolanin commentedok, here's the trivial patch - let's at least get this into HEAD and 6.x and then think about additional fall-backs or locks for 6.x.
Comment #27
Damien Tournoud CreditAttribution: Damien Tournoud commented@pwolanin: please at least move the DELETE to
_menu_router_build
. This DELETE placed in a different function as the INSERT seems like a bug on its own anyway.Comment #28
pwolanin CreditAttribution: pwolanin commentedhow about this.
Comment #29
Damien Tournoud CreditAttribution: Damien Tournoud commented@pwolanin: there is a typo in the watchdog message, but otherwise it looks good.
Comment #30
pwolanin CreditAttribution: pwolanin commentedor this - even a little simpler.
Comment #31
Damien Tournoud CreditAttribution: Damien Tournoud commentedStill the same typo in the watchdog message.
Comment #32
pwolanin CreditAttribution: pwolanin commentedoops - we must have cross-posted. I didn't see the first message about the typo.
Perhaps this is also a place we should actually use a table lock? Apparently we can still use them in D6, even though an effort has been made to reduce them.
Comment #33
pwolanin CreditAttribution: pwolanin commentedwith typo fix
Comment #34
pwolanin CreditAttribution: pwolanin commentedand the same with a table lock. Note, it seems that there are no locks at all in core in D6 at the moment...
Comment #35
catchThere was a big effort to remove them, however this doesn't seem to have been reflected in CHANGELOG.txt or requirements - so if we needed to add one back in would probably be OK (if a bit of a shame, but so's people's sites getting hosed).
Comment #36
Damien Tournoud CreditAttribution: Damien Tournoud commented@pwolanin: so you are down to my initial proposal... putting the LOCK back in.
But... the requirement for the LOCK permission was removed [1], even if it was not reflected in the documentation.
Because we don't check this requirement anymore, the db_lock() operation will throw errors when the database user does not have the necessary permission. This is not acceptable (especially for the D6 part of this bug).
[1] http://cvs.drupal.org/viewvc.py/drupal/drupal/includes/install.mysql.inc...
Comment #37
Damien Tournoud CreditAttribution: Damien Tournoud commentedThe patch in #33 is a stop-gap fix for the issue, that is ready to go in Drupal 6 (I verified that it still applies).
For a longer-term fix, we will need both support for transactions (to prevent race conditions in DELETE-then-INSERT operations) and support for some kind of locking (to prevent several operations from running in parallel). I made a proposal for the latter in #251792.
Comment #38
catchDamien: thanks, I'd forgotten we'd taken it out of system requirements, my mistake - everyone please ignore #35.
Comment #39
pwolanin CreditAttribution: pwolanin commented@catch - obviously a number of us were confused about locks in D6...
I updated the requirements page to better reflect the current situation.
Comment #40
lilou CreditAttribution: lilou commentedThe patch is still applied to drupal 6.x , but for me with the last router patch, the number of queries generated by the menu API is always frightening (see devel log in attached file).
Executed 1524 queries in 6768.27 milliseconds. Page execution time was 7308.87 ms.
My Drupal/Server config :
Comment #41
Damien Tournoud CreditAttribution: Damien Tournoud commented@lilou: well, I guess this is a different issue, but I concur: this is really frightening.
Comment #42
lilou CreditAttribution: lilou commented@damien : you're right, it's seem to be a flexifilter issue. Sorry.
Comment #43
Optalgin CreditAttribution: Optalgin commented@pwolanin can you please, attach link to this page.
Comment #44
pwolanin CreditAttribution: pwolanin commentedrequirements: http://drupal.org/requirements
Comment #45
Gábor HojtsyCommitted #33 to Drupal 6. RTBC for Drupal 7, and then feel free to come up with something else from there in Drupal 7.
Comment #46
pwolanin CreditAttribution: pwolanin commentedbump - can we get this basic path in HEAD, while we're waiting for more substantial changes?
re-roll #33 for HEAD to remove offset.
Comment #47
PixelClever CreditAttribution: PixelClever commentedIs this patch going to be put into the next version of drupal 6? I have 6.2 and I keep getting errors about duplicate entries in the menu_router table. I had a similar memory overload crash once and I think something got screwed up in the database.
Comment #48
pwolanin CreditAttribution: pwolanin commentedYes- this will be in the Drupal 6.3 release - it was already committed to that branch.
Comment #49
pwolanin CreditAttribution: pwolanin commentedpatch still applies with minor offset.
With patch all test pass - except known failures:
Site-wide contact form: 120 passes, 4 fails, 0 exceptions
Core filters: 48 passes, 12 fails, 0 exceptions
Poll create: 27 passes, 7 fails, 0 exceptions
XML-RPC validator 0 passes, 0 fails, 3 exceptions
Comment #50
Dries CreditAttribution: Dries commentedHow do we explain the fact that we can get a serious error?
Comment #51
pwolanin CreditAttribution: pwolanin commentedI think this branch of the code sending the message is unlikely to be executed. Perhaps if there is a faulty hook_menu_alter implementation we could get and empty $menu. If the rebuild dies because (for example) a newly enabled module has a parse error, or PHP runs out of memory, we'll never send that message because the code will die before that point. The main (and important) change is that we don't delete the existing router until we have the new one in memory.
Comment #52
Dries CreditAttribution: Dries commentedSo can we remove the chunk from #50 then? If so, please re-roll and I'll commit it.
Comment #53
pwolanin CreditAttribution: pwolanin commented@Dries -having some version of that check is useful. How about this simplified code?
Comment #54
Dries CreditAttribution: Dries commentedI committed this to CVS HEAD but I believe this will need to be backported to Drupal 6.
Comment #55
pwolanin CreditAttribution: pwolanin commented@Dries - the change or the whole patch? The version with the watchdog warning is already in 6.x
Comment #56
designerbrent CreditAttribution: designerbrent commentedI installed the 6.x-dev version and confirmed that the changes in #33 are in the source but this has still not fixed the problem for me. I'm still getting lots of these errors on page loads. (not every load but it seems to happened randomly.)
Comment #57
pwolanin CreditAttribution: pwolanin commented@designerbrent - please clarify. Your comment doesn't really make sense. You are seeing watchdog errors? PHP errors? The code touched by this patch does not execute on most pages - one page that does execute it is the admin/build/modules page
Comment #58
designerbrent CreditAttribution: designerbrent commented@pwolanin - sorry. I didn't mean to be so vague.
Every few times I load my site, I get close to 301 error messages that state the following:
Now that I'm reading back through the full issue here, I'm thinking that it is not the same thing. I came to this issue from #238760: menu_router table truncated and site goes down which seemed close to the problem.
The only way I've found to fix the problem is to rebuild the menu's via the devel menu.
The menu's load every time, I just end up with these huge error messages.
I'm running Drupal 6.x-dev, but the same thing happened with Drupal 6.2. Apache 2.0.61, PHP Version 5.2.6.
If this is totally off base, please let me know and I'll be happy to move the issue elsewhere.
Thanks!
Comment #59
pwolanin CreditAttribution: pwolanin commentedWell, if the same thing happened with 6.2, it cannot be due to this patch, which was committed after 6.2. So, perhaps you should open a separate issue, or look for another open one that's more precisely about the problem you're seeing.
Comment #60
designerbrent CreditAttribution: designerbrent commented@pwolanin - Ok.. sorry to clutter things up. I obviously misread this. I found one that matches closer #246653: Duplicate entry in menu_router: Different symptoms, same issue
Comment #61
pwolanin CreditAttribution: pwolanin commentedHmm, actually I think the patch that went in wasn't ideal - the if() where I put it misses the 2nd line that will kill the menu system, which is where we set the menu masks. Something like the D6 patch might be better - we can certainly remove the watchdog call. Or, we could just not check $menu, since be moving the delete query to after all the hook_menu invocations we've eliminated pretty much all the problems that were commonly occurring.
Comment #62
scottrigbyHi,
I encountered this issue (or what seems very similar) today for the first time on D6.3 install.
My errors (a lot of them) are here in case there's anything potentially revealing about them: http://drupalbin.com/2637 (also attaching a .txt file, whichever's easier).
The errors showed up on /admin/content/types after I added a radio text widget to a new CCK content-type.
I'd like to follow this thread in case there's a patch backported to D6.3 -- or if you think it's not the same issue, I can move my issue elsewhere if this isn't the place (please let me know if you think that's the case).
All the best!
:) Scott
Comment #63
pwolanin CreditAttribution: pwolanin commented@scottrigby - this appears to be the opposite problem. The router is not cleared during the rebuild. There needs to be a separate issue for this, since I think it's a different bug you're seeing and in #58.
Comment #64
zmove CreditAttribution: zmove commentedHi,
So if I understand the status of this issue : A patch has been commited but it do not completely resolve the problem, isn't it ?
I have 6.3 version of drupal and I still have this problem of duplicate entry in menu.inc on line 2371.
Comment #65
pwolanin CreditAttribution: pwolanin commented@zmove - there is minor cleanup around the patch committed, which is why this issue is open. There seems to be a different bug, so someone should open a new issue and link to it
Comment #66
arhak CreditAttribution: arhak commentedLeaving this issue to D7, but treating it as D6 in a separately issue #289618: menu_router table truncated and site goes down: Transaction or Lock required for D6 referencing this one.
Comment #67
Damien Tournoud CreditAttribution: Damien Tournoud commented#289618: menu_router table truncated and site goes down: Transaction or Lock required for D6 was a duplicate, in which arhak believe that this was not solved for D6.
Comment #68
arhak CreditAttribution: arhak commentedSorry Damien, but I'm stating that the issue is present on 6.3 on the third sentence of the issue #289618: menu_router table truncated and site goes down: Transaction or Lock required for D6
Please read carefully the second and third sentence below
May I reopen that issue for 6.3?
(I won't if you agree it's just a duplicate or whatever else, but I won't agree)
in reply to http://drupal.org/node/289618#comment-950417
a shorter window of vulnerability is still a window and thus a vulnerability
How many administrators are allowed by Drupal?
If the answer is "only 1" then we can rely in a shortened window and a workaround documentation for exceptional cases.
But two or more administrators might be doing different stuff and thus causing a race condition.
That goes fine for the discussion about the issue as I stated on that issue of mine, but I also think that another opened ticked should exist to avoid forgetting for instance to backport it or whatever would be the final answer to the other branch.
That's why I don't agree with
but if it's that the way you go...
How do you keep track of what needs to be backported or fixed in older versions if all the issues are marked as duplicates in that branch.
OTOH, think I'm a newbie to Drupal (which is not far from the truth, think I'm another newbie) and I find such problem with Drupal, I go to the issue tracker and search the branch 6.x to see if some body saw that too.
What do I find then?
Only duplicates.
Why?
Because patches, fixes, and everything else is in D7 branch. Which I won't look for because I'm not a HEAD developer.
Two things:
- I strongly believe that being the same issue should be discussed one place, but having to possible different final solutions must be different issues. Once the fix is done for 7.x there will be a D6 issue pending for backporting or whatever it's own final solution would be (even a "don't fix")
- The issue wasn't solved with neither of those patches. I've being working with Drupal 6.3
Do you work with two browser. I guess you do, so do I. Now you know how I run into this race condition from time to time. Also, when working on any system that uses database one test realized before starting working is support for suddenly database server shutdown. Drupal 6.3 doesn't pass this test because the lack of transaction and locking.
I'm really sorry. I wasn't aware who had the truth. I just said what I thought was common sense. Look above this thread and tell me if this tracking system tells you for sure whether this is an issue present in 7.x, 6.x or both.
I always saw the issue tracking system as a tool which has that brief view on top letting me know quick and without reading the whole discussion the status of the branches. Allowing me also to query the health of a particular branch. If I find a cleared branch there is nothing more to talk about it: it's bug free! tested and approved by the community. Is that right?
My issue starts stating that is the same issue for a different branch, I also explain how D6 has patches improving it but not solving it. I also state that the discussion should be followed here. I made every issue/forum I found with the same or similar issue be aware of this discussion.
But I tell you again there is an issue in D6 which doesn't appear opened (for 6.3 I'm talking)
How ever searches the tracking system will find duplicated and the "original" ones are for D7. Thus, the issue will be opened over and over for D6, and other people will redirect them here and explain them why it's targeting D7.
Ok, this issue might be. But is a wrong policy for treating an issue queue. Same issues will keep showing up until people can search and found it reported, in the correct branch and with it's correct status, nobody will be hurt if the issues are different for live cycle and all of them point where the discussion must be.
Comment #69
mariagwyn CreditAttribution: mariagwyn commentedI have no idea which issue to post this on, but I have suddenly developed this issue. I have been on 6.3 for over a week (new site), using the site frequently. No errors. Today, I upgraded to the most recent beta4 of BOTH Date and Calendar modules. And now, getting LOTS of this error. Not sure if it is related.... Also commenting on the other thread....
Maria
Comment #70
mikkelwf CreditAttribution: mikkelwf commentedsubscribing..
Comment #72
pwolanin CreditAttribution: pwolanin commentedThe D7 patch is wrong (sorry) it means we may leave the masks empty which will kill a site just as effectively.
Here's a D7 patch to bring it in line with the more correct logic of the D6 patch, but leaving out the watchdog call.
Comment #73
webchickCommitted #72 to HEAD, so at least 6.x and 7.x are on equal footing. I diffed the two functions and the only other changes are all related to file and file path being removed.
I've no idea what status to set this issue now. Active? Sounds like people are still having issues.
Comment #74
arhak CreditAttribution: arhak commentedindeed
Comment #75
designerbrent CreditAttribution: designerbrent commentedI'm still seeing this in D 6.4 quite a bit.
Comment #76
zmove CreditAttribution: zmove commented@webchick :
Yes, still have the issue and desesperately wait for a 6.5 version that correct it to put the website in production.
Comment #77
pwolanin CreditAttribution: pwolanin commented@zmove, designerbrent - this should not happen on 6.4 unless there is some additional error. Can you please check your logs for MySQL errors or anything else of note? Are you sure you are running a clean 6.4 core?
Comment #78
zmove CreditAttribution: zmove commentedYes, I'm sure to have a clean 6.4 (if clean mean that I didn't modify core file).
However, I installed several modules, and I get this error on all 6.4 websites I run. But there are some common modules to all these install, but these modules are not unknown (CCK, views, pathauto, admin menu...). Maybe this is related to my webserver config, I have a lot of performance issues with WAMP and Drupal 6, maybe this is the problem. But all my 3 6.4 website have these error (and it's not the same drupal root...
Comment #79
designerbrent CreditAttribution: designerbrent commentedSorry.. I got to following the wrong issue. The one that is really effecting me is #246653: Duplicate entry in menu_router: Different symptoms, same issue, not this one.
Comment #80
attiks CreditAttribution: attiks commented#78, I'm facing the same problems, the only errors I get are all for duplicate entry .... but I never got the error on a live site (lucky me :p), so I guess it's a race condition. I'm using 2-3 browser each with several tabs open while building a site, so there's a lot going on at the same time.
Comment #81
g76 CreditAttribution: g76 commentedRunning fresh d6.6 with views, og, fckeditor, imce, and a few others.
Same issue as #246653: Duplicate entry in menu_router: Different symptoms , not sure which issue to follow for D6 or if any fixes exist.
>Duplicate entry.........key 1 query: INSERT INTO menu_router ....../includes/menu.inc on line 2385.
I get a whole page of these errors all over the place. could anyone tell me if there is an issue for D6.6 that I should be following?
thanks,
Jen
Comment #82
g76 CreditAttribution: g76 commentedJust another question, until this is resolved. Is this error a critical one? How does it effect things?Can I still run a live site and just turn off reporting errors to page?
Comment #83
attiks CreditAttribution: attiks commentedit isn't a problem if you turn off error reporting, there's no problem for regular visitors
Comment #84
arhak CreditAttribution: arhak commented@g76 don't worry, there won't be data lost and everything is recoverable if the site crashes:
most of the time nothing happens more than lots of duplicated entries,
some times the menu router table might get truncated and the navigation of the site gets broken, at least until D6.4, but I think there were some patches applied which makes more difficult to let this happen, anyway, if it does there are several ways to get the site back an running quickly:
1- having a special page at hand which reconstruct the menu router table
2- manually changing a variable in DB stating menu should be rebuilt
3- having a query at hand which restores the menu entry for admin/settings/performance and then manually demand rebuild menu or cache clearance
The fastest might be having a php code in a separate page which demand menu rebuild, but that's only needed if site goes down, which seems not to be your case until now
Search the issue queues and you will find several maintainers screaming for sites broken (don't know if still happens for D6.6) and their respectively solutions
Comment #85
chx CreditAttribution: chx commentedthis one is done.
Comment #87
liquidcms CreditAttribution: liquidcms commentedhate to re-open.. but is this fixed?? i have a Dr6.10 install and my client just reported site whitescreened when trying to submit a node
looking at logs i see 100's of errors (created on submit) similar to:
looks remarkably like this issue - i.e. menu_router handling doesn't appear to work
i realize quite a few posts about this (most seem to be marked as duplicates of this one), can someone point me to the more generic one that says there is still issues with menu_router when submitting content (which, unless this is caused by some poorly coded module???, would seem to imply Dr6 is unusable??).
Comment #88
liquidcms CreditAttribution: liquidcms commentedComment #89
SMonsen CreditAttribution: SMonsen commentedI'm a newbie (been building drupal for a year). I'm getting these errors and it doesn't matter what module is installed. here is the gist:
user warning: Duplicate entry '_' for key 1 query: INSERT INTO menu_router VALUES in /menu.inc on line 2385.
I'm not sure how to use a patch, etc. but willing to try anything if someone can give me a breakdown as to exactly what to do.
Running Drupal 6.10 on Apache on Unix, MySQL 5.0.67, PHP 5.2.8.
Comment #90
catchThat's not the same issue - it's caused by attempting to insert duplicate entries into your menu_router table, not an empty menu_router table. Please open a new issue for the error.
Comment #91
kenorb CreditAttribution: kenorb commentedMarked #333428: Duplicate entries in menu_router table (6.x branch) as duplicate.
Comment #92
kenorb CreditAttribution: kenorb commentedRelated issue:
http://drupal.org/node/264545#comment-863438
Comment #93
kenorb CreditAttribution: kenorb commentedIn my opinion problem of truncated menu_router is not caused because of db transaction and locking the table doesn't solve that problem completely.
Here is a case when module_list() returns list of modules, which are loaded in "bootstrap mode".
http://drupal.org/node/496198#comment-1721218
In case when you have module which call module_list(TRUE) it will truncate your theme hooks, menu_router and cause very weird behaviour even with WSODs.
See: #496198: module_list() called with wrong arguments causing WSOD and breaking theme_registry
And this: #496170: module_implements() cache can be polluted by module_invoke_all() being called (in)directly prior to full bootstrap completion
(menu_router_build calling module_implements)
Comment #94
hackwater CreditAttribution: hackwater commentedSubscribe
Comment #95
bwoods CreditAttribution: bwoods commentedWe had a similar issue occur today. The site did not go down, but we were unable to access a number of links. Fortunately, I had a fairly recent backup and was able to move over menu_router. In comparing the two tables, I noticed that every path with more than two "directories" (i.e. admin/build/block) was deleted. The only rows remaining contained either a direct path (admin) or path and one "directory" (admin/build). It is not clear how this problem even occurred.
Comment #96
kenorb CreditAttribution: kenorb commentedI've added in dtools function: wsod_rebuild_menu_router_table() (dev version).
It will rebuild the whole menu_router table in case when it's broken (node item is missing).
You can use this code to rebuild that table or download dtools module and run it in emergency mode.
Comment #97
mark_r CreditAttribution: mark_r commentedsubscribe, massive php errors,
Duplicate entry 'admin/build/views/%/preview/%' for key 1 query: INSERT INTO menu_router (path, load_functions, to_arg_functions,
Comment #98
kenorb CreditAttribution: kenorb commented#97:
#333428: Duplicate entries in menu_router table (6.x branch)
Comment #99
kenorb CreditAttribution: kenorb commented#333428: Duplicate entries in menu_router table (6.x branch)
Comment #100
bytehead CreditAttribution: bytehead commentedWow. I was having this issue. For some reason, it was zeroed out (although the host has been having issues settling down from an upgrade). I just threw the above into a temporary file, uploaded it, ran it. Fixed the whole thing.
Thank you, thank you, thank you.
And yes, I need to upgrade. After a previous admin changed the sites administration password (on the host!) and didn't tell anybody... Grrrrr. It doesn't help that the person who has the email account gets scared when he sees a password reset come his way, even when he knows my email is just sitting above it...