Hello:

I have encountered a problem with my Drupal 5.3 site [www.PortofKnoxville.com] where whenever I am logged in as the Administrator, I am unable to access the "Administer" page using the Administer link in the navigation bar. Whenever I try, I get "Page not found".

Fortunately, I discovered that if I click "Edit primary links" (which appears at the top of my site whenever I am logged in as the Administrator), I am taken to the "Menus" page. From there, using the menu options on the side, I can get to each of my administration pages. I have no idea what suddenly caused this. The only thing I can say is that it happened right after I ran a manual Cron. Can anyone tell me how to fix this?

Thanks!

Kevin

Comments

Hmm very strange. As anon user, /admin brings up page not found but /admin/build correctly brings up access denied.

This can happen if you define a URL alias "admin" that points to a non-existent system path (this would essentially override the default behaviour for the path "admin"). Have a look at admin/build/path and see if there is an alias called "admin". If so then hit "edit" - probably the alias and the system path need swapping round.

gpk
----
www.alexoria.co.uk

Following your recommendation I examined the admin/build/path to see if there is an alias called "admin". I found 4 pages of aliases. All of them start with category/, content/, or users/. Sadly, none of them start with admin/.

Please don't give up on me if you would like me to explore another theory.

Make every day a Happy VOLiday!

>All of them start with...
Is that the alias that starts with category... etc, or the system path? Those look like system paths. My thought was that there was an alias "admin" that pointed to a non-existent system path, e.g. "non-existent-path"...!

Also, when you get into an admin page, does the admin menu open up properly within the Nav links?

Finallly, might be worth forcing the menu cache to clear in case it is damaged. Easy way -> visit the modules admin page and submit it without making any changes.

[edit]
Also on the admin/build/menu page you might want to use the "reset" link for the Administer menu item, if available. Actually, is it listed? Should be immediately above "- Content management".

gpk
----
www.alexoria.co.uk

The actual aliases appear to be paths, unless I'm looking at the wrong thing. I am in Drupal 5.3, if this makes a difference. When I go to the /admin/build/path page, I see three columns of information: Alias, System & Operations. It looks like this (I added the periods to show spacing):

Alias...............System...............Operations
category/classified-ads/animals-pets...............taxonomy/term/28...............edit delete
category/classified-ads/antiques-fine-collectibles...............taxonomy/term/29...............edit delete
category/classified-ads/appliances-major...............taxonomy/term/45...............edit delete
category/classified-ads/appliances-small...............taxonomy/term/46...............edit delete

Regarding the "reset" link for the Administer menu item, I went to the admin/build/menu page and discovered I actually only have 2 choices: (1) edit or (2) disable. I don't appear to have a "reset" option. I opened the "edit" option and resaved the configuration with no changes and realized no improvement.

Make every day a Happy VOLiday!

Well, after playing around some more with the menus, settings pages (basically just saving the existing configuration) and went back to the admin/build/menu page, I DID see a "reset" link for the Administer menu item. I clicked it and performed the reset. There was no improvement. Upon returning to the admin/build/menu page, the "reset" option no longer appears and I was unable to make it reappear. :-(

Make every day a Happy VOLiday!

Upon reflecting back to when the problem began, indeed it was just after I had run a manual cron job. I think it is possible that I may also just have enabled Pathauto module. I wonder if that could have had something to do with it.

Make every day a Happy VOLiday!

Yes worth disabling that module temporarily to see if it helps...

BTW all the URL aliases look fine. And the reset link only appears for a menu item if there is something to reset ...

Finally, a correction: to get the menu cache to clear (ref. suggestion above), you actually need to make a *change* on the modules page - e.g. disable a module (then reenable it ...)

gpk
----
www.alexoria.co.uk

Well, I tried all of the recommendations and unfortunately there was no result. It sure is exciting though - giving it a try. Each time I am hopeful.

I thought of a fresh way to describe the problem. Maybe this will help. I have the following results when I try to access the following pages in using the Admin login:

http://portofknoxville.com/admin/build/menu . . . . . no problem; page displays fine
http://portofknoxville.com/admin/build . . . . . no problem; page displays fine
http://portofknoxville.com/admin . . . . . error message - "Page not found"
http://portofknoxville.com . . . . . no problem; page displays fine

So, the simplified question is "How can the the other pages exist if their path runs through a page that supposedly cannot be found?".

Make every day a Happy VOLiday!

In a PHP input format page, put the following:

<?php
$menu
=menu_get_menu();
print_r($menu['callbacks']['admin']);
?>

What is output?

gpk
----
www.alexoria.co.uk

I will certainly try this! Could you please tell me (step by step) how to do this? I'm sorry, I'm rather new at this. :-)

Kevin

Make every day a Happy VOLiday!

