why drupal webform form setting shows mysql errors in dblog? I have created one webform in Drupal 7 in which some form components are present. But when I'm going to view that webform the components(fields) are not displayed. Then I checked in form setting that form was closed but when I'm going to change the form setting to open and saving that form I'm getting error "The website encountered an unexpected error. Please try again later". Then in dblog there was the following mysql error.


  PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062
  Duplicate entry '39055' for key 1: INSERT INTO {webform} (nid,
  confirmation, confirmation_format, redirect_url, status, block,
  teaser, allow_draft, auto_save, submit_notice, submit_text,
  submit_limit, submit_interval, total_submit_limit,
  total_submit_interval) 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,
  :db_insert_placeholder_13, :db_insert_placeholder_14); Array (
  [:db_insert_placeholder_0] => 39055 [:db_insert_placeholder_1] =>
  [:db_insert_placeholder_2] => full_html [:db_insert_placeholder_3] =>
  [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0
  [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0
  [:db_insert_placeholder_8] => 0 [:db_insert_placeholder_9] => 0
  [:db_insert_placeholder_10] => [:db_insert_placeholder_11] => -1
  [:db_insert_placeholder_12] => -1 [:db_insert_placeholder_13] => -1
  [:db_insert_placeholder_14] => -1 ) in drupal_write_record() (line
  7194 of /home/indiawaterportal/public_html/includes/common.inc).


Please help me to solve this issue.
INSERT INTO {webform} (nid...


tries to insert the nid of the webform (got from auto-increment in the node table) in the {webform} table. So, every nid inserted in nid column of webform table should be unique. But it seems that the newly-created webform node got a nid that already exists in webform's nid column. 

So I guess there's something wrong. Find that nid in webform table, see if it exists in node table, that must be the trick.