Closed (fixed)
Project:
Drupal core
Version:
6.19
Component:
node system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Mar 2010 at 07:24 UTC
Updated:
4 Jul 2011 at 21:31 UTC
I have set up drupal 6. Created few content types and nodes for the same. Strange issue happens for one of my content type. It shows below message.
Page not found
The requested page could not be found.
I checked that node exists in the database. Not getting why this happens.
Thx,
Comments
Comment #1
choster commentedIn the node table, are the uid and type associated with the "missing" node valid?
I encountered this problem recently. The users table was missing a row, and any nodes created by that uid turned up as page not found errors even though the row existed in the node table and all CCK fields were populated. Elsewhere, it has been reported that database restores sometimes cause the row for user 0 (i.e. the anonymous user) to be deleted, producing 404s and other unexpected behaviors.
Comment #2
choster commentedComment #3
suffering drupal commentedHi, I have a similar problems after moving our site to a new server.
We set up the whole site again step by step and imported all the dates from a backup. So far so good. The backup was an "old" one from before certain problems (say from june) on the old server. But there was some new stuff we had been adding in july, still at the old server.
So now we just copied those new dates manually from the database at the old server to the new database. Copying ok, structure is the same and all the needed tables have the new dates now exactly as on the old server (we can still access the web too for comparison), this includes the following tables:
- node
- node revision
- node access
- content type gallery assist
- content type location
- location
- some domain tables
- some gallery assist tables
and some more stuff
Nothing of the new stuff appears on the website. Not even going to (new)node/####, admin/content/node or going to "node locations" at map/node, as if the database forgets/isn't able to tell Drupal there are some new nodes....
I could imagine some possible problems with specific modules since we are using a lot. But I understand that at least the basic node should be detected and found (and then possibly give an error) but not the "not found" result.
Comparing "old" nodes with the new ones I don't see any difference, but the impression I get is like some trigger hasn't been pulled so Drupal "sees" those new nodes in the database.
And I did clean all caches!
Any ideas?
Comment #4
arpieb commentedI just ran into the same thing on D6.19, and when I compared data I found that the UID for all the nodes in question had been set to 0, but there was no user 0 in the D6 user table. I wound up executing a SQL update on the nodes table, setting all uid's to a current admin-level user's uid where it was currently 0, and all my pages are now accessible.
Maybe some update SQL somewhere is causing grief? I recently updated to D6.19, and was having no problems until I removed the Views 3.x module and reverted back to Views 2.11 - which is nothing like what you guys are doing, but I had the same problem after the fact... Maybe something is freaking out intermittently and resetting UIDs on node records to 0 during database updates...?
Comment #5
unclejustin commentedFYI I just had this same problem after importing records manually (via SQL inserts). My problem was that I forgot to also populate the node_revisions table. As soon as I inserted matching records into node_revisions, everything was fine. Hope that helps.
Comment #6
drooopalstars commentedI faced the same issue.
And it was wrong uid problem. The uid associated with that nodeid in node table did not exist in users table
Just updating the uid worked for me.
Thanks choster!
Comment #7
geetotes commentedI was having this same problem of page not found on nodes. And man, was it frusturating. Here's a quickie SQL query to fix it.
This query will overwrite all the uids of every entry in the nodes table, so if you care about what user posted the content, don't use it. (Luckily in my case, I do not).
Comment #8
verta commentedHad this problem, and came to find that user 0 was no longer in the users table.
Installed a module, http://drupal.org/project/anonymous_user to fix it, since I do not have access to the db to run SQL on it.
Still not sure how user 0 got deleted, though.
Comment #9
mysterlune commentedRan into this issue today, and took note of what was happening to the {users} table when migrating to the new database. The "0" user (anonymous) had been auto-incremented to the next available `uid` value -- in my case, 447.
According to the MySQL Developer site, reloading a mysqldumped table causes a row with a zero primary key value to auto increment unless the SQL mode is set beforehand to prevent this happening:
http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_no_a...
For me, just setting the 447 user's uid to 0 was sufficient to overcome the "Page not found" problem today. However, I thought this information could help for those of us migrating sites across servers.
Comment #10
verta commentedThat (#9) sounds completely logical, but not sure it's not how I got into this state. I'm pretty sure my deployed db was made by dropping a copy of the MySQL folder.
But it's really no fun for this to happen. This is at least a normal level bug, if not a critical one.
If it's unacceptable and this problematic to the Drupal application for user zero (UID 0) to not exist, it needs to detect and protect against the case.
I installed
http://drupal.org/project/anonymous_user
and thought it might be evaluated for purposes of this discussion.
Here's all it does:
.install
and the .module
I really don't know enough about this to evaluate it.
Comment #11
noomz commentedSubscribe.
Comment #12
Fr0s7 commentedYep, this was the cluprit with me as well. Almost all nodes were created by user 1, but the ones showing a 404 were created by user 0. In phpMyAdmin I simply browsed the 'node' table, sorted by 'uid', selected all of the nodes created by user 0, and edited them to uid 1. This fixed the 404 issue.
The root cause of this for me was previously editing the 'user' table in phpMyAdmin, exporting the database, and re-importing it at another location. I believe it was the incrementing problem described elsewhere in this post.
Comment #13
verta commentedUpdating the title.
Although I am now thinking of suggesting that this be moved to the database system component and retitled 'Detect missing user 0 and create if missing.' Perhaps this could be something that runs on the status page, rather than during normal site processing.
Comment #14
verta commentedtypo, I meant "if" ...
Comment #15
toby53 commentedThank you so much !
I changed my uid 0 to uid 1 (a current user) and the nodes became accessible !
Comment #16
dpearcefl commentedtoby53, please change the status to closed if your issue if resolved.
Comment #17
verta commentedJust a comment from the gallery, I don't consider it closed if this situation can exist and have Drupal not care and appear to lose content. It may be a workaround to hack your database if your site comes to this this unfortunate state, but it's not really a resolved issue.
Perhaps we could move this to the status report page (admin status) as something to validate and offer assistance with when things are not right?
Comment #18
dpearcefl commentedI'm not sure that having user 0 (anonymous) creating nodes is a realistic use case. And having a uid of '0' in the users table is certainly required in D6 or really funky things start to happen..
Comment #19
dddave commentedI just overflew the issue but it seems that the problem boils down to a missing uid 0. That happens mostly after transfering databases and is not a Drupal specific problem.
"Missing" nodes are merely a symptom in this case and the cure is clear: Recreate UID 0.
re#18 anonymous content creation is not that uncommon. The rest of your statement is true though.