Problem/Motivation

We're receiving this error during our project build :

 [info] Starting execution of ip_anon_cron(), execution of file_cron() took 0.82ms.
 [error]  Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.sessions' doesn't exist: UPDATE "sessions" SET "hostname"=:db_update_placeholder_0
WHERE "timestamp" <= :db_condition_placeholder_0; Array
(
    [:db_update_placeholder_0] => 0
    [:db_condition_placeholder_0] => 1756723959
)

Proposed resolution

I'd suggest adding a quick check to update the database table only if it exists.

Issue fork ip_anon-3545450

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

useernamee created an issue. See original summary.

useernamee’s picture

Status: Active » Needs review
mfb’s picture

It looks like the sessions table was removed from system module in Drupal 10.3.0, according to https://www.drupal.org/node/3431286 - it's now created on demand by the session handler.

So yes, we now need to check if the table exists. This also means that the code that gets a description of the sessions table from system schema (for use on the config form) only works on older versions of Drupal.

What session handler do you have in use? Ideally, we could provide ip_anon support for removing IP addresses from alternative session storage

mfb changed the visibility of the branch 8.x-1.x to hidden.

  • mfb committed 6fea8cba on 8.x-1.x
    Issue #3545450 by useernamee, mfb: Cron produces error for newly build...

mfb’s picture

Status: Needs review » Fixed

Thanks for reporting!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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