Thank you, Michael.
For anyone who is still following this: The plugin checks that the number of bytes written matches the content that plugin is trying to write so all backups are consistent without data corruption. In this case, when the plugin exported WordFence records that contained strings like “alfacgiapi/perl.alfa”, the filesystem refused to fulfil the fwrite request and fwrite returned NULL.
I believe there is a security filter attached to the filesystem, PHP, or Apache that does this as fwrite should *never* return NULL.
Here is a test script that you can use to verify this. However, only 2 people have tried this so the trigger string could be different.
<?php
$file_handle = fopen( "ai1wm-write-file", "w" );
$content = "alfacgiapi/perl.alfa";
$write_result = @fwrite( $file_handle, $content );
if ( false === $write_result ) {
echo 'Unable to write to the file.';
} elseif ( NULL === $write_result ) {
// this should never ever happen but it does
echo sprintf( 'The filesystem did not allow me to write <code>%s</code>', $content, );
} elseif ( strlen( $content ) !== $write_result ) {
echo sprintf( 'Out of disk space. I tried to write %d bytes but I wrote only %d bytes', strlen( $content ), $write_result );
}
fclose($file_handle);
Only do this on a test site.
1. Save the script to wp-content/ai1wm-test-writer.php
2. Open the script in your browser: site-url/wp-content/ai1wm-test-writer.php
3. If you see “The filesystem did not allow me to write alfacgiapi/perl.alfa
” then you there is a security filter (my guess) that blocks you
4. Delete wp-content/ai1wm-test-writer.php and wp-content/ai1wm-write-file after use
I have not seen this issue on any of our supported hosting providers. It is impossible for me to figure out how/why this happens without the hosting provider’s assistance.
You could point them to this explanation and they can reach me and our support team via: https://servmask.com/contact-support
As a reminder to everyone, the above is just one of the reasons why you might be seeing Out of disk space, there are other reasons but the most common causes of this error ordered by frequency are:
1. There is not enough disk space.
2. Max file size limit of 2GB, 4GB, 8GB