After the Drupal 8 installation the flood table isn't being created, so when I try to log in with incorrect credentials, I'm getting a mysql error because the table doesn't exists.

SELECT 1 FROM @flood LIMIT 0, 1

Table 'drupal8.flood' doesn't exist

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dogamboar created an issue. See original summary.

cilefen’s picture

It should be created as soon as it is needed, such as when there is a failed login.

cilefen’s picture

Title: "Flood" table isn't being created automatically in the Drupal Installer » "Flood" table isn't being created automatically
Component: other » user system
Status: Active » Postponed (maintainer needs more info)

Just to be clear: the installer does not create this table. It is created on demand. What is the error you see when logins fail?

dmouse’s picture

How to reproduce:

When We have activated `xdebug.show_exception_trace=true` and We do our first login with a wrong user and password, Drupal launch an exception because the flood table doest not exist.

Flood table does not exist

Solution:
File: core/lib/Drupal/Core/Flood/DatabaseBackend.php:128
Needs an extra catch

catch (DatabaseExceptionWrapper $e_database_wrapper){
  $this->ensureTableExists();
  $this->catchException($e);
}
dmouse’s picture

Version: 8.1.8 » 8.3.x-dev
Status: Postponed (maintainer needs more info) » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: flood_table_database_exception-2781599-4.patch, failed testing.

gnuget’s picture

Status: Needs work » Needs review

It seems a problem with the bot,

Let's try again.

Status: Needs review » Needs work

The last submitted patch, 4: flood_table_database_exception-2781599-4.patch, failed testing.

dpi’s picture

Component: user system » base system
Status: Needs work » Postponed (maintainer needs more info)

Perhaps there is a problem with database account permissions?

Flood is a part of core. See also \Drupal\Core\Flood\DatabaseBackend::ensureTableExists for how table is auto created.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

cilefen’s picture

As with #9, I also can't reproduce this issue on 8.3.x. An automated test would be great. If you can get that test to fail on your platform but it passes on drupal.org's testbots, we'll need platform details so we can understand the conditions that lead to this. Thanks!

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative

Thanks for reporting this issue and especially thanks dmouse for providing a patch. We rely on issue reports like this one to resolve bugs and improve Drupal core.

As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)".

Since there were no specific steps to reproduce the issue provided since the issue was postponed, I'm marking the issue "Closed (cannot reproduce)". If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".

Thanks!