Create content -> page
Enter any title of your choice e.g. Testing
Copy and paste the code including the

<?php

?>

Expand "Input format" section and hit PHP code
Preview or Submit

gpk
----
www.alexoria.co.uk

Following the directions, this is what I get . . . . Array ( [callback] => system_main_admin_page ) I'm not sure what that means.

Make every day a Happy VOLiday!

Hmm that looks OK - it's the name of the function that should be called on visiting admin.

Let's clear the menu cache properly. Edit your PHP page to do this:

<?php
print db_query('TRUNCATE TABLE {cache_menu}');
?>

Should output 1. See if that helps when you visit the admin menu item.

If that doesn't help, edit your PHP page as follows:

<?php
$menu
= menu_get_menu();
print
function_exists($menu['callbacks']['admin']['callback']);
?>

Should also output 1.

And...

<?php
$menu
= menu_get_menu();
$path = 'admin';
$arguments = array();
print
call_user_func_array($menu['callbacks'][$path]['callback'], $arguments);
?>

Should output the admin page ...

gpk
----
www.alexoria.co.uk

Everything you described happened. When I modified the "Test Page" in each case, this is what the output was => "1", "1", Admin Page.

Of course, when I select "Administer" from the Navigation Bar, I still get "Page not found". Is that what you expected?

Kev

Make every day a Happy VOLiday!

OK well most of http://api.drupal.org/api/function/menu_execute_active_handler/5 seems to be behaving as we'd expect. Maybe $_GET['q'] is misbehaving... Or maybe it's something obvious that I'm overlooking ... :-P

Next test: backup your theme's page.tpl.php, then make the following change:
Just before the line <?php if ($messages != ""): ?> insert:

$messages .= "\$_GET['q'] = '{$_GET['q']}', \$_REQUEST['destination'] = '{$_REQUEST['destination']}'.";

What do you see, esp. when you visit the admin link?

BTW if you'd rather not mess with your theme then there is probably another way ...

gpk
----
www.alexoria.co.uk

As a result, I see the following on every page (near the top) including the Admin page:

$messages .= "\$_GET['q'] = '{$_GET['q']}', \$_REQUEST['destination'] = '{$_REQUEST['destination']}'.";

Hmmm . . . .

Make every day a Happy VOLiday!

Ooops put PHP tags round that, i.e.

<?php
$messages
.= "\$_GET['q'] = '{$_GET['q']}', \$_REQUEST['destination'] = '{$_REQUEST['destination']}'.";
?>

gpk
----
www.alexoria.co.uk

Now, this is what we get. $_GET['q'] = 'node', $_REQUEST['destination'] = ''. Hmmmmmm

Make every day a Happy VOLiday!

It's a little more interesting if you visit the admin page. We can see that the page request that reached Drupal was not 'admin' but '403.shtml'. I suspect that either something in your .htaccess is blocking the path 'admin', or something in the server config is doing same. You may need to talk to your webhost.

It looks like things will work if you turn off clean URLs - http://portofknoxville.com/?q=admin works fine. Also I note, strangely, that http://portofknoxville.com/admin redirects to http://portofknoxville.com/admin/ (addition of trailing /).

Ahh ... think I have sussed it ... you have created a folder in the top level Drupal directory and called it 'admin'. Apache interprets the request for 'admin' as a request for 'admin/' (i.e. the folder) but cant find index.php, index.html or index.htm in it, so it then attempts to return the contents of the directory but this is prevented by the Options -Indexes directive in .htaccess -> 403 error.

gpk
----
www.alexoria.co.uk

By Giles . . . you're right! There is a folder called "Admin" in the top level. It appears to be empty. Should I delete it and then get rid of the other code we added? I have no idea why (or how) it got there, but if it's causing confusion, I bet we should get rid of it. Right?

Make every day a Happy VOLiday!

Thank you, THANK you, THANK YOU! The crops are saved! I deleted the folder, got rid of the code we added, and everything is working correctly. Faith has been restored. LESSON LEARNED? I guess it is to be careful to add empty folders, especially folders with names that resemble "paths". I have no idea how that folder was created, but I'm glad you discovered it. I feel so much better about my site. Thanks Again. Kev

Make every day a Happy VOLiday!

Well *maybe* it was something to do with cron but I don't really see how. Glad we got to the bottom of it!

gpk
----
www.alexoria.co.uk

This morning, I very cautiously ran a manual cron just to make sure everything remained "stable". It did! Though, it will probably be a long time before I click on Administer and "assume" that it will go there. During this process, I learned a lot. Thank you.

I wouldn't blame you for taking a break from my issues, but I do have one more. I created a forum on the topic this morning. Here is a copy of the text.

==========================================================

