Here’s how to remedy the “There is not enough space on the disk” error on Azure SQL Data Sync.
You established a data sync between an Azure SQL Database to a SQL server, on-premises, or in an Azure VM. The Status was “progressing,” and you can see the provisioning as successful and running. After some time when you went back and check, the sync has stopped and you find the following error:
Sync failed with the exception “An unexpected error occured when spooling changes to a batch file. See the inner exception for more details. Inner exception:
There is not enough space on the disk. For more information, provide tracing ID ‘'<TRACEID>’ to customer support.”
Data Sync uses the Windows TEMP folder on the server where the Data Sync Gateway resides, to generate temporary batch files for the sync activities. The space required could be substantial if you are initializing a sync. By default the Windows TEMP folder is on %SystemRoot%\TEMP which is normally on the system volume C:\. You would require additional space to this volume for the activity.
The temp folder is defined by the environment variable TEMP. You can re-point this to a volume that has more space than your system volume to avoid affecting the stability of your server.
- Log into the server where the Data Sync Agent is installed. You can launch the properties either from Control Panel-> System and Security -> System or by Right clicking This PC from File Explorer and choosing Properties.
- Choose Advanced System Settings and go to the Advanced tab.
- Click on Environment Variables.
- Under System Variables look for TEMP and TMP.
- Choose Edit and under Variable Value enter the folder you want it to use.
- Click OK.
Normally, this change doesn’t require a server restart. You can go ahead and just restart the Data Sync agent and it should use the new environment variable. But other running applications will still use the old variable values. As a safety measure, always restart a server if you change any server configuration:
After changing this, you can restart the sync. You should start to see files being created on the folder you assigned for. For more information on troubleshooting Azure DataSync, you can check out Troubleshoot SQL Data Sync – Azure SQL Database | Microsoft Docs.
I hope you found this post useful. Feel free to drop questions in the comments, and make sure to sign up so you don’t miss the next post.