bin/storage adjust (possibly via bin/storage upgrade) runs bin/cache purge --purge-all in a subprocess if it applies adjustments. This subprocess does not inherit any --user, etc., flags from the parent, but requires DROP permission, which the web user may reasonably not have.
It also probably does not inherit --namespace, which could cause an unrelated cache purge.
- Ideally, we should use the provided user -- either:
- Make bin/cache purge accept MySQL credentials, and make bin/storage pass them (and also --namespace).
- Put the actual cache purge code somewhere shared and have them both call it, using the constructed API from the storage workflows (probably easier, less messy, and less error-prone).
- A quick bandaid would be to warn and continue with storage adjust if cache purge fails. This step is not critical, and only improves the performance of storage adjust.