Problem/Motivation
You get an error with Cannot redeclare 'function xyz'.
Drupal 6
Fatal error: Cannot redeclare system_main_admin_page() (previously declared in system\system.admin.inc:12) in modules\system\system.admin.inc on line 60
Drupal 7
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'system_main_admin_page' was given in menu_execute_active_handler() (line 503 of /home/iafmd/d7.iaf-methods.org/htdocs/includes/menu.inc).
Proposed resolution
Run update.php once more.
#3 blames apache based systems.
Original report by kenorb
There is very weird error:
Fatal error: Cannot redeclare system_main_admin_page() (previously declared in system\system.admin.inc:12) in modules\system\system.admin.inc on line 60
It appears when rebuilding permissions at batch?op=start&id=3
or sometimes at admin/build/modules
Basically it's because menu_execute_active_handler() is called twice.
I'm not sure how this should be fixed.
Many modules using menu_execute_active_handler() like: popups, logintoboggan, pathauto, so I think it shouldn't be problem.
Any clue?
Comments
Comment #1
charles_wisniewski commentedI am also experiencing this problem, looked at code and i'm not sure I want to be breaking other things to make this work...
Comment #2
kenorb commentedOn which pages it happen?
It happen all times or sometimes?
Have you tested with latest dev version?
Comment #3
kenorb commentedIt's probably you've many websites configured on your local environment and during shutdown, path was set to different website than it was.
It's a known Apache issue.
http://uk.php.net/manual/en/function.register-shutdown-function.php
"Note: Working directory of the script can change inside the shutdown function under some web servers, e.g. Apache. "
Fixed in latest dev.
Comment #5
kenorb commentedComment #6
aspk commentedI am also experiencing the same issue and I have the latest version. I set my site to maintenance mode (work offline), and then I get this error message. Now I can not turn it back to online mode. Please help.
thanks
Comment #7
kenorb commentedHave you downloaded 1.1?
On which URL it happen?
It's on Windows or Linux?
Have you tried to run wsod in sites/all/modules/dtools/wsod/wsod_emergency.php mode (check if your path is the same)? What's the output?
Can you paste your error?
Workaround:
Rename temporary dtools dir to dtools_, check if that will help or remove dtools from filesystem and tell me details about your problem and which custom modules do you using. Normally it should work without problems.
Comment #8
aspk commentedI was using drupal 6.12. My server is bluehost (Cpanel). I uploaded CCK to my server, then i get an alert saying there are one or 2 problems with installation and security is low and suggested me for upgrade, which takes me to upload Drupal6.13. And then I turned my site off for maintenance. I received this error message and my site simply does not show:
Fatal error: Cannot redeclare system_main_admin_page() (previously declared in /home2/aspkcomt/public_html/modules/system/system.admin.inc:12) in /home2/aspkcomt/public_html/modules/drupal-6.13/modules/system/system.admin.inc on line 60
And then I deleted Drupal 6.13 from my server. Then now I have this error message
Fatal error: Call to undefined function node_load() in /home2/aspkcomt/public_html/includes/menu.inc on line 410
My site is still not showing.
I have backed up my site before maintenance. Not sure if I captured everything though, but how do I get it work again with the files in the backup folder.
thanks for help
Comment #9
kenorb commented#8 aspk:
If your error is related to DTools module? Do you have it? Because this bug in this thread was only related to dtools.
If not, please create new support issue for Drupal, make a link and I'll try to help you.
Basically you have duplicated modules:
modules/system
modules/drupal-6.13/modules/system
You can have only one core modules at time, please remove modules/drupal-6.13 or move this directory outside your web dir.
Comment #10
fuquam commentedSame exact error but I don't have dtools module. I don't think its related to any specific module. If it is it must be the system module.
Comment #11
ChangeMachine commentedAny luck?
Comment #12
kenorb commentedcitizenvern:
On which pages you have this error?
Read #9 and check if you have duplicated modules in your Drupal root directory.
You can also install http://drupal.org/project/drupal_tweaks and check for suggestion, it will detect you duplicated modules
Comment #13
hcpc commentedI am also having the same issue. Please be kind as I am new to Drupal. I updated last night to 6.15 by uploading the the update module/folder to:
/sites/all/modules/drupal 6.15
Everything seems fine accept that I can't get into the admin page. Here are the locations that can identify where there maybe duplication
1) The above file path
2) /modules/system (no drupal folders there, just core files)
This is the exact error I am receiving when trying to access the admin page:
Fatal error: Cannot redeclare system_main_admin_page() (previously declared in /home/content/t/i/n/tintguy13/html/modules/system/system.admin.inc:12) in /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/system.admin.inc on line 60
I tried deleting the drupal 6.15 folder (as well as just the system.admin.inc file) at /sites/all/modules/drupal 6.15 but I get site offline errors if I do that. Any suggestions would be greatly appreciated!
Comment #14
hcpc commentedI am also having the same issue. Please be kind as I am new to Drupal. I updated last night to 6.15 by uploading the the update module/folder to:
/sites/all/modules/drupal 6.15
Everything seems fine accept that I can't get into the admin page. Here are the locations that can identify where there maybe duplication
1) The above file path
2) /modules/system (no drupal folders there, just core files)
This is the exact error I am receiving when trying to access the admin page:
Fatal error: Cannot redeclare system_main_admin_page() (previously declared in /home/content/t/i/n/tintguy13/html/modules/system/system.admin.inc:12) in /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/system.admin.inc on line 60
I tried deleting the drupal 6.15 folder (as well as just the system.admin.inc file) at /sites/all/modules/drupal 6.15 but I get site offline errors if I do that. Any suggestions would be greatly appreciated!
Comment #15
hcpc commented::: duplicated post :::
Comment #16
kenorb commentedhcpc: you have 2 Drupal sources inside one directory.
You need to remove this dir: /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/
And if you want to upgrade it, override Drupal sources, instead of copying to different directory
Comment #17
hcpc commentedthx for the reply kenorb-
when I delete the 'drupal 6.15' folder from that directory I get this error:
Fatal error: Call to undefined function user_access() in /home/content/t/i/n/tintguy13/html/sites/all/modules/admin menu/admin_menu.module on line 82
I get the same error no matter what page I try to reach on the site....the site is completely gone when I do that....????
Thanks again for your help!
******************************
update - I have the duplicate back in in order to have a 1/2 way working site. I just noticed that when I try to go to "My Account" that I receive this error:
Fatal error: Cannot redeclare user_autocomplete() (previously declared in /home/content/t/i/n/tintguy13/html/modules/user/user.pages.inc:12) in /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/user.pages.inc on line 22
and now when I try to go to the 'admin' page I get this error:
Fatal error: require_once() [function.require]: Failed opening required 'modules/system/system.admin.inc' (include_path='.:/usr/local/php5/lib/php') in /home/content/t/i/n/tintguy13/html/includes/menu.inc on line 346
*******************************
oh boy, I am also getting these errors when trying to test 'create content':
Fatal error: Cannot redeclare node_page_edit() (previously declared in /home/content/t/i/n/tintguy13/html/modules/node/node.pages.inc:13) in /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/node.pages.inc on line 16
and this when I goto 'user list' -> (each user)
admin:
Fatal error: Cannot redeclare user_autocomplete() (previously declared in /home/content/t/i/n/tintguy13/html/modules/user/user.pages.inc:12) in /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/user.pages.inc on line 22
testuser:
Fatal error: Cannot redeclare user_autocomplete() (previously declared in /home/content/t/i/n/tintguy13/html/modules/user/user.pages.inc:12) in /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/user.pages.inc on line 22
and this when I goto 'Feed aggregator':
Fatal error: Cannot redeclare aggregator_page_last() (previously declared in /home/content/t/i/n/tintguy13/html/modules/aggregator/aggregator.pages.inc:16) in /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/aggregator.pages.inc on line 21
are all these issues somehow related? Thanks again~
Comment #18
kenorb commentedcopy again the whole Drupal source into html/
if this not help, run wsod_emergency.php (in wsod module) from the path, to rebuild the system table for proper paths
Comment #19
hcpc commentedsorry for being such a n00b but can you please specify which files & or folders. I'm using GoDaddy for a host and the setup is automated. I didn't actually have to d/l drupal, ftp etc. I'm a bit confused b/c the files that are in the drupal 6.15 folder (downloaded update) simply have a lot of files in one folder, no sort of organization with folders. My server obviously has quite a few folders/sub-directories etc.
Can I simply d/l the latest full version of drupal and copy the source files without losing the rest of my site? Again, not really sure which ones to copy w/o messing up the current site.
When I attempted to run wsod_emergency.php I got this:
hook_exit wasn't executed properly at node, possible unexpected exit()/die()
Backtrace:
hook_exit wasn't executed properly at node, possible unexpected exit()/die()
Backtrace: wsod_sess_close(:);session_write_close(:);
thanks again~
*******************************
update - okay, I have everything running as it should be including my admin pages/access. however, now drupal is telling be that an update from 6.14 to 6.15 is available??? I just copied all the files from the 6.15 folder to the server....??? errr hmmm yeah. any thoughts?
Comment #20
kenorb commentedhcpc: Basically you need only one source of Drupal per one www directory, that's the main reason of your problem. Now you have probably broken paths in system table and that's why it doesn't work for you after deletion and it will be not easy to repair it. Try to upgrade dtools to latest dev version and re-try again. If you need any help, send me details of this site on priv, I'll try to help you.
Comment #21
mcareda commentedGood Morning Every one,
I have just face the same problem receiving this kind of message
Fatal error: Cannot redeclare system_main_admin_page() (previously declared in /home/content/t/i/n/tintguy13/html/modules/system/system.admin.inc:12) in /home/content/t/i/n/tintguy13/html/sites/all/modules/drupal 6.15/system.admin.inc on line 60
I have been unable to access all the administration section.
The solution i found is to run an update (www.aaaa.com/update.php)
After the update, my website was running normally
Hop' this will help you
Comment #22
kenorb commentedComment #23
meshwetaI also faced same problem but my issue solved by running update.php only. If you have same problem just try www.example.com/update.php
Comment #24
pendashteh commentedsame problem.
strange; but running update.php solved mu problem.
i was playing with zend configuration in php.ini when problem arose.
and i think this error has nothing to do with the poor dtools.module!
Comment #25
kenorb commentedThere is no dtools.module. It's discussion how to fix this problem by the WSOD module.
Comment #26
Sjarsena commentedI had the same problem was trying to update. Turn the site off-line then got those errors. I ran the update.php file and fixed the issue. Works fine now
Comment #27
petertoen commentedSimilar problems with my site. After updating the interface translation a fatal error occured when trying to edit content:
Fatal error: Cannot redeclare node_page_edit() (previously declared in /home/xvscfpwd/domains/sitename.com/public_html/cms/modules/drupal/modules/node/node.pages.inc:12) in /home/xvscfpwd/domains/sitename.com/public_html/drupal/modules/node/node.pages.inc on line 15
The solution was to run update.php (www.sitename.com/drupal/update.php)
Comment #28
clemens.tolboomI got this error on a D7 system upgrading from D6. Running update.php once more solved it. I updated the issue summary accordingly.
Comment #28.0
clemens.tolboomUpdated issue summary.