Skip to main content

Cleanup OpenSource Powershell Script - "Delete files older than x-days" - can interfere with SDL Tridion transactions folder: How to avoid this?


In my last post, I talked about how the anti-virus scan can impact publishing and which folders to ensure to exclude from scanning. 

After that post, I came across another issue that showed me that not only anti-virus scanning is to be kept in mind when configuring Tridion servers.

I came then across an issue where the items suddenly remained in 'Ready for Transport' in the Publishing Queue and then noticed that the 'TRIDION_HOME\bin\transactions' folder was no longer a regular folder but instead turned into a flat file. 

After further investigation, it turned out that there was a daily scheduled task cleaning up the transactions folder. While this is a common and recommended practice to clean up old tridion files, this task was removing the transactions folder and causing this strange behavior.

The powershell script that this scheduled task was executing, is an open source powershell script that can be found in the following link:


 If you are making using of such script on your servers, it is important to keep in mind that, by default, this script handles folder deletion as follows:  

*Default mode, only delete folders that became empty after the script deleted all files in the folder, this includes the root folder.

The moment this script is running on your server, if there happens to be any activity in the transactions folder, this script will remove its content and also the transactions folder. 

At that moment, the items will then show in the Publishing Queue that they are ‘Ready for Transport’. In such situation, you might then restart your SDL Tridion Transport Service and notice that the items will still remain in the same state. If you inspect the ‘ TRIDION_HOME\bin’ folder, it might be showing the transactions as a flat file. Please note that this behavior will only happen if, at the time the script was executed the Transport was busy also processing items. 

To ensure that you don’t come across this issue, you will need to modify the script to include one of the following switches that are available:

* -NoFolder switch, no folders are deleted including the root folder.
* -CleanFolders switch, all empty folders in the path will be deleted, this however excludes the root folder.

As an example, you would then update your script to something similar to this:

# Cleaning Transactions folder
.\deleteold.ps1 -FolderPath "D:\Tridion\transactions" -FileAge 5 -log "D:\Tridion\log\cleanup" –autolog –NoFolder

Or

# Cleaning Transactions folder
.\deleteold.ps1 -FolderPath "D:\Tridion\transactions" -FileAge 5 -log "D:\Tridion\log\cleanup" –autolog –CleanFolders

After this change, your Transport Service will always happily process items!

Note: After reading this blog post, a customer reported that this issue can also happen when there are still files present in the transactions folder and not just when the folder is empty. Please keep also this in mind and ensure to implement the change above to completely avoid the issue also in the scenario that there are some old .state.xml files left in the transactions folder. 

Comments

Popular posts from this blog

SDL Tridion: Tips to troubleshoot and resolve the 'Throttling' status

The throttling status should be a temporary state, so although you might see some items in the Publishing Queue with that state, it should resolve itself once the deployer has available threads to pick up more packages. In case the items stay 'stuck' in this status, there are a few things you can check that I enumerate below:
·As mentioned in the documentation, ensure that the window size is equal to or larger than the total number of Transport Service threads configured on the Content Manager side. This settings can be found in the cd_transport_conf.xml, as follows:
<Workers NormalPriorityPoolSize="5" HighPriorityPoolSize="5" TransportPriorityPoolSize="5"/>
By default, this section is commented out and these are the default values. If the deployer’s window size is lower than 5 then you need to change it to ensure that it is set to 5 or higher.
·Check if the database maintenance tasks for the broker database are in place and the frequency tha…

SDL Tridion: How to enable Profiling and Personalization in 2013 using Tracking Keys

When attempting to setup Profiling and Personalization in Tridion, I have faced some challenges and once I was able to get it to work, I have made a small list of steps that were essential to finish this setup.

Here you can find the steps I have followed to be able to enable P&P in my SDL Tridion 2013 environment using Tracking Keys:

Add the cd_wai.jar to your deployer and website's lib folder;

Add the cd_wai_conf.xml to your deployer and website's config folder;

Update the cd_wai_conf.xml to include a reference to the host name, in other words, the location of your website. In my case, I have changed it to the following:

<Host Domain="localhost" Port="83" Protocol="http" Path="/"/>

In the same configuration file, ensure to enable Personalization, as follows:

<Personalization Enabled="true" Persistence="cookies">

Now in your CME, create your target groups, by selecting your publication folder where yo…

Tips for configuring the SDL Tridion Cache Channel Service

When installing and configuring cache, you may have one of these two scenarios below:
Scenario 1: The deployer, CCS and websites all reside in the same server
When the deployer, CCS and websites are running on the same server, open the cd_storage_conf.xml of one of these components and make the following changes: ·Enable caching by setting the following flag to true: <ObjectCache Enabled=“true"> ·Leave the RMI section commented out:
<!-- RMI CacheChannel Connector example <RemoteSynchronization Queuesize="128" ServiceMonitorInterval="10000" FlushCacheDuringDisconnectInterval="20000"> <Connector Class="com.tridion.cache.RMICacheChannelConnector" Host="127.0.0.1" Port="1099" /> </RemoteSynchronization>--> ·Enable the item types that you would like to cache, by explicitly adding the cached element and setting it to true:
<Item typeMapping="Metadata" cached="true"(..)/> <Item ty…