Investigating why something was not published - mitikov/KeepSitecoreSimple GitHub Wiki
An item was not published, however, we expect it to be published!
Item was not published
usually means changes cannot be seen in the live site
.
An old information might be shown from the HTML cache/indexes/browser cache/CDN, whereas an item could physically exist in live
site database and it is wrong to blame publishing.
Zero step is to check the existence of an item:
Select * from Items where id='missing_item_id'
If nothing is physically stored in the database, it is a time to start the investigation.
- Item change was not detected by publishing mode
- Item change was skipped (
publishItem
pipeline responsibility) - Publish operation was not executed (Another publishing was executed, and your one is still in a queue)
Sitecore can be configured to write additional information into logs to provide more insights.
A) Output more publishing-related information by setting DEBUG log level:
<root>
<priority value="DEBUG"/>
<appender-ref ref="LogFileAppender"/>
</root>
<logger name="Sitecore.Diagnostics.Publishing" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="PublishingLogFileAppender"/>
</logger>
As a result, Debug messages would be printed to logs.
B) Setting 'traceToLog' for UpdateStatistics processor in PublishItem pipeline:
<processor type="Sitecore.Publishing.Pipelines.PublishItem.UpdateStatistics, Sitecore.Kernel" runIfAborted="true">
<traceToLog>true</traceToLog>
</processor>
Sitecore will output reasons for picking specific operation:
INFO ##Publish Item: Name=__OnSave, Uri=sitecore://master/{62B79128-155C-4210-A4D2-EEC62BB51603}?lang=en&ver=1, Operation=Skipped, ChildAction=Allow, Explanation=The source and target items have the same revision number.
INFO ##Publish Item: Name=Sample Item, Uri=sitecore://master/{56F6D1D9-DBB1-414F-BF45-E7FC8503EE74}?lang=en&ver=1, Operation=Updated, ChildAction=Allow, Explanation=Version 'en_1' was published.
C) Setting 'high' event timing level
<events timingLevel="high">
This would force to write time spent for processing each event, and would pinpoint to code slow parts:
INFO Event ended: item:saved. Elapsed: 42.32
Once Sitecore is configured, publishing can be triggered to reproduce the issue, and collect diagnostic information.
Load resulting Sitecore logs into Log Analyzer, and set string filter to item id:
Item changes were picked by publishing, but the item was considered as unpublishable due to a lack of publishable versions.
Locating publishing restrictions for the item via SQL query results in one row:
C61E96C1-D6B4-400E-A444-D4FF80839217 Am i draft __Never publish 0 shared 1 2017-08-08 07:09:08.423
Item has Never publish checkbox set that is preventing it from being published.
Let`s locate item versions in final workflow via items_in_final_workflow.sql:
Item does not have any items in final workflow ff query did not output any results.
If a publishable item was not published for some reason, it is a time to compare processor list in publishItem
pipeline with a clean Platform.
If some items are still not published with stock publishItem
, and publish
pipelines, it is time to reach Sitecore support.