After many months of using Synology Storage Analyzer to create automatic reports recently these have been failing with the error
Storage Analyzer: A data write error occurred while generating the usage report.
A bit of searching online and this seems to be common for a few reasons. In my case, this was caused by having a LDAP server configured that was no longer online.
To remove the configuration go to Control Panel > Domain/LDAP and either fix or remove any invalid Domain/LDAP servers.