In one of the websites on production, when Drupal writes on the temporary directory, it randomly stops working with the following error, even though the permissions are set correctly, and there is enough space.
Temporary file data could not be written
The temporary directory is set to the DRUPAL_ROOT/sites/default/files/tmp directory.
Removing the content of the temporary directory solves the problem, but it came back again. I can't debug the reason.
How can I fix this issue?