I have a development server and a test server, both of which came from an original snapshot of the production server. On the dev server, I have made many changes to schemas, menus, and such. I have set them as tracked, and confirmed that the configurations were written to disk. Then I checked the configurations into git.

On the test server, I pull the latest from git, and run "drush config-sync" in order to load the dev server changes into the test server. This causes the SQLSTATE: Integrity constraint violation included below:

wilton@dev:~/test-drupal$ drush config-sync
WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'PRIMARY': INSERT INTO {node_type} (type, name,     [error]
base, has_title, title_label, description, help, custom, modified, locked, disabled, module, orig_type) 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, :db_insert_placeholder_6,
:db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11,
:db_insert_placeholder_12); Array
(
    [:db_insert_placeholder_0] => 
    [:db_insert_placeholder_1] => 
    [:db_insert_placeholder_2] => node_content
    [:db_insert_placeholder_3] => 0
    [:db_insert_placeholder_4] => 
    [:db_insert_placeholder_5] => 
    [:db_insert_placeholder_6] => 
    [:db_insert_placeholder_7] => 1
    [:db_insert_placeholder_8] => 1
    [:db_insert_placeholder_9] => 0
    [:db_insert_placeholder_10] => 0
    [:db_insert_placeholder_11] => node
    [:db_insert_placeholder_12] => 
)
 in node_type_save() (line 528 of /var/www/vhosts/xxxx/drupal-git/modules/node/node.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'PRIMARY': INSERT INTO {node_type} (type, name, base, has_title, title_label, description, help, custom, modified, locked, disabled, module, orig_type) 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, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12); Array
(
    [:db_insert_placeholder_0] => 
    [:db_insert_placeholder_1] => 
    [:db_insert_placeholder_2] => node_content
    [:db_insert_placeholder_3] => 0
    [:db_insert_placeholder_4] => 
    [:db_insert_placeholder_5] => 
    [:db_insert_placeholder_6] => 
    [:db_insert_placeholder_7] => 1
    [:db_insert_placeholder_8] => 1
    [:db_insert_placeholder_9] => 0
    [:db_insert_placeholder_10] => 0
    [:db_insert_placeholder_11] => node
    [:db_insert_placeholder_12] => 
)
 in node_type_save() (line 528 of /var/www/vhosts/xxxx/drupal-git/modules/node/node.module).
Drush command terminated abnormally due to an unrecoverable error.       
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

risenhoover’s picture

Note that this shows up in the configuration on the source computer - it's a blank content-type that might be causing the error. Not sure where it came from.

aytee’s picture

I had the same problem occur. When using drush config-sync I got the same PDOexception errors and had the empty content type appear.

bradallenfisher’s picture

I also am gettting this error and the blank content type.
I cloned from 7.x-2.x and am having the same issues.

To replicate what happened to me would be hard since my site isn't a fresh install. However, here are the steps I took to get this issue:
on Site A:
drush csta --all
drush cexp --all

on Site B:
drush csyn

I also would occasionally receive a ton of unlink and rmdir warnings/errors for my image styles directories, which would eventually exhaust memory (php mem set to 256M)

Please let me know if I can help testing in any way. Thanks.