Deployment sometimes fails with "LOADING Redis is loading the dataset in memory" error
This is trigger in RedisCacheTagsChecksum.php line 85, and according to this issue, the module won't deal with this. This article explains where it's coming from, and I read this such that Redis might still be loading data from disk while Drupal is already trying to connect.
However, we're already sleeping for 3 seconds trying to prevent this from happening right after restarting docker compose:
$ docker compose exec -u root php chown -R www-data:www-data .
$ docker compose exec -u root php chown -R www-data:www-data /data
$ docker compose exec -u root php chmod -R ug-w .
$ docker compose exec -u root php chmod -R ug+w /data
$ docker compose exec -u root php bash -c 'chmod -R ug+w web/sites/*/files'
$ docker compose exec -u root php bash -c 'chmod -R ug+w web/sites/*/private'
$ docker compose exec -u root php bash -c 'chmod 444 /data/*/*/.htaccess >/dev/null 2>&1 || true'
$ docker compose exec -u root borgmatic chmod -R go-w-r-x /root/.ssh || true
$ if [[ ! -d /data/${CI_COMMIT_REF_NAME}/backup/config/security ]]; then docker compose exec -u root borgmatic borgmatic --init --encryption repokey || true; fi
$ if [[ -f ./crontabs/jobs.ini ]]; then docker compose exec -u root php chown -R www-data:www-data /var/backups/mysql || true; fi
$ if [[ "$INITIAL" == "no" ]]; then sleep 3; drush -y cache-rebuild; fi
Let's see what else we can do.