I made ​​the update in Drupal 8, and have noticed that a file schema.inc not found in the other version of the core, trying to add a new node, I get this error:

____________________________________________
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'vid' cannot be null: INSERT INTO {node} (nid, tnid, translate, vid, type, langcode, title, uid, status, created, changed, comment, promote, sticky) VALUES (default, default, default, :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); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => article [:db_insert_placeholder_2] => es [:db_insert_placeholder_3] => prueba [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1335279823 [:db_insert_placeholder_7] => 1335279823 [:db_insert_placeholder_8] => 2 [:db_insert_placeholder_9] => 1 [:db_insert_placeholder_10] => 0 ) en drupal_write_record() (línea 483 de /data/web8/core/includes/schema.inc).
_____________________________________________

I solved temporarily changing the DB field to Allow Null vine and it works perfectly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fbastage’s picture

Version: 8.x-dev » 7.14

I have upgraded to 7.14 (from 7.12) getting same error.

note: after disabling integrity constraint on vid, able to add content, and the vid is not set to null.

fakingfantastic’s picture

+1 having this with a new node type i just created

fakingfantastic’s picture

Don't forget to update your db after upgrading. There's a db update that depends on it:

node module : 
  7013 -   Change {node}.vid default value from 0 to NULL to avoid deadlock issues on MySQL. 
webchick’s picture

Status: Active » Fixed

Yeah, it sounds like that's it. Thanks, fakingfantastic! Please re-open if running update.php doesn't fix it, with instructions to reproduce.

svenaas’s picture

I had the same problem after updating 7.12 to 7.14 and it turned out I'd made the same mistake. Running drush updb fixed it immediately. Thanks, fakingfantastic!

jacobroufa’s picture

This is happening for me on a clean install of Drupal 7.14. There are no updates to be run. Exact error message below.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'vid' cannot be null: INSERT INTO {node} (vid, type, language, title, uid, status, created, changed, comment, promote, sticky) 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); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => page [:db_insert_placeholder_2] => und [:db_insert_placeholder_3] => TESTING [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1336090681 [:db_insert_placeholder_7] => 1336090681 [:db_insert_placeholder_8] => 1 [:db_insert_placeholder_9] => 0 [:db_insert_placeholder_10] => 0 ) in drupal_write_record() (line 7013 of includes/common.inc).

Enabled modules include admin_menu, ctools, views, mailchimp, nicemenus, pathauto, token, seo_checklist, google analytics and wysiwyg.

grabo’s picture

You must apply pending updates first, I had the same headache.

frikino’s picture

Solved too when i runed http://www.yourdomain.com/update.php
its say : 5 updapts is waiting
Thx you :)

odyseg’s picture

Thanks for the tip. I was having issues when adding contents and the error is just like this. The error appear on a multisite setup and running update fixed it.

agaaga’s picture

http://www.yourdomain.com/update.php procedure goes well. Expected no updates. But I still can not create a node and webform.

Error

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048
Column 'vid' cannot be null: INSERT INTO {node} (vid, type, language, title,
uid, status, created, changed, comment, promote, sticky) 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); Array ( [:db_insert_placeholder_0] =>
[:db_insert_placeholder_1] => page [:db_insert_placeholder_2] => ru
[:db_insert_placeholder_3] => Реставрация икон в Москве [:db_insert_placeholder_4] => 1
[:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1336676302
[:db_insert_placeholder_7] => 1336676302 [:db_insert_placeholder_8] => 1
[:db_insert_placeholder_9] => 0 [:db_insert_placeholder_10] => 0 ) в функции drupal_write_record() (строка 7013 в файле /home/n/nelikvidsr/maxcorp/public_html/includes/common.inc).

Please tell me what to do?

thanks!!!!

VanD’s picture

When I try to run update.php I get this:

No pending updates.
Error message

    Notice: Undefined index: name in block_menu() (line 146 of /var/web/modules/block/block.module).
    Notice: Undefined index: name in block_menu() (line 165 of /var/web/modules/block/block.module).
    Notice: Undefined index: name in omega_tools_menu() (line 9 of /var/web/sites/default/modules/omega_tools/omega_tools.module).
    Notice: Undefined index: name in omega_tools_menu() (line 19 of /var/web/sites/default/modules/omega_tools/omega_tools.module).
    Notice: Undefined index: name in omega_tools_menu() (line 29 of /var/web/sites/default/modules/omega_tools/omega_tools.module).
    Notice: Undefined index: name in system_menu() (line 647 of /var/web/modules/system/system.module).

To make the site work again, I have to clear the cache through drush.

jhemsley30’s picture

How do you update the database?
Thanks, James.

elitenano’s picture

After update.php I get new error:

Recoverable fatal error: Object of class stdClass could not be converted to string in function forum_node_insert() (line 395 in /modules/forum/forum.module).

Have any idea?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jmichaelv’s picture

Not sure what the final fix was/is for this - but having the same issue.
The error that pops up:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) 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); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => system [:db_insert_placeholder_2] => %module module installed. [:db_insert_placeholder_3] => a:1:{s:7:"%module";s:19:"actions_permissions";} [:db_insert_placeholder_4] => 6 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://www.kelseysrestaurant.com/admin/modules/list/confirm [:db_insert_placeholder_7] => http://www.kelseysrestaurant.com/admin/modules [:db_insert_placeholder_8] => 71.179.84.36 [:db_insert_placeholder_9] => 1339092707 ) in dblog_watchdog() (line 154 of /home2/countyc2/public_html/newinstall/modules/dblog/dblog.module).

Vc Developer’s picture

I'm getting this for the "History" table!...

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'nid' cannot be null: INSERT INTO {history} (uid, nid, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => 1339635410 ) in node_tag_new() (line 312 of ................./modules/node/node.module).

vikant’s picture

Getting this when I try to make a webform. Can somone please give me the steps to fix it

FR6’s picture

Status: Closed (fixed) » Active

Same for me, on a fresh install of Drupal 7.14, when trying to access the page "/admin/config" PHP generated the same exception as jacobroufa .

The problem seem's to be releated to my version of PHP because when I updated from PHP 5.3.3 to PHP 5.4.4 it solved the problem.

mishradileep’s picture

Thanks frikino,

It works for me. You saved my efforts to waste.

gabocharrua’s picture

Thanks FF!!! it made my day

tarun_nagpal’s picture

Thanks.....update.php works for me.

tarun_nagpal’s picture

Version: 7.14 » 7.17
protonyx’s picture

@Vc Developer:

I was also getting this same error about the history table and I tracked it down to panels. I had created a panels variant on the node add/edit page that displayed the comments for a node on the edit form. What I did not take into account, however, is that when you are creating a node, there is no "nid" attribute yet, so drupal updates the history table as a part of displaying comments and throws this error. I am not sure if this is a similar case that you experienced, but maybe this will help. Now the trick for me is to see if I can have panels only display the comments if the "node being edited" context is a valid node instead of a new node.

TanvirAhmad’s picture

I got this when installed a new template and a new profile. But then I ran mysite.com/update.php and it was gone. :)

aimeerae’s picture

This may be helpful for folks searching for this error when working with features. I got this error when enabling a feature that creates a field collection then applies permissions to the field collection. All roles previously exist as well as all modules enabled.

Drupal 7.21
Features 7.x-2.0-beta1 (fixes a bug we were running into)

1. Enable feature
2. Get big red error is on the screen
3. Return to the admin/structure/feature page
4. Revert the the feature, clear the cache
5. Feature works as intended, permissions are set, and the error does not return.

Notice: Undefined index: view my_field_collection_name in user_role_grant_permissions() (line 3056 of/sites/all/mysite.com/modules/user/user.module).

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => view my_field_collection_name [:db_insert_placeholder_2] => ) inuser_role_grant_permissions() (line 3058 of /sites/all/mysite.com/modules/user/user.module)

bbinkovitz’s picture

Version: 7.17 » 7.20
FileSize
766 bytes

I experience this with applying permissions to fields in a Feature as well. The only workaround I've found was hacking core (user.module, specifically). I've attached the patch for academic purposes only - this is an evil hack you shouldn't use. To apply, go into /modules/user before applying.

I wrote this patch for 7.20 although I'm also experiencing the problem on 7.22 now as well. Cache clearing and database updates do no good.

joni.dores’s picture

Issue summary: View changes

If the update.php doesn't recognize your module update.
Just change in sql the default value of nid to NULL.
This works to me.

Cheers

dcam’s picture

Category: Bug report » Support request
Status: Active » Closed (fixed)

This issue should have stayed closed. Additional reports have confused the problem by reporting separate issues that may seem the same only because there are similar database error messages. If you are experiencing an issue like this, do not re-open this issue. Start a new one.

If for some reason you are experiencing the issue that was originally reported here, run update.php. It sounds like the majority of people experiencing this problem fixed it by doing that. If that doesn't work, then do as suggested in #27: manually edit the database and set the default value of the column to NULL.

If none of that works, then open a new issue. You're not experiencing the same problem that was originally reported here. By re-opening this issue you just add to a lot of confusion for anyone who wants to help.