dcycle / docker-drupal

Drupal + Drush in an up-to-date Docker image
2 stars 2 forks source link

PDO exceptions encountered following recent container update #19

Open mirabuck opened 2 years ago

mirabuck commented 2 years ago

Hello @alberto56,

@yi-yang-github can likely add additional detail but we've been running into a few issues since the latest container image update on docker hub and we're wondering if you might have any insight. By the looks of things your most recent and problematic tag is 7.2021-12-01-21-08-49-UTC

Tags previous to that were working for us. I'm not certian but beleive that your last preceeding tag may have been 7.2021-11-24-21-08-44-UTC. I'm using this log to make that determination: https://hub.docker.com/r/dcycle/drupal/tags?page=1&name=7

The issue on our side presents with the following exception:

WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown[error] column 'base.changed' in 'field list': SELECT base.uid AS uid, base.name AS name, base.pass AS pass, base.mail AS mail, base.theme AS theme, base.signature AS signature, base.signature_format AS signature_format, base.created AS created, base.changed AS changed, base.access AS access, base.login AS login, base.status AS status, base.timezone AS timezone, base.language AS language, base.picture AS picture, base.init AS init, base.data AS data, base.uuid AS uuid FROM {users} base WHERE (base.uid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 0 ) in EntityCacheControllerHelper::entityCacheLoad() (line 142 of /var/www/html/XXXXXXXXXX/modules/contrib/entitycache/includes/entitycache.entitycachecontrollerhelper.inc). Drush command terminated abnormally due to an unrecoverable error. [error] PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.changed' in 'field list': SELECT base.uid AS uid, base.name AS name, base.pass AS pass, base.mail AS mail, base.theme AS theme, base.signature AS signature, base.signature_format AS signature_format, base.created AS created, base.changed AS changed, base.access AS access, base.login AS login, base.status AS status, base.timezone AS timezone, base.language AS language, base.picture AS picture, base.init AS init, base.data AS data, base.uuid AS uuid FROM {users} base WHERE (base.uid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 0 ) in EntityCacheControllerHelper::entityCacheLoad() (line 142 of /var/www/html/XXXXXXXXXXX/modules/contrib/entitycache/includes/entitycache.entitycachecontrollerhelper.inc)

Any insight that you can provide would be much appreciated.

We are using ubuntu servers and nothing funky like ARM.

alberto56 commented 2 years ago

Hi @mirabuck can you please confirm that by using the tag 7.2021-11-24-21-08-44-UTC, you do not get this error?

You can achieve this by performing a full-word search and replace in your entire project, changing:

dcycle/drupal:7

to

dcycle/drupal:7.2021-11-24-21-08-44-UTC

I checked what the difference is between those two tags, and it seems that the PHP and Drush versions are identical, but the Drupal version is different:

docker $ docker run --rm dcycle/drupal:7 /bin/bash -c 'drush status|grep version; php -v'                        
 Drupal version         :  7.83                                         
 Drush version          :  8.4.8                                        
PHP 7.4.26 (cli) (built: Nov 18 2021 16:10:11) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.26, Copyright (c), by Zend Technologies
docker $ docker run --rm dcycle/drupal:7.2021-11-24-21-08-44-UTC /bin/bash -c 'drush status|grep version; php -v'
 Drupal version         :  7.82                                         
 Drush version          :  8.4.8                                        
PHP 7.4.26 (cli) (built: Nov 18 2021 16:10:11) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.26, Copyright (c), by Zend Technologies

If you can confirm that the problem only occurs with the latest version of the image, I would assume that some change in Drupal 7.83 may be the route cause.

Based on that assumption, I looked at the difference between releases 7.82 and 7.83, and it seems that the "changed" column was added to the users table in user_update_7020().

Your error seems to indicate that the changed column is not in the users table, which would lead me to explore the possibility that user_update_7020() was not run on your database.

Please confirm that you run drush updb and still have this error.