Repository navigation
fix(runtime): prevent Akaunting HTTP 500 from root-owned Laravel cache - #72
Open
vitormattos wants to merge 1 commit into
Open
vitormattos wants to merge 1 commit into
vitormattos wants to merge 1 commit into
Conversation
…user Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Incident and verified cause
On 2026-11-10/11, production returned HTTP 500 on the dashboard and invoice edit pages (including invoice 2368). Laravel logged
file_put_contents(storage/framework/cache/data/cf/40/...): Permission denied. The two directory segments were owned byroot:rootwith mode0755, while PHP-FPM executes aswww-data(UID 1000 on the deployment). We restored ownership immediately in production; no financial records were modified.Permanent fix
storage/framework/cache, instead of recursively chowning application files or the financial ledger.scripts/artisan.shto run administrative Artisan commands under the web worker identity, avoiding new root-owned runtime cache paths.Verification
entrypoint,artisan,update).www-datawhile files outside the runtime cache retain their original owners.bash -nandgit diff --checkpassed.bats/batsimage could not runpatchesandwait-for-dbtests because that image lacks Git and PHP; the corresponding tests were not modified.Deployment note
The immediate issue has already been resolved on Conceição by correcting the two misowned cache directories. The startup self-healing requires a rebuilt/released PHP image (or equivalent deployment of the entrypoint and helper); this PR is not yet deployed. Never run
docker compose exec akaunting.php php artisan ...as root: usebash scripts/artisan.sh ...after deployment.