When attempting to export large reports containing thousands or tens of thousands of records, users may receive the following message:
An error has occurred during the export process. The export file cannot be completed.
This issue is seen primarily with exporting data in CSV and XLS formats, however, the failures are not exclusive to these formats.
One possible cause of this failure can be found in the Application Pool Recycle settings. If you have the Application Pool configured to recycle based on a memory threshold, this threshold can be easily reached when exporting large reports which cause the Application Pool to reset and the export to fail.
To resolve the issue, change the Application Pool Recycle setting to a time based limit rather than a memory-based thresholds. An example of the recommended settings are shown below:
From experience, it is recommended to set the regular time intervals value setting to 1440, which is 24 hours and also setting specific time(s) to a fixed time when it is anticipated that traffic will be low (e. g., 4:00 AM ET/1:00 AM PT in the US). Setting the value to a fixed time each day during the lowest traffic times will minimize any impact and also allow you to troubleshoot easier if you run into any issues. If you have multiple application pools, it might be wise to stagger them to avoid overloading the server with recycles. Also note that IIS overlaps the app pool when recycling, so, usually, there is not any true downtime during a recycle. Existing actions continue to process until complete and any new actions will be picked up by the newly spawned worker process. However, in-memory information, such as session state, etc., would be lost.
Other than the option of exporting smaller reports, no other workaround is known.
Note the information included below.
Application Pool Recycle times
Microsoft IIS Server has the application pool recycle time default to 1740 minutes, which is exactly 29 hours.
For a situation where you do not know the environment, 29 hours is probably a good default starting point. However, as an archer administrator, you will likely be familiar with your environment, and it may be best to change this after days or weeks of monitoring and analyzing your site traffic. It is recommended to set this to a fixed time (like 4:00 AM ET/1:00 AM PT in the US). Setting it to a fixed time each day during low traffic times will minimize the impact and also allow you to troubleshoot easier if you run into any issues. If you have multiple application pools, it might be wise to stagger them to avoid overloading the server with recycles.
Note that IIS overlaps the app pool when recycling so there usually is not any true downtime during a recycle. Existing actions will continue to process until complete and any new actions will be picked up by the newly spawned worker process. However, in-memory information (session state, etc) would be lost.
In theory, you don’t really need a daily recycle unless you have a known problem. A daily recycle is just a preventative measure to refresh IIS in case there is a slight memory leak or anything else that may slowly creep into the worker processes. Keep in mind that you can turn it off completely, however, it is recommended setting it to recycle once per day at an off-peak time as a proactive measure.
While on the topic of app pool defaults, there is one more that you should consider changing with every new server deployment. The Idle Time-out should be set to 0 unless you are doing bulk hosting where you want to keep the memory footprint per site as low as possible.
If you have just a few sites on your server and you want them to always load fast, then set this value to zero. Otherwise, when you have 20 minutes without any traffic (unlikely in a busy Archer environment, but still plausible) then the app pool will terminate so that it can start up again on the next visit. The problem (albeit minor) is that with the first visit to the site, an app pool needs to spin up a new w3wp.exe worker process which can be slow because the app pool needs to be created, ASP.NET or another framework needs to be loaded, and then your application needs to be loaded. That can take a few seconds. From experience, it is recommended to set that to 0 when possible, unless it is for a server that hosts many sites that do not always need to be immediately available.