I successfully installed the 5.x version of Slideshow Creator at my site [www.portofknoxville.com]. Everything appears to behave properly in the preview mode. And, as long as I do not have more than 8 images, it works fine on the front page. However, if I add more images it works fine in the preview mode, but the code is the only thing that is displayed on the front page.

I have examined (and re-examined) the code over and over again to see if I have done something improper, but everything looks fine. Below, is the code. Can anyone help with this?

[slideshow:2,rotate=2,blend=1,layout=bottom,
height=200,width=200,
img=|http://portofknoxville.com/files/l_080202.jpg,
img=|http://portofknoxville.com/files/p_080236.gif,
img=|http://portofknoxville.com/files/p_080212.jpg,
img=|http://portofknoxville.com/files/b_080214.gif,
img=|http://portofknoxville.com/files/l_080202.jpg,
img=|http://portofknoxville.com/files/p_080236.gif,
img=|http://portofknoxville.com/files/a_080209.jpg,
img=|http://portofknoxville.com/files/p_080212.jpg,
img=|http://portofknoxville.com/files/b_080214.gif,
img=|http://portofknoxville.com/files/p_080231.gif,
img=|http://portofknoxville.com/files/l_080205.jpg,
img=|http://portofknoxville.com/files/a_080213.jpg,
img=|http://portofknoxville.com/files/b_080218.gif,
img=|http://portofknoxville.com/files/p_080218.gif,
img=|http://portofknoxville.com/files/a_080206.gif,
img=|http://portofknoxville.com/files/p_080229.gif,
img=|http://portofknoxville.com/files/p_080215.jpg,
img=|http://portofknoxville.com/files/a_080201.jpg,
img=|http://portofknoxville.com/files/p_080204.jpg,
img=|http://portofknoxville.com/files/p_080223.gif,
img=|http://portofknoxville.com/files/a_080211.jpg,
img=|http://portofknoxville.com/files/p_080210.jpg,
img=|http://portofknoxville.com/files/b_080201.jpg]

Make every day a Happy VOLiday!

Sorry that's not something I know anything about. You could open a support request in the project's issue queue ...

gpk
----
www.alexoria.co.uk

the admin - page not load problem i faced is no more.

the debugging process adopted by you has been brilliant. i guess directed purposeful effort always pays.

Thanks Again.
sV

Hi, i'm having exactly the same problem. The problem occurs only with Drupal 6.x, Drupal 5.x always worked fine.

I'm working on a local server using Appserv, i've tried with Appserv 2.5.9 and 2.4.9, same problem on both. First I tried to update from Drupal 5.7 to 6.0, all seems ok until I try to join on Administer, "Page not found". Then tried to make a new Drupal 6.0 installation from 0, new path and new database, same problem. Solution? Back again to Drupal 5.7...

Now seeing Drupal 6.1 I had to try again, but results on same problem.

Probably can be a server related problem?

Regards.

Does ?q=admin work?

POssibly the path "admin" is reserved on your system but in that case I don't see why 5.x would work ...

gpk
----
www.alexoria.co.uk

Same problem with ?q=admin, the page takes so much to load and then gives a blank page. :-?

How about navigating directly to www.example.com/index.php?q=admin, and also to say www.example.com/admin/settings/site-information and the 2 variant forms (i.e. firstly just with ?q= and secondly with index.php?q=)?

I'm thinking this may be either insufficient memory available to PHP (in which case you should be getting an error in your logs somwhere) or else when you attempt to visit the /admin page the update status module is attempting to contact drupal.org but this is failing (in which case visiting admin/build/modules and disabling the Update status module may do the trick).

gpk
----
www.alexoria.co.uk

With this 2 variants also didn't works, but i've tried to deactivate the Update module and the issue is gone. Apart from that, installed 6.1 on a remote server and works perfectly, so is clear that is a problem with my local server.

I think i'll be working on the remote server by now, but is good to have an idea of where the error comes.

Thanks!

I encountered this problem when I decided to remove the symbolic link in my /var/www directory that pointed to drupal installed in /u01/app by copying the contents of /u01/app/drupal to /var/www/drupal

(cp -Rp /u01/app/drupal/* /var/www/drupal)

What I forgot to do was copy the .htaccess which is required for rewrite_module to work, so I was stuck with clean URL's enabled in drupal but not apache.

I copied the .htaccess from my /u01/app/drupal directory to my newly created /var/www/drupal directory and it is working fine.

The whole purpose of this was so that I can enable SELinux because I've been having a lot of (unsuccessful) hacking attempts lately.

thanks to you the forum
my problem solved when i delete the folder admin from my main directory.
apparently i have no idea how this folder created..
and its suspicius.. as i didn't touch the web page account for a week now..
it might be the cron ..
or.. who whows.. it might me someone else..
if anyone knows how this was created please post an idea..