I was setting up the Sitecore Publishing Service 2.0 on our staging environment during the last couple of days. Things were going well and the Sitecore Publishing Service has been set up properly. Triggering a publish item was working as expected.
Even though the module was working, we had to setup the auto publish agent for it to work with the new Sitecore Publishing Service. Our current auto publish was not using the PublishManager. So, we decided to move to the default auto publish which Sitecore provides.
However, when adding the language en-GB and performed either a Smart or Full publish, the below error is being captured in the publishing logs.
One or more targets were not succesfully promoted.
System.AggregateException: One or more targets were not succesfully promoted. The failed target(s) are: Manifest=f45d569f-cf0c-4fda-9739-f9afb04d71eb Target=8e080626-ddc3-4ef4-a1d1-f0be4a200254.
See inner exceptions for details. —> System.AggregateException: One or more errors occurred. —> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: A valid VarianceType could not be determined from and 1.
This issue is due to the fact that there are corrupted items in the database. The solution is very simple.
First, you need to connect to the SQL Core Database and performed the below query.
This query will output the different items and fields that are corrupted. So, you need first to truncate the table Links from the Core database. You can use the below query.
truncate table Links
Once the table has been truncated, you need to perform a rebuild of the link from the Control Panel
Once the rebuild has completed, re-run the above query to see if there are still items which are still corrupted. If not, execute a Full Publish with the Repair Mode on and voila. Issue is fixed 🙂
Common Publishing Service Issue
Invariant Language also can cause the error above. You may read this article how to get this fix and then you proceed with the above steps.
It may also happens that when you open the Publishing Dialog, the languages are not present. In order to fix the issue, you need to delete the Temporary Files for asp.net. This will fix the issue.