When creating content, an unspecified error is given to the user. The content can _not_ be saved.
Drupal's logfile reports:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4' for key 'PRIMARY': INSERT INTO {node_comment_statistics} (nid, cid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 4 [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => 1392046828 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 0 ) in comment_node_insert() (Zeile 1314 von /var/www/d7/modules/comment/comment.module).
The content type has comments enabled (can it even be desabled per content type?), but no comment is being added. This happens just when creating a node.
This issue is critical as no content of this content type can be created.
Comments
Comment #1
Jooblay.net commentedYes this is a corrupted database on your comment node id, order id you will have to roll back the database and or mod the mysql tables. I am not sure how to do this on comments but order numbers can be set with somthing like:
USE `database_name_here`;
ALTER TABLE `commerce_order` AUTO_INCREMENT = 1000;
Actually you maybe able to swap out commerce_order for nid like node_comment_statistics... this is a deeper database management issue for sure.
If you do not feel mysql mods are a good idea try disabling comments and or other and rebuilding. As far as we can tell drupal has strokes sometimes and the key and id get set off.
Hope that helps a little...
Comment #2
Jooblay.net commentedOh also this is a config issue which are almost always not critical.
Comment #3
asb commentedIt's a fresh setup and there are no comments at all on the site. I do not quite understand how Drupal would manage to create a "corrupted database on your comment node id" during setup. Is D7 still still not stable enough for production work? (this is my first attempt to actually use D7).
Comment #4
Jooblay.net commentedUsually you can receive a feel for a critical issue if it is reported by many admins and users of drupal.
Further, I can asure you that drupal-7.26 is extremely stable. Without seeing your environment + how you are installing drupal I would have to say to check how your database is being loaded and or corrupted.
Based off /var/www/d7/modules/comment/comment.module your file path here. Are you running LAMP?
Have you tried disabling comments module then uninstalling comments module tables from the database?
Click modules, then disable comments.
Click modules then uninstall modules and wipe comments from the database. Then re-enable it.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry Seems to indicate drupal thinks the comment already exists and or I guess did exist.
If this is a fresh install as you have stated, I use wget or aria2
wget http://ftp.drupal.org/files/projects/drupal-7.26.tar.gz
-or-
drush dl drupal
Once you have a fresh version of drupal take just a moment to go through drupal-7.26 and view permission, files.
When you install drupal take a moment and look at your apache2 logs as well.
Hope this helps a little... drupal is only as good as we make it:)
Comment #5
asb commentedThanks for your advice; however, I'm not a total novice to Drupal, I'm using it for almost a decade, just tried to avoid D7 as far as possible (older sites can not be upgraded anyway; also it's slow and - imho - still too buggy).
And yes, this is a LAMP system, and no, the database is not corrupted (according to MySQL).
Diasabling Comments is a funny thing in D7; Tracker still depends on it; both disabled and uninstalled. Now I'm getting a PDOException: SQLSTATE[42S02]. Google points me to https://drupal.org/node/1308308. Solution: "Restore the database from backup." WTF?
That's not what I'd consider stable. This is a waste of time, closing.
Comment #6
asb commented