SQL Server database error: 'PRIMARY' filegroup is full

 SQL Server database error: 'PRIMARY' filegroup is full

  
Symptom
 
When doing some common operation using the Agile Platform,  such as uploading or publishing an eSpace or Solution or even when packing a solution for download, you can get the following unexpected internal error, something like:
 
Could not allocate space for object '<object_name>' in database '<database_name>' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
 
Cause
 
This error means that the 'PRIMARY' filegroup size has reached a limit. By default, the 'PRIMARY' filegroup is where your Runtime Database is stored, but this error is not related with the Agile Platform itself but rather an issue in the Database Server. Thus, this situation can happen for several reasons, the most common are:
 
1. The database file associated to 'PRIMARY' filegroup is set with a Restricted File Growth and the Maximum File Size has been reached.
 
2. The database as reached the limit disk usage (note: SQL Server Express 2008 R2 have a 10GB maximum database size and 4GB for SQL Server Express 2008 and earlier).
 
3. The database server as reached the limit disk usage or disk quota.
 
Resolution
 
Option A: In most cases, in order to have more space available in your database, we recommend using Service Center option to delete old eSpace versions that you no longer need:
 
How to:
1. Goto Service Center -> Factory -> eSpaces;
2. Click "Check Old eSpace Versions to Delete";
3. In the Combo Box, select what versions older than the specified time you want to delete;
4. Click "Check Versions to Delete";
5. Click "Delete Displayed Versions".
 
You can also delete unnecessary eSpaces to free some database space, but you have to do it individually.
 
Option B: In case you don't want to delete any eSpace or eSpace versions, there's also other possible workarounds that your DBA could consider:
 
1. In the database file associated with 'PRYMARY' filegroup, set Enable Autogrowth with Unrestricted File Growth (this is the default when installing the Agile Platform).
 
2. Free database server disk usage, by deleting unnecessary database objects.

3. Free disk space, by deleting unnecessary files or increase the disk space (if possible).

4. Move the database file associated with 'PRYMARY' filegroup, to a volume with more space.
 
Further considerations
 
- We don't recommend adding additional files to the filegroup unless for reasons of database performance or maintenance backup/restore strategies.
- We don't recommend the option Shrink Database or Shrink File, since this will introduce logical fragmentation and thus degrading performance.
 
Feel free to post your remarks or corrections to what is said above.
 
Cheers,
 
João
Is it possible to automate/schedule option A?
Is there any way to do this in the personal environment?  I am quite publish-happy and have too many versions.  I would like to only keep a select few of them but there is no option to delete, only Publish or Download
Hi Doug,

In the personal environment at this point this is something that needs our support. If you come across this issue again please contact us via success@outsystems.com.

Cheers,
Davide