Salesforce

With SDL Web 8.1/8.5, the script Remove-TcmItemsOldVersions has a long running query and times out

« Go Back

Information

 
Article TypeSolution Article
Scope/EnvironmentSDL Web 8.1, SDL Web 8.1.1, SDL Web 8.5
Symptoms/Context
In SDL Web 8.1/8.5, you want to use the Powershell script Remove-TcmItemsOldVersions to remove older versioned items from the Content Manager system.   At times a large amount of data is needed to be removed and the query on the Content Manager database takes an extended amount of time.  This leads to an error as such:
 
Remove-TcmItemsOldVersions : The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded
by the remote host, or an underlying network resource issue. Local socket timeout was '1.06:00:00'.

The time in the error message may vary.
 
Resolution
1. Open the SDL Web Configuration Snap-In.
2. Go to the Timeout Settings node.
3. Edit the parameter "Seconds before a time out error is generated when executing a long query".
4. The default is 600 seconds and it needs to be increased from this to a higher value that will allow for the longest possible queries to finish without aborting.
Root Cause
The timeout is always happening after around 10 minutes. It is running into the default long running query timeout set in the Web Configuration Snap-In.
Reference
Attachment 1 
Attachment 2 
Attachment 3 
Attachment 4 
Attachment 5 

Powered by