Fatal error due to sessions table missing for first login after installing with a profile

Created on 22 July 2024, about 2 months ago
Updated 6 August 2024, about 1 month ago

Problem/Motivation

Since Drupal 10.3, the sessions table won't be created until Drupal need to write some data into that table, which is called ' lazy database creation'. More details see πŸ“Œ Implement lazy database creation for sessions Active

In some circumstance, the sessions table won't be created at all. For instance, an alternative session handler is used instead of the database storage.
More details about this change, see

Sessions table is no longer defined in system_schema() β†’

Steps to reproduce

  1. Install a profile in which the Event log track authentication module is required.
  2. After the new site is installed, login into the new site.
  3. An fatal php error occurred, which complained that 'The sessions table doesn't exist'.

Proposed resolution

Add an exception handle for _event_log_track_session_count() function to avoid the white screen of death, even if there is no sessions table created in the database yet.

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia Mingsong πŸ‡¦πŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024