Hello,
We upgraded to version 1.9 this morning in our Continuous Integration System at work and there is small problem when running the updb in drush.
Here is the log:
The following updates are pending:
memcache_admin module
6001 - description not available
Do you wish to run all pending updates? (y/n): y
The external command could not be executed due to an application error. [error]
Executing memcache_admin_update_6001 [success]
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined function dmemcache_object() in
/opt/drupal-ci/drupal-core-websmals/sites/integration.websmals.smals-mvm.be/modules/contrib/memcache/memcache_admin/memcache_admin.module, line 416
Output from failed command : [error]
Fatal error: Call to undefined function dmemcache_object() in
/opt/drupal-ci/drupal-core-websmals/sites/integration.websmals.smals-mvm.be/modules/contrib/memcache/memcache_admin/memcache_admin.module on line 416
Call Stack:
0.0012 184896 1. {main}() /opt/drush-4.4/drush.php:0
0.0233 2889544 2. drush_main() /opt/drush-4.4/drush.php:41
0.2062 9800240 3. drush_dispatch() /opt/drush-4.4/drush.php:101
0.2064 9801136 4. call_user_func_array() /opt/drush-4.4/includes/command.inc:204
0.2064 9801664 5. drush_command() /opt/drush-4.4/includes/command.inc:0
0.2071 9809304 6. call_user_func_array() /opt/drush-4.4/includes/command.inc:721
0.2071 9809536 7. drush_invoke() /opt/drush-4.4/includes/command.inc:0
0.2074 9810096 8. drush_invoke_args() /opt/drush-4.4/includes/command.inc:58
0.2079 9827232 9. call_user_func_array() /opt/drush-4.4/includes/command.inc:120
0.2079 9827784 10. drush_core_updatedb_batch_process() /opt/drush-4.4/includes/command.inc:0
0.2098 10031008 11. _update_batch_command() /opt/drush-4.4/commands/core/core.drush.inc:699
1.0748 48104632 12. drush_batch_command() /opt/drush-4.4/commands/core/drupal/update_6.inc:502
1.0764 48168856 13. _drush_batch_command() /opt/drush-4.4/includes/batch.inc:68
1.0767 48174616 14. _drush_batch_worker() /opt/drush-4.4/commands/core/drupal/batch_6.inc:75
1.0767 48177264 15. call_user_func_array() /opt/drush-4.4/commands/core/drupal/batch_6.inc:109
1.0767 48177512 16. _update_do_one() /opt/drush-4.4/commands/core/drupal/batch_6.inc:0
1.0768 48179272 17. memcache_admin_update_6001() /opt/drush-4.4/commands/core/drupal/update_6.inc:484
1.0768 48179272 18. drupal_flush_all_caches()
/opt/drupal-ci/drupal-core-websmals/sites/integration.websmals.smals-mvm.be/modules/contrib/memcache/memcache_admin/memcache_admin.install:33
1.0784 48179272 19. menu_rebuild() /opt/drupal-ci/drupal-core-websmals/includes/common.inc:3809
1.0787 48179856 20. menu_router_build() /opt/drupal-ci/drupal-core-websmals/includes/menu.inc:1702
1.1002 49687480 21. call_user_func() /opt/drupal-ci/drupal-core-websmals/includes/menu.inc:1729
1.1002 49687720 22. memcache_admin_menu() /opt/drupal-ci/drupal-core-websmals/includes/menu.inc:0
1.1003 49697624 23. memcache_admin_stats_types()
/opt/drupal-ci/drupal-core-websmals/sites/integration.websmals.smals-mvm.be/modules/contrib/memcache/memcache_admin/memcache_admin.module:79
A simple solution could be to include that line:
module_load_include('inc', 'memcache', 'dmemcache');
On the top the of memcache_admin.module but I don't know if it's better to put it there OR to put it in the needed function (memcache_admin_stats_type()) on line 411.
Anyway, I provide the 2 patches, can you tell me what's the best thing to do in that case ?
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | undefined_function_dmemcache_object-1156354-19.patch | 897 bytes | psynaptic |
| #2 | undefined_function_dmemcache_object-1156354-1.1.patch | 363 bytes | pol |
| #2 | undefined_function_dmemcache_object-1156354-2.1.patch | 545 bytes | pol |
| #1 | undefined_function_dmemcache_object-1156354-1.patch | 371 bytes | pol |
| #1 | undefined_function_dmemcache_object-1156354-2.patch | 553 bytes | pol |
Comments
Comment #1
polComment #2
polMy latest patches failed to apply in Jenkins, probably because of the a and b added in front of the files.
I reroll the files without those front directory (see issue http://drupal.org/node/1110430).
Comment #3
m.stentaFirst patch fixes that error when you're installing, but doesn't fix it when you go to /admin/reports/memcache
Second patch fixes both. Not sure if it needs to be loaded all the time like that, though... ? Didn't look into it too deeply... thanks for the patch though.
Comment #4
m.stentaScratch that. Second patch does not work when you're logged out. Oy...
Comment #5
m.stentaClarification: The error originally happens for me when installing memcache_admin module.
Comment #6
polHello m.stenta,
I'll work again on it on Monday, by the time, keep sending me feedback, I'll provide a new patch if needed!
I wonder if it's not a dependency problem from memcache_admin.
I'll check it out on Monday, first hours, because I don't have the time this week end to touch a computer :(
See you!
Comment #7
m.stentaOK, well I figured out what was causing the problem on my machine: http://drupal.org/node/1147672
Pol: if you have the APC PECL module installed, try uninstalling it:
(and also delete the "extension=apc.so" from php.ini (or from /etc/php5/conf.d/apc.ini if that's where it is).
That solved the problem for me. If it solves it for you too, then this issue can be closed as a duplicate of http://drupal.org/node/1147672.
Comment #8
alippai commentedI get this error without APC. So I don't think it's a duplicate.
Comment #9
polHello guys,
I made further tests and I cannot reproduce the error once the first patch in #2 is applied.
Can you provide more feedback about it ?
Thanks !
Comment #10
scroogie commentedI can confirm that the patch in #2 worked for me as well on memcache 1.9.
Comment #11
CarbonPig commentedI can also confirm that the first patch in #2 worked for me. I was getting this error when trying to run "clear all caches"
Thanks,
http://carbonpig.com
Comment #12
catchComment #13
scroogie commentedCatch, does this really need additional review? It's just a module_load_include() for using the dmemcache_object(), which is called in the update.
Comment #14
catch@scroogie I marked it as needs review because I keep forgetting there's a patch here.
Additionally you should never use module_load_include() unless you can be certain you're in full bootstrap, although the 2.1 version of the patch looks OK from that, so will probably commit that next time I'm looking at this.
Comment #15
jim kirkpatrick commentedPatch in #2 allowed me to install and use the module, marking as such.
Comment #16
polHello @Jim,
Which version of the patch ? the 2.1 or the 2.2 ?
Comment #17
jim kirkpatrick commented@Pol: erm, both... !
I figured belt and braces is best... Obviously for an actual patch one or other is better.
Comment #18
catchCommitted the 2.1 patch from #2 - http://drupalcode.org/project/memcache.git/commit/079afbd
Thanks!
Marking 'to be ported' since similar may be needed in the 7.x branch.
Comment #19
psynaptic commentedI'm getting a similar error using 6.x-1.x:
Seems like this needs another module_load_include.
Comment #20
monotaga commentedpsynaptic's patch in #19 works for me on 6.x-1.x-dev (1 July 2011). It seems like a goofy thing to have been omitted.
Comment #21
catchCommitted to 6.x-1.x branch, leaving as to be ported for 7.x.
Comment #22
danny englanderI had this same issue, the first one in #2 worked for me. (Drupal 6.22)
Comment #23
catchThe code path has changed a fair bit in D7, marking this one fixed for now.
Comment #25
Anonymous (not verified) commentedHaving this error while running update.php on 7.x-1-rc2
Comment #26
Anonymous (not verified) commentedThat function is in dmemcache.inc, including that file fixes the problem
Comment #27
tcmug commentedSee patch here: http://drupal.org/node/1364678
Comment #28
jahsh commentedWe Committed the 2.1 patch from #2 with drupal Version: 6.x-1.x-dev and it fixed our issue as well.
Comment #29
catchFixed by #1364678: Patched undefined function dmemcache_object() .
Comment #30
nicholasthompsonI found this happened if the settings.php didn't include the appropriate memcache configuration. This is just for reference for anyone else experiencing this bug.
Comment #31
zuernbernhard commentedExactly ! These lines in the config (sites/default/settings.php) made my day:
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
Thank you !
Comment #32
deanflory commentedHere's what I put into settings.php based on the latest README instructions:
Pretty clear documentation here:
https://www.drupal.org/node/1131468
I ended up getting a WSOD from that, so I removed the last two lines which brought my site back: