0

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?

  • 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 wiki.civicrm.org/confluence/display/CRMDOC/…. Did you run the upgrade script? If you've got the WP plugin "CiviCRM Admin Utilities" then you can run this from there. – Eric Booth Oct 26 '16 at 14:41
  • 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). – Sleewok Oct 31 '16 at 13:04
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.

| improve this answer | |
  • Hm, I think this solves the symptom of not showing the dashboard. But it does not solve the root cause, the failed upgrade. – Kainuk - CiviCooP Oct 29 '16 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.