- š¦šŗAustralia pameeela
Use case for read-only Drupal was never provided so I'm going to close this.
Following the instructions in
āØ
[Meta] Running Drupal with read only DB user (working title)
Closed: won't fix
, the following fatal error happens WriteSafeSessionHandler::write()
when a user was already logged in and tries to navigate somewhere after a cache clear:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1142 UPDATE command denied to user 'db'@'172.18.0.6' for table 'sessions': UPDATE "sessions" SET "uid"=:db_update_placeholder_0, "hostname"=:db_update_placeholder_1, "session"=:db_update_placeholder_2, "timestamp"=:db_update_placeholder_3 WHERE "sid" = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => 1 [:db_update_placeholder_1] => 172.18.0.7 [:db_update_placeholder_2] => _sf2_attributes|a:2:{s:3:"uid";s:1:"1";s:12:"pass_reset_1";s:74:"6KMbTSp1w3q827mp2x1buv_UIMZp88rQy1OS-WJmvz2uGhu9hxJHoMxO_-zmFkx8wvlRZYYRAA";}_sf2_meta|a:4:{s:1:"u";i:1646298302;s:1:"c";i:1646298089;s:1:"l";i:2000000;s:1:"s";s:43:"qCuBoCR_2rkJjmWo1nBdrKhsowODHEEfFvcsiUnfJeA";} [:db_update_placeholder_3] => 1646298300 [:db_condition_placeholder_0] => nrICH-feT-m01o0F824Np_giSgQANsFjD2Hk0l2eVXI ) in Drupal\Core\Session\SessionHandler->write() (line 87 of /var/www/html/core/lib/Drupal/Core/Session/SessionHandler.php).
Drupal\Core\Session\SessionHandler->write('AFGpan7VMYEeF7o5ZUM,N1cho3bZCSYfWjQhRAHSjYkC4GAq', '_sf2_attributes|a:2:{s:3:"uid";s:1:"1";s:12:"pass_reset_1";s:74:"6KMbTSp1w3q827mp2x1buv_UIMZp88rQy1OS-WJmvz2uGhu9hxJHoMxO_-zmFkx8wvlRZYYRAA";}_sf2_meta|a:4:{s:1:"u";i:1646298302;s:1:"c";i:1646298089;s:1:"l";i:2000000;s:1:"s";s:43:"qCuBoCR_2rkJjmWo1nBdrKhsowODHEEfFvcsiUnfJeA";}') (Line: 95)
Drupal\Core\Session\WriteSafeSessionHandler->write('AFGpan7VMYEeF7o5ZUM,N1cho3bZCSYfWjQhRAHSjYkC4GAq', '_sf2_attributes|a:2:{s:3:"uid";s:1:"1";s:12:"pass_reset_1";s:74:"6KMbTSp1w3q827mp2x1buv_UIMZp88rQy1OS-WJmvz2uGhu9hxJHoMxO_-zmFkx8wvlRZYYRAA";}_sf2_meta|a:4:{s:1:"u";i:1646298302;s:1:"c";i:1646298089;s:1:"l";i:2000000;s:1:"s";s:43:"qCuBoCR_2rkJjmWo1nBdrKhsowODHEEfFvcsiUnfJeA";}') (Line: 71)
Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->write('AFGpan7VMYEeF7o5ZUM,N1cho3bZCSYfWjQhRAHSjYkC4GAq', '_sf2_attributes|a:2:{s:3:"uid";s:1:"1";s:12:"pass_reset_1";s:74:"6KMbTSp1w3q827mp2x1buv_UIMZp88rQy1OS-WJmvz2uGhu9hxJHoMxO_-zmFkx8wvlRZYYRAA";}_sf2_meta|a:4:{s:1:"u";i:1646298302;s:1:"c";i:1646298089;s:1:"l";i:2000000;s:1:"s";s:43:"qCuBoCR_2rkJjmWo1nBdrKhsowODHEEfFvcsiUnfJeA";}')
session_write_close() (Line: 268)
Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->save() (Line: 196)
Drupal\Core\Session\SessionManager->save() (Line: 191)
Symfony\Component\HttpFoundation\Session\Session->save() (Line: 248)
Drupal\big_pipe\Render\BigPipe->performPostSendTasks() (Line: 308)
Drupal\big_pipe\Render\BigPipe->sendContent(Object) (Line: 112)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 381)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)
Explanation:
The problem in the session handler was as follows: The current code in WriteSafeSessionHandler::write() wants to write an update into the session table because of a changed timestamp, which Iām not sure what it is indicating. So for example before the update the session data looks like
_sf2_attributes|a:2:{s:3:"uid";s:1:"1";s:12:"pass_reset_1";s:74:"6KMbTSp1w3q827mp2x1buv_UIMZp88rQy1OS-WJmvz2uGhu9hxJHoMxO_-zmFkx8wvlRZYYRAA";}_sf2_meta|a:4:{s:1:"u";i:1646298089;s:1:"c";i:1646298089;s:1:"l";i:2000000;s:1:"s";s:43:"qCuBoCR_2rkJjmWo1nBdrKhsowODHEEfFvcsiUnfJeA";}
Then after the update it looks like
_sf2_attributes|a:2:{s:3:"uid";s:1:"1";s:12:"pass_reset_1";s:74:"6KMbTSp1w3q827mp2x1buv_UIMZp88rQy1OS-WJmvz2uGhu9hxJHoMxO_-zmFkx8wvlRZYYRAA";}_sf2_meta|a:4:{s:1:"u";i:1646299818;s:1:"c";i:1646298089;s:1:"l";i:2000000;s:1:"s";s:43:"qCuBoCR_2rkJjmWo1nBdrKhsowODHEEfFvcsiUnfJeA";}
So the difference is i:1646298089
vs. i:1646299818
.
See steps described in ⨠[Meta] Running Drupal with read only DB user (working title) Closed: won't fix
Don't update the session when a user is already logged in.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Use case for read-only Drupal was never provided so I'm going to close this.