If domino is installed via drush site:install and passing the "--existing-config" flag, there is a fatal database error:

Query condition 'users_field_data.name IN ()' cannot be empty.

  1. During site install, configuration is imported.
  2. The first step during configuration import is to install all the modules defined in core.extensions.yml.
  3. This happens before configuration (such as user roles) have been imported.
  4. When domino is installed, hook domino_install() is triggered which calls domino_cache_flush().
  5. During domino_cache_flush, TestUsers.php:ensureTestUsersPassword() is run. This method attempts to load all users belonging to any defined roles but it fails with a db error as there are no roles available (because config has not yet been imported)

Possible solutions

So there are two possible solutions as I see it:

  • Remove domino_cache_flush() from domino_install(), because it can be run before configuration import has been completed.
  • (preferred solution): Amend ensureTestUsersPassword() so that it does not fail when roles have not yet been created.

Comments

Leo Pitt created an issue. See original summary.

leo pitt’s picture

Status: Active » Needs review
StatusFileSize
new3.74 KB

Patch included.

  • Spleshka committed b3f6c1c3 on 3.x authored by Leo Pitt
    Issue #3398032 by Leo Pitt, Spleshka: Database error when domino module...
spleshka’s picture

Version: 3.4.0 » 3.x-dev
Status: Needs review » Fixed

Great stuff, thank you Leo for providing a patch! I've added small code formatting changes & added changelog record. I will also create a new release to make this fix go live.

Status: Fixed » Closed (fixed)

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