Hope I can describe the symptom. When I post a new entry, a different entry (an older one) pops up at the point where you should be seeing your new posting. The new entry is in the log as if it actually posted, and has the title of the new post, but it points to the old entry.

It appears that old node numbers are being used instead of adding to the end of the sequence of node numbers, and that these are existing nodes for which the new post uses the number. Appears that something is terribly screwed up in the database and I'm clueless as to where to go with this from here.

This is Drupal 4.6.2, mysql database, on a linux hosted server.

gil

Comments

Capnj’s picture

A little more info. Discovered the Sequence table. I'll use real numbers to describe what is happening.

Node_nid in the Sequence table is 481. I post a blog entry, the message 'Your personal blog entry was created' comes up, but I'm seeing node 27. In the Node table, nid 27 is described as the one I'm seeing now. The last nid is still 481, 'recent posts' reveals that the blog was indeed NOT posted (it was marked to publish), and Node_nid in Sequences still is 481.

A second test tries to post as nid 28 with same results.

I know it's not code because this is a multi-site installation and i can post a blog to two other sites just fine. They share code and are in a common mysql database with prefixes.

Tried another type of content (book) and got the identical result.

I'm also getting the following watchdog errors at the same time. The following is re: the '27' attempt (note: 'main' is the table prefix):
Duplicate entry '27' for key 1 query: INSERT INTO main_node (status, moderate, promote, sticky, comment, title, body, format, uid, created, type, teaser, changed, nid) VALUES('1', '0', '0', '0', '2', 'Test - ignore', 'This is a test. Ignore. Checking the database sequencing.
', '1', '1', '1125356149', 'blog', 'This is a test. Ignore. Checking the database sequencing.
', '1125356209', '27') in {my site}/public_html/drupal/includes/database.mysql.inc on line 66.

and also:
Duplicate entry '27' for key 1 query: INSERT INTO main_node_comment_statistics (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (27, 1125356149, NULL, 1, 0) in {mysite}/public_html/drupal/includes/database.mysql.inc on line 66.

What could be making just one site out of three, running on common code, fail to make proper reference to sequences.node_nid for the next node ID number?

- gil -

Capnj’s picture

More info and a cure to the symptom, but why did it happen.
Discovered the Sequences table also had a PREFIXED row which was 'main_node_nid' and THAT was set to the lower value (29). The node_nid row was at 481.

I manually edited main_node_nid to 481 and the next posting was fine. main_node_nid incremented but node_nid did NOT increment.

So, it seems to me that some version of the code used the NON-prefixed row and another used the PREfixed row. I'm very confused but have fixed the current issue.

- gil -

Christoph C. Cemper’s picture

oh my god!

the reason I am shared the sequences table between multiple sites is that I want ONE sequence for the nodes
running over ALL the sites, hence making sharing of content or votes or whatever possible in the future

that means

sequences, users, roles in COMMON_

node, node_revision in PROJECT1_

what sense does it make to have , apart from the original COMMON_NODE_ID entries in sequences now
also these "PROJECT_ID_NODE_IN" entries, that start counting from zero agai and cause Duplicate values???

I doubt that ANY ONE really used Drupal for a working multi-installation that shared sequences...

christoph

--- http://www.cemper.com
--- http://weblog.cemper.com
--- http://www.marketingfan.com

vinayras’s picture

Did you get any solution to this problem?

I am struct in a similar situation, Can anyone help me?

Vinay Yadav
PHP / Drupal Developer
http://www.vinayras.com

www.eDrupal.com - Indian Drupal Community

vinayras’s picture

hi,

In the db_prefix, you can specify the variables which you want to share.

Though drupal uses single shared table for "sequences", it uses "prefix" for variables too.

For example, i have 2 websites that share user details among them. Other details are not shared. I checked "sequences" tables, i found that i had 2 entries for "users_uid".

-> users_uid
-> prefix_users_uid

Since i am going to use same set of users, uid increment should be same for both. - in short there is no use of second entry "prefix_users_uid"

After looking for solutions, i found this way,

$db_prefix = array(
'default' => 'main_',
'users' => '',
'sessions' => '',
'users_uid'=>'', // specify variable in table list
'role' => '',
'sequences' => '',
);

This makes sure that only one entry is used in sequences table.

This solved my problem.

Vinay Yadav
PHP / Drupal Developer
http://www.vinayras.com

www.eDrupal.com - Indian Drupal Community