"Page not found" errors on all pages except Admin pages

Blueeeeie - June 3, 2009 - 15:22

Hi,

When I accessed my site today, I had encountered some weird errors with blocks of information missing on many of the pages. I check my logs file and found that my site was having some problems writing to the tmp/sql folder.

After some research, it was mentioned that for sites running on shared hosts, when the tmp folder is full, these errors would occur. And to contact the hoster to empty the tmp folder.

After I told my hoster, they emptied the folder and reset some permissions on it as well. The next thing I know.. all my pages on my site were suddenly not accessible and the "Page not found" error came up on every page except my admin pages.

A number of posts said it had something to do with the menu_router table being empty.. but when I checked my DB, it was still the same and wasn't empty. I tried everything.. even running the update.php and the force calling of menu_rebuild function.. but my pages are still not appearing..

Does anyone else have any idea wat could have happened?

I didn't install any new modules nor did I make any code changes to the site..

bump please help.. super

Blueeeeie - June 3, 2009 - 16:54

bump

please help.. super desperate here..

---
www.drupaldiy.com - Showcase your Drupal site

Ok.. did some further

Blueeeeie - June 5, 2009 - 17:52

Ok.. did some further digging...

I installed a brand new D6 site on a sub domain on my server.
Copied the contents of my sites folder into the new install.

I tried creating new content (eg. post/hello) on the new install.. and it works fine.. all the pages on my new install were ok and visible.

Then I imported the nodes and their cck tables, taxonomies, users into the new database from my old site.

But when I tried to view the imported content (eg. post/entry-details).. the "Page not found" error was appearing again!! However, I was still able to view the new content that I had created on my new install.

I installed the module Trace to see what were the database queries running. And I noticed something weird..

When I loaded the new content (post/hello), the trace log showed that the Get request was issued once and the queries was running correctly.

#771c94ce T=0.000000 [REQUEST] 2009-06-05 17:37:53.825517 GET /post/hello HTTP/1.1
#771c94ce T+0.419274 [QUERY  ] d=0.000478s module_list: SELECT name, filename, throttle FROM system WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC
#771c94ce T+0.419752 [QUERY  ] d=0.000156s drupal_lookup_path: SELECT COUNT(pid) FROM url_alias
#771c94ce T+0.419908 [QUERY  ] d=0.000143s drupal_lookup_path: SELECT src FROM url_alias WHERE dst = 'post/hello' AND language IN('en', '') ORDER BY language DESC

However, when I loaded my imported content (post/entry-details), the trace log showed that the Get request was issued twice.. and drupal_lookup_path started to look for 500.shtml instead of post/entry-details.

#71a986c7 T=0.000000 [REQUEST] 2009-06-05 17:36:26.645836 GET /post/entry-details HTTP/1.1
#71ba7841 T=0.000000 [REQUEST] 2009-06-05 17:36:27.687132 GET /post/entry-details HTTP/1.1
#71ba7841 T+0.335295 [QUERY  ] d=0.000358s module_list: SELECT name, filename, throttle FROM system WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC
#71ba7841 T+0.335654 [QUERY  ] d=0.000088s drupal_lookup_path: SELECT COUNT(pid) FROM url_alias
#71ba7841 T+0.335742 [QUERY  ] d=0.000119s drupal_lookup_path: SELECT src FROM url_alias WHERE dst = '500.shtml' AND language IN('en', '') ORDER BY language DESC

Anyone knows why this is happening?

---
www.drupaldiy.com - Showcase your Drupal site

Someone please help us! (mysterious 'page not found' error)

greta_drupal - September 2, 2009 - 16:04

Drupal 6.13 (from clean install - core and contributed modules)

I have the exact same frustrating scenario as original poster. Edited content fine the other day. Then, imported the Nodes and URL-Alias tables (nothing is using CCK or Views), from live site sql dump, and now pages giving me the finger...a/k/a "Page not found". No new modules installed or uninstalled.

HOW ISSUE PRESENTS:
At first, I could load/edit the nodes linked as Primary Links, Level 1, but was unable to load _most_ (but some would load) subpage nodes accessed by Primary Links, Level 2 (and appearing via Local Menu). Cannot browse to direct URL, either. The issue has worsened -- getting "page not found" for all public pages now. (Admin pages still okay.)

DB CHECK:
All content pages show in Nodes table, all links in Menu Links, URL Alias correct. Menu Router table not empty, but user-added content nodes not showing. Also, many content pages/nodes not showing in Content List.

WHAT ELSE I'VE TRIED:
1. Check and rebuild permissions
2. Simply loading the admin/modules page; also navigating thusly: ?q=admin/build/modules [instructions for rebuilding menus; any other way?]
3. menu_rebuild()
4. Checked memory limits settings (settings.php, .htaccess, php.ini). Set at 64mb.
a. Uninstall any unused modules [a later troubleshoot measure]
5. Restoring the subject tables, and even entire db, with working live site sql dump.

This issue occurred on a cloned 'sister' (live) site, different server; but, in that case, only the homepage (a separate content node) loads and none of the admin pages are available. Cannot even log in. When I restored this site on a different server, with 2-week-old backup, it all works fine so far. [I wasn't managing this site then, so don't know the history leading up to issue.]

Check .htaccess file | symlinks instructions

greta_drupal - November 27, 2009 - 14:53

I have had this happen a few times now when doing an db import (such as from live site to testing or vis-versa). Most recently, it was problem with the .htaccess file. It was blank; no instructions -- such as symlinks info.

I had performed a clean Drupal install and imported a full database (that did have cache directories empty). Only the frontpage would display. Normally, when I create a new account on this server and do the Drupal install, a "standard" .htaccess file is created. Not this time, for some reason. (Probably because I forgot to run the Drupal install before importing the full database with all those contrib mod tables. Although, I did run update.php.)

Here is the "standard" .htaccess file that I grabbed from another install that got me going again.

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  # There is no end quote below, for compatibility with Apache 1.3.
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  # Do not cache dynamically generated pages.
  ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id: .htaccess,v 1.90.2.3 2008/12/10 20:04:08 goba Exp $

This worked for me

mompadaddy - November 28, 2009 - 18:35

I had a similar problem, and when I put in this .htaccess code above everything worked fine.

Weird, because in my original site the .htaccess is different in this way near the end of the file:

# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

THEN, there is a line where you put in your site's address:
# http://www.mysite.com/

After that is this, which also shows you how to uncomment and rewrite a line.

# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

# $Id: .htaccess,v 1.90.2.3 2008/12/10 20:04:08 goba Exp $

Hope this is helpful for anyone else.

I guess on some systems you need to uncomment the lines and in others they're not even in the file (or commented out)

 
 

Drupal is a registered trademark of Dries Buytaert.