Publishing is at the heart of every Tridion implementation – and when it breaks, I feel a bit sad inside. Recently I had a strange content scenario breaking the Publisher service (and the TcmServiceHost.exe in Preview). This happens about 1 time every 2 weeks or so, but when it does, it’s painful. A seemingly normal Multimedia Component could cause this to happen, and we had no way to predict it.
Scenario:
1. Publishing a Multimedia Component (linked to Page) gets stuck at the ‘Rendering’ phase and will not continue or fail.
2. All other pages after this remain waiting in the Publish Queue.
To fix it:
1. Remove item from Publish Queue
2. Re-start Publisher
Troubleshooting the problem:
1. Remove the Multimedia Components 1 by 1 until the problem one is found.
2. Create a new Multimedia Component, using the same image, and replace the old broken Multimedia Component
3. Re-Publish
We are still looking for the root cause.
In the meantime, we need a way to make sure the Publish Queue does not get stuck.
The Solution
Create a Windows Service that scans the Publish Queue at a regular interval (ie. 5 minutes) and if an item is in Queue for 2 intervals at the same phase, it’s stuck. Remove the stuck item from the Queue, restart the Publisher service, and email an Admin.
Source Code
The Source Code is on GitHub at https://github.com/rcurlette/TridionPubQMonitor
To Run:
1. Download Source Code
2. Add the Tridion Core Service DLL and Config to dependencies folder
3. Update the app.config with your username / password for the Core Service
4. Add mailtrap.io settings for sample email
5. Compile
6. Open Command Prompt (Run As Admin)
7. Run ‘InstallUtil.exe TridionPubQMonitoringService.exe’
You can run this on the .exe file built from your Visual Studio in the bin/Debug folder
8. Start the Service in the Services Control Panel. Look at the Tridion Event Log for messages about starting, stopping, etc
9. To recompile, stop the service, uninstall it ‘InstallUtil.exe /u TridionPubQMonitoringService.exe’ and then compile and install
Tips:
– Change the Phase to a phase that items stay in for more than 5 minutes while testing. I had a lot of pages going to ‘Failed’ on my local Dev box, so I set it to that phase. But if your Dev server is in better shape than mine, maybe you would want to change that to ‘Success’.
– You should see the items disappear from the Publish Queue at some moment (after 2 time intervals have passed) and also a message written to the Tridion Event Log.
Leave a Reply