There are some answers on SOF but in my case this was caused by no more disk space.

Checked permissions and they had the web server user www-data with write access to all app/tmp/*

Checked the /var/log/apache2/error.log and found a “no space left on the device warning”

Therefore did a disk clean up and suddenly started working again