Upon visiting my Piwik homepage today I got a page that said "an error occurred" followed by "Piwik couldn't write to some directories (running as user 'www-data')." and a list of commands to try.
I have monitoring in place that checks whether HTTP services respond with 200 OK, aka a success status code. Obviously Piwik is not OK in this scenario, and should return 500 Internal Server Error instead.
Thanks for the suggestion @strugee definitely agree! This is similar to https://github.com/piwik/piwik/pull/10623
I have put up a PR containing a possible solution for this issue. https://github.com/matomo-org/matomo/pull/17206
Fixed by #17206