When

  1. replacing a core module (say translation) in sites/all/modules/translation
  2. running a test that uses the testing profile (i.e., not standard profile)

then the initial setup of the testing environment fails with the following error(s):

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=96&op=do
StatusText: Service unavailable (with message)
ResponseText:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'modules/translation/translation.module' for key 1: UPDATE {system} SET info=:db_update_placeholder_0, filename=:db_update_placeholder_1
WHERE  (filename = :db_condition_placeholder_0) ; Array
(
[:db_update_placeholder_0] => a:9:{s:4:"name";s:19:"Content translation";s:11:"description";s:57:"Allows content to be translated into different languages.";s:12:"dependencies";a:1:{i:0;s:6:"locale";}s:7:"package";s:4:"Core";s:7:"version";s:7:"7.0-dev";s:4:"core";s:3:"7.x";s:5:"files";a:3:{i:0;s:18:"translation.module";i:1;s:21:"translation.pages.inc";i:2;s:16:"translation.test";}s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;}
[:db_update_placeholder_1] => modules/translation/translation.module
[:db_condition_placeholder_0] => sites/all/modules/translation-HEAD/translation.module
)
in system_update_files_database() (line 2300 of modules\system\system.module).

Uncaught exception thrown in session handler.PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: INSERT INTO {sessions} (sid, ssid, uid, cache, hostname, session, 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); Array
(
[:db_insert_placeholder_0] => rnJS2LjZUwBf07hNTAI7I-xjTvQmdlfUVJSmUfxdOJY
[:db_insert_placeholder_1] => 
[:db_insert_placeholder_2] => 
[:db_insert_placeholder_3] => 0
[:db_insert_placeholder_4] => 192.168.0.2
[:db_insert_placeholder_5] => batches|a:95:{i:1;b:1;...}}
[:db_insert_placeholder_6] => 1291149784
)
in _drupal_session_write() (line 204 of includes\session.inc).

Attached patch should hopefully prove that -- it merely copies the entire translation module into sites/all/modules.

Comments

sun’s picture

Actual Translation module files are irrelevant; removed them.

Added potential fix + @todo to system_update_files_database(). I've the impression that we need to fix the @todo instead.

sun’s picture

StatusFileSize
new2.22 KB
sun’s picture

StatusFileSize
new2.13 KB

Attached patch makes it work again, but is a regression to #938560: {system} records of installed modules are removed

sun’s picture

That said, I have no idea why this only happens when running tests using the testing profile...?

Status: Needs review » Needs work

The last submitted patch, drupal.registry.3.patch, failed testing.

David_Rothstein’s picture

Subscribing.

sun’s picture

Priority: Major » Normal
sun’s picture

Title: Duplicate key error in file registry if a core module is overridden in sites + testing profile is used » Duplicate key error in file registry when running tests using testing profile

This is unrelated to overriding core modules. Testing profile also fails without that.

sun’s picture

sun’s picture

Status: Needs work » Fixed

Aforementioned issue fixed this bug.

Status: Fixed » Closed (fixed)

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