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.
Comment | File | Size | Author |
---|---|---|---|
#26 | horrible-hack-that-makes-tests-work.patch | 766 bytes | bbinkovitz |
Comments
Comment #1
fbastage CreditAttribution: fbastage commentedI 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.
Comment #2
fakingfantastic CreditAttribution: fakingfantastic commented+1 having this with a new node type i just created
Comment #3
fakingfantastic CreditAttribution: fakingfantastic commentedDon't forget to update your db after upgrading. There's a db update that depends on it:
Comment #4
webchickYeah, it sounds like that's it. Thanks, fakingfantastic! Please re-open if running update.php doesn't fix it, with instructions to reproduce.
Comment #5
svenaas CreditAttribution: svenaas commentedI 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!Comment #6
jacobroufa CreditAttribution: jacobroufa commentedThis 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.
Comment #7
grabo CreditAttribution: grabo commentedYou must apply pending updates first, I had the same headache.
Comment #8
frikino CreditAttribution: frikino commentedSolved too when i runed http://www.yourdomain.com/update.php
its say : 5 updapts is waiting
Thx you :)
Comment #9
odyseg CreditAttribution: odyseg commentedThanks 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.
Comment #10
agaaga CreditAttribution: agaaga commentedhttp://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!!!!
Comment #11
VanD CreditAttribution: VanD commentedWhen I try to run update.php I get this:
To make the site work again, I have to clear the cache through drush.
Comment #12
jhemsley30 CreditAttribution: jhemsley30 commentedHow do you update the database?
Thanks, James.
Comment #13
elitenano CreditAttribution: elitenano commentedAfter update.php I get new error:
Have any idea?
Comment #15
jmichaelv CreditAttribution: jmichaelv commentedNot 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).
Comment #16
Vc Developer CreditAttribution: Vc Developer commentedI'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).
Comment #17
vikant CreditAttribution: vikant commentedGetting this when I try to make a webform. Can somone please give me the steps to fix it
Comment #18
FR6 CreditAttribution: FR6 commentedSame 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.
Comment #19
mishradileep CreditAttribution: mishradileep commentedThanks frikino,
It works for me. You saved my efforts to waste.
Comment #20
gabocharrua CreditAttribution: gabocharrua commentedThanks FF!!! it made my day
Comment #21
tarun_nagpal CreditAttribution: tarun_nagpal commentedThanks.....update.php works for me.
Comment #22
tarun_nagpal CreditAttribution: tarun_nagpal commentedComment #23
protonyx CreditAttribution: protonyx commented@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.
Comment #24
TanvirAhmad CreditAttribution: TanvirAhmad commentedI got this when installed a new template and a new profile. But then I ran mysite.com/update.php and it was gone. :)
Comment #25
aimeeraeThis 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)
Comment #26
bbinkovitz CreditAttribution: bbinkovitz commentedI 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.
Comment #27
joni.dores CreditAttribution: joni.dores as a volunteer and commentedIf 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
Comment #28
dcam CreditAttribution: dcam commentedThis 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.