Answers.Body: <p>I had the same issue when doing an upgrade to 4.7.12. I believe The problem was with the civicrm_dashboard table. I copied the structure from a clean install of 4.7.12 and was able to get rid of the error. </p>
  
  <p><em>This is assuming you are starting from a point where you have reverted to a version of the site prior to attempting the update.</em> </p>
  
  <p><strong>CIVICRM_DASHBOARD TABLE</strong>
  Make a backup of the civicrm_dashboard table data. Then run the following on your DB to create the dashboard again. </p>
  
  <p>Here is the SQL for my civicrm_dashboard table schema: </p>
  
  <pre><code>DROP TABLE civicrm_dashboard;
  
  CREATE TABLE civicrm_dashboard (
    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    domain_id int(10) UNSIGNED NOT NULL COMMENT 'Domain for dashboard',
    name varchar(64) DEFAULT NULL COMMENT 'Internal name of dashlet.',
    label varchar(255) DEFAULT NULL COMMENT 'dashlet title',
    url varchar(255) DEFAULT NULL COMMENT 'url in case of external dashlet',
    permission varchar(255) DEFAULT NULL COMMENT 'Permission for the dashlet',
    permission_operator varchar(3) DEFAULT NULL COMMENT 'Permission Operator',
    fullscreen_url varchar(255) DEFAULT NULL COMMENT 'fullscreen url for dashlet',
    is_active tinyint(4) DEFAULT 0 COMMENT 'Is this dashlet active?',
    is_reserved tinyint(4) DEFAULT 0 COMMENT 'Is this dashlet reserved?',
    cache_minutes int(10) UNSIGNED NOT NULL DEFAULT 60,
    PRIMARY KEY (id),
    CONSTRAINT FK_civicrm_dashboard_domain_id FOREIGN KEY (domain_id)
    REFERENCES civicrm_domain (id) ON DELETE RESTRICT ON UPDATE RESTRICT
  )
  ENGINE = INNODB
  AUTO_INCREMENT = 18
  AVG_ROW_LENGTH = 1365
  CHARACTER SET utf8
  COLLATE utf8_unicode_ci
  ROW_FORMAT = DYNAMIC;
  </code></pre>
  
  <p><strong>CIVICRM_DASHBOARD_CONTACT TABLE</strong>
  Make a backup of the civicrm_dashboard_contact table data and run the following on it. You will likely need to re-import your data to the new table.</p>
  
  <p>Here is the SQL for my civicrm_dashboard_contact table schema: </p>
  
  <pre><code>DROP TABLE civicrm_dashboard_contact;
  
  CREATE TABLE civicrm_dashboard_contact (
    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    dashboard_id int(10) UNSIGNED NOT NULL COMMENT 'Dashboard ID',
    contact_id int(10) UNSIGNED NOT NULL COMMENT 'Contact ID',
    column_no tinyint(4) DEFAULT 0 COMMENT 'column no for this widget',
    is_active tinyint(4) DEFAULT 0 COMMENT 'Is this widget active?',
    weight int(11) DEFAULT 0 COMMENT 'Ordering of the widgets.',
    PRIMARY KEY (id),
    UNIQUE INDEX index_dashboard_id_contact_id (dashboard_id, contact_id),
    CONSTRAINT FK_civicrm_dashboard_contact_contact_id FOREIGN KEY (contact_id)
    REFERENCES civicrm_contact (id) ON DELETE CASCADE ON UPDATE RESTRICT,
    CONSTRAINT FK_civicrm_dashboard_contact_dashboard_id FOREIGN KEY (dashboard_id)
    REFERENCES civicrm_dashboard (id) ON DELETE CASCADE ON UPDATE RESTRICT
  )
  ENGINE = INNODB
  AUTO_INCREMENT = 413
  AVG_ROW_LENGTH = 199
  CHARACTER SET utf8
  COLLATE utf8_unicode_ci
  ROW_FORMAT = DYNAMIC;
  </code></pre>
  
  <p>At that point I would try to run the update again. Let me know if it works...</p>
  
  <p>If it fails again, check your apache logs (here for linux: /var/log/apache2/error.log) and see if it gives you any more detail on what is happening.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-29T09:36:31.503Z
Answers.Text: Hm, I think this solves the symptom of not showing the dashboard. But it does not solve the root cause, the failed upgrade.
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-28T14:16:48.987Z
Answers.LastActivityDate: 2016-10-28T14:21:50.220Z
Answers.LastEditDate: 2016-10-28T14:21:50.220Z
Answers.UserDisplayName: Sleewok
Body: <p>I updated from 4.6.10 to 4.7.12 and it failed at updating 4.7 beta 3 DB, now I cannot load the admin screen at all.  This is the wordpress version. All I get now is:  Sorry but we are not able to provide this at the moment.
  DB Constraint Violation - possibly dashboard_id should possibly be marked as mandatory for this API. If so, please raise a bug report.
  Return to home page.</p>
  
  <p>Any ideas on how to resolve this?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-26T14:41:56.607Z
Comments.Text: You may need to give a bit for info about the steps you took and what you mean by 'failed'. Can we assume you've followed https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+WordPress. Did you run the upgrade script? If you've got the WP plugin "CiviCRM Admin Utilities" then you can run this from there.
Comments.UserDisplayName: Eric Booth
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-31T13:04:37.310Z
Comments.Text: Can you enable logging? At least with drupal, I get a backtrace telling me where my upgrade fails (what part of the SQL could not be completed).
Comments.UserDisplayName: Sleewok
Tags: <upgrade>
Title: Update to 4.7.12 failed
ThreadText: # Update to 4.7.12 failed
  
  (Asked by: username_0 on 2016-10-26)
  
  I updated from 4.6.10 to 4.7.12 and it failed at updating 4.7 beta 3 DB, now I cannot load the admin screen at all. This is the wordpress version. All I get now is: Sorry but we are not able to provide this at the moment.
  DB Constraint Violation - possibly dashboard\_id should possibly be marked as mandatory for this API. If so, please raise a bug report.
  Return to home page.
  
  Any ideas on how to resolve this?
  
  **Tags:** upgrade
  
  > **Comments:**
  > **username_1**: You may need to give a bit for info about the steps you took and what you mean by 'failed'. Can we assume you've followed https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+WordPress. Did you run the upgrade script? If you've got the WP plugin "CiviCRM Admin Utilities" then you can run this from there.  
  > **username_2**: Can you enable logging? At least with drupal, I get a backtrace telling me where my upgrade fails (what part of the SQL could not be completed).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-10-28. Score: 1
  
  I had the same issue when doing an upgrade to 4.7.12. I believe The problem was with the civicrm_dashboard table. I copied the structure from a clean install of 4.7.12 and was able to get rid of the error. 
  This is assuming you are starting from a point where you have reverted to a version of the site prior to attempting the update. 
  CIVICRM_DASHBOARD TABLE
  Make a backup of the civicrm_dashboard table data. Then run the following on your DB to create the dashboard again. 
  Here is the SQL for my civicrm_dashboard table schema: 
  DROP TABLE civicrm_dashboard;
  
  CREATE TABLE civicrm_dashboard (
    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    domain_id int(10) UNSIGNED NOT NULL COMMENT 'Domain for dashboard',
    name varchar(64) DEFAULT NULL COMMENT 'Internal name of dashlet.',
    label varchar(255) DEFAULT NULL COMMENT 'dashlet title',
    url varchar(255) DEFAULT NULL COMMENT 'url in case of external dashlet',
    permission varchar(255) DEFAULT NULL COMMENT 'Permission for the dashlet',
    permission_operator varchar(3) DEFAULT NULL COMMENT 'Permission Operator',
    fullscreen_url varchar(255) DEFAULT NULL COMMENT 'fullscreen url for dashlet',
    is_active tinyint(4) DEFAULT 0 COMMENT 'Is this dashlet active?',
    is_reserved tinyint(4) DEFAULT 0 COMMENT 'Is this dashlet reserved?',
    cache_minutes int(10) UNSIGNED NOT NULL DEFAULT 60,
    PRIMARY KEY (id),
    CONSTRAINT FK_civicrm_dashboard_domain_id FOREIGN KEY (domain_id)
    REFERENCES civicrm_domain (id) ON DELETE RESTRICT ON UPDATE RESTRICT
  )
  ENGINE = INNODB
  AUTO_INCREMENT = 18
  AVG_ROW_LENGTH = 1365
  CHARACTER SET utf8
  COLLATE utf8_unicode_ci
  ROW_FORMAT = DYNAMIC;
  
  CIVICRM_DASHBOARD_CONTACT TABLE
  Make a backup of the civicrm_dashboard_contact table data and run the following on it. You will likely need to re-import your data to the new table.
  Here is the SQL for my civicrm_dashboard_contact table schema: 
  DROP TABLE civicrm_dashboard_contact;
  
  CREATE TABLE civicrm_dashboard_contact (
    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    dashboard_id int(10) UNSIGNED NOT NULL COMMENT 'Dashboard ID',
    contact_id int(10) UNSIGNED NOT NULL COMMENT 'Contact ID',
    column_no tinyint(4) DEFAULT 0 COMMENT 'column no for this widget',
    is_active tinyint(4) DEFAULT 0 COMMENT 'Is this widget active?',
    weight int(11) DEFAULT 0 COMMENT 'Ordering of the widgets.',
    PRIMARY KEY (id),
    UNIQUE INDEX index_dashboard_id_contact_id (dashboard_id, contact_id),
    CONSTRAINT FK_civicrm_dashboard_contact_contact_id FOREIGN KEY (contact_id)
    REFERENCES civicrm_contact (id) ON DELETE CASCADE ON UPDATE RESTRICT,
    CONSTRAINT FK_civicrm_dashboard_contact_dashboard_id FOREIGN KEY (dashboard_id)
    REFERENCES civicrm_dashboard (id) ON DELETE CASCADE ON UPDATE RESTRICT
  )
  ENGINE = INNODB
  AUTO_INCREMENT = 413
  AVG_ROW_LENGTH = 199
  CHARACTER SET utf8
  COLLATE utf8_unicode_ci
  ROW_FORMAT = DYNAMIC;
  
  At that point I would try to run the update again. Let me know if it works...
  If it fails again, check your apache logs (here for linux: /var/log/apache2/error.log) and see if it gives you any more detail on what is happening.
  
  > **Comments:**
  > **username_3**: Hm, I think this solves the symptom of not showing the dashboard. But it does not solve the root cause, the failed upgrade.  
  
  ---
  
  