Attempting to do a fresh installation of Drupal 8.0.x (latest from git, commit 5379584a96a11a7c333fbb0b01d2f90e42059917) on PostgreSQL. The installation fails with the following error:

Additional uncaught exception thrown while handling exception.
Original

PDOException: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block: SELECT 1 FROM information_schema.tables WHERE (table_catalog = :db_condition_placeholder_0) AND (table_schema = :db_condition_placeholder_1) AND (table_name = :db_condition_placeholder_2) ; Array ( [:db_condition_placeholder_0] => drupal [:db_condition_placeholder_1] => public [:db_condition_placeholder_2] => cache_config ) in Drupal\Core\Config\CachedStorage->readMultiple() (line 111 of /var/www/html/drupal/core/lib/Drupal/Core/Config/CachedStorage.php).

Drupal\Core\Config\CachedStorage->readMultiple(Array)
Drupal\Core\Config\ConfigFactory->loadMultiple(Array)
Drupal\Core\Config\ConfigFactory->get('system.filter')
Drupal\Core\DrupalKernel->preHandle(Object)
Drupal\Core\DrupalKernel->prepareLegacyRequest(Object)
drupal_install_system(Array)
install_base_system(Array)
install_run_task(Array, Array)
install_run_tasks(Array)
install_drupal()

Additional

PDOException: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block: SELECT 1 FROM information_schema.tables WHERE (table_catalog = :db_condition_placeholder_3) AND (table_schema = :db_condition_placeholder_4) AND (table_name = :db_condition_placeholder_5) ; Array ( [:db_condition_placeholder_3] => drupal [:db_condition_placeholder_4] => public [:db_condition_placeholder_5] => cache_config ) in Drupal\Core\Config\CachedStorage->readMultiple() (line 111 of /var/www/html/drupal/core/lib/Drupal/Core/Config/CachedStorage.php).

Drupal\Core\Config\CachedStorage->readMultiple(Array)
Drupal\Core\Config\ConfigFactory->loadMultiple(Array)
Drupal\Core\Config\ConfigFactory->get('core.extension')
Drupal\Core\Extension\ThemeHandler->refreshInfo()
Drupal\Core\Extension\ThemeHandler->listInfo()
list_themes()
_drupal_maintenance_theme()
drupal_maintenance_theme()
install_display_output(Array, Array)
_drupal_log_error(Array, 1)

I've set PostgreSQL to log all of the SQL queries that are used on the system, and I see that the problem happens because the installer attempts to use the "config" and "cache_config" tables before they have been created. This causes PostgreSQL to roll back the transaction, which causes this exception.

Here are the SQL queries in question.

LOG:  statement: SELECT name, data FROM config WHERE collection = '' AND name IN ('core.extension')
ERROR:  relation "config" does not exist at character 24
STATEMENT:  SELECT name, data FROM config WHERE collection = '' AND name IN ('core.extension')
LOG:  statement: BEGIN
LOG:  statement: DELETE FROM cache_config
        WHERE  (cid IN  ('core.extension'))
ERROR:  relation "cache_config" does not exist at character 13
STATEMENT:  DELETE FROM cache_config
        WHERE  (cid IN  ('core.extension'))
LOG:  statement: SELECT 1 FROM information_schema.tables WHERE  (table_catalog = 'drupal') AND (table_schema = 'public') AND (table_name = 'cache_config')
ERROR:  current transaction is aborted, commands ignored until end of transaction block

If you'd like, I can attach all the SQL queries that are run, but I think these are the most relevant.

Comments

jaredsmith’s picture

Issue tags: -PostgreSQL +PostgreSQL Amsterdam2014
jaredsmith’s picture

Issue tags: -PostgreSQL Amsterdam2014 +PostgreSQL, +Amsterdam2014
bzrudi71’s picture

bzrudi71’s picture

Status: Active » Closed (fixed)

#2181291: Prevent a query from aborting the entire transaction in pgsql is in and install works again. So going to close this one...