Once we faced below error during deployment on one of Content Delivery instance:
Failed to deploy web package to App Service.
Error Code: ERROR_NOT_ENOUGH_DISK_SPACE
More Information: Web Deploy detected insufficient space on disk.
Microsoft.Web.Deployment.DeploymentException: The error code was 0x80070070.
System.IO.IOException: There is not enough space on the disk.
While troubleshooting, one of our DevOps engineer noticed that there were 216 Device Detection Database Files of total 52,988,077,045 bytes in /wwwroot/App_Data/DeviceDetection folder.
We manually deleted old versions of databases at that time and raised Sitecore support ticket.
As per Sitecore,
Device Detection is enabled by default from Sitecore 9.0 and 51Degrees is default provider. New version of database is downloaded to the instance when a user visits site on a device which is not added to the database yet. And old versions of databases are not deleted automatically.
Sitecore provided below workarounds for the issue:
1. Manually delete old versions of databases form /App_Data/DeviceDetection folder.
2. Configure Sitecore.Tasks.CleanupAgent agent to check /App_Data/DeviceDetection folder.
Patch configuration to delete device detection databases which are added 30 days ago. You can configure maxAge as per the frequency of database version creation.
<configuration> <sitecore> <scheduling> <agent type="Sitecore.Tasks.CleanupAgent"> <files> <remove folder="/App_Data/DeviceDetection" pattern="DeviceDetectionDB-*.db" maxAge="30.00:00:00" recursive="false" /> </files> </agent> </scheduling> </sitecore> </configuration>
Sitecore has registered this behavior as a bug and the reference number is 328306.