Email
Share

We Rock Your Web Forum » Troubleshooting » Error Messages

Drupal - The Post Could Not Be Saved

(3 posts)
  1. DrupalJunkie

    senior member
    Joined: Oct '09
    Posts: 77

    I recently upgraded to Drupal 6, and for a couple days everything was fine. I was able to create new content types and new pages without any errors. However, as of this morning, whenever I try and create a page I get the message "this page was created" (as normal), but right below that comes the message the post could not be saved. Ultimately, the post is not saved. I've tried clearing the cache, to no avail.

    When I check the error log, I see about four error messages following each attempt at page creation. They are: Duplicate entry '0' for key 1 query: INSERT INTO followed by the name of an entry in the DB. These include node, forward_statistics, node_comment_statistics, url_alias, and xmlsitemap_node.
    Any suggestions?

    Posted 2 years ago #

  2. Posted 2 years ago
  3. cwd

    senior admin
    Joined: Jul '09
    Posts: 225

    Hi DrupalJunkie,

    Believe it or not we experienced the same problem back when we upgraded to Drupal 6. We're not certain what exactly is causing it, and there are numerous reports of this issue with various solutions. In our experience, this occurs during an upgrade from Drupal 5 to Drupal 6, when the auto_increment variable is not set on the node_revisions table.

    To resolve this, first backup your database, and then run the following SQL:

    ALTER TABLE node_revisions ADD PRIMARY KEY ( vid );
    ALTER TABLE node_revisions CHANGE vid vid INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE node AUTO_INCREMENT=NODE_NID_PLUS_ONE;
    ALTER TABLE node_revisions AUTO_INCREMENT=NODE_VID_PLUS_ONE;

    Where NOD_NID_PLUS_ONE is one greater than the highest NID value in your node table, and NODE_REVISIONS_VID_PLUS_ONE is one greater than the highest VID (revisions ID) value. You can also find both these values in your sequences table - add one to the "id" values for "node" and "node_revisions" to get your SQL statement values.

    In the future, make sure you keep track of your update errors - this will help you track this down more quickly in a search of our forums, or a Google search.

    Posted 2 years ago #
  4. Anonymous



    Minnor changes and it worked to me. Thanks.

    Posted 1 year ago #

RSS feed for this topic

Reply

(required)

Allowed markup: BBcode blockquote code em strong ul ol li font strike center u hr.
You can also put code in between backtick ( ` ) characters.