-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving template causing data loss in Shared and Unversioned Fields #334
Comments
When you move the template, is it moved across 2 separate configurations? or are both locations predicates in the same configuration? |
@cassidydotdk The template is moved to another folder in the same instance with same configurations. And then when you Sync this change on another Sitecore instance/configuration that already has this template and item(s) based on this template the content in Shared/Unversioned fields is gone. |
Show me the configs, please. And the template locations involved. |
Template Location Template was moved from /sitecore/templates/Feature/UnicornTest to /sitecore/templates/Feature/UnicornTest/SubFolder Related config file
|
I need you to set Debug level logging, run the operation again and paste the logs here. When an Item in Sitecore moves, the following log operation should take effect. I need to know if it does, and the specifics of what it logs. And if not, I need to know the additional logging.
|
@cassidydotdk Please find below log entries. Additionally I have tested that the data is actually gone from Shared and Unversioned fields (by checking in the Database directly) and it is not a cache issue.
|
Thanks for sharing. Did you try and disable Dilithium? That would narrow it down for me; as I can't seem to reproduce the issue here. |
@cassidydotdk I have tried by disabling Dilithium. The result is the same for me in terms of data loss. It is important to note that the item for which the data is being lost is NOT controlled by Unicorn. Unicorn controlled items do not have this problem. The template however is controlled by Unicron. Sitecore log entries of moved template
Unicorn Sync log on Instance B (the other Sitecore instance)
|
@cassidydotdk Before disabling Dilithium, I could produce the issue in both scenarios i.e. when /sitecore/templates/Feature/UnicornTest/Test But NOT when I move Test is the template name in above paths In short the issue appears when the template is first deleted and then added. Sync log when the issue do NOT appear
Sync log when the issue appears
|
I have a theory. Are your Rainbow settings for SerializationFolderPathMaxLength the same on all environments?
And if it is; what is your absolute root path (e.g. C:\Projects\MyProject..\Unicorn)? |
@cassidydotdk The Rainbow setting is the same in all environments which is
The absolute root path is |
That is interesting. We may be dealing with some sort of wraparound bug. Here's a bit of data. Bear with me.
Now looking at your template.
In this example, the template item itself
Can you confirm the folder structure on disk for me please? If the content was serialized with 150 as a setting, you should be seeing no sub folders on Also; your 150 setting seems excessive, since your root folders are much much shorter.
|
@cassidydotdk Do you think reducing the 150 setting to 120 will help fix this issue? The folder structure generated by Unicorn on the disk is as follows
|
I'm not 100% sure, but I do feel it's somehow related. See how your path lengths come out very long, also because of your naming. I normally use a short name notation for configs and predicates, to allow for as much room as possible. If you don't mind - could you try the following scenario: Rename the config from Leave the settings as-is for now. |
@cassidydotdk Tried both i.e. renaming and changing setting to 120 but still have the same issue. Whenever the template is deleted and added back again the content is gone in Shared and Unversioned Fields. It does not happen with Versioned Fields. Paths now are |
@cassidydotdk Any update? We have another production deployment end of this week and last time this issue caused us a lot of trouble as we had to restore all shared and unversioned fields after the deployment. Thanks a lot for your help. |
At this time, no. I've run out of immediate ideas that might be causing this for you, so I'm going to have to set up a test instance that resembles all the configuration you've shown me here and see if I can reproduce it. Based on the results of that, we'll see what comes next. |
Ok, just to confirm the setup. I now have the following. A Sitecore Template configured like this: I have a content item based on this template: I have a Unicorn configuration resembling yours, with an equivalent root path (except for the drive letter, which I'm sure we can rule out here).
And I have a folder structure that now looks like this: I also have Rainbow configured as this: As far as I can tell, this should closely resemble your case am I correct? So what you're saying is; that if I am to move that Test template into a sub folder named |
Anyway, giving that a go. Recording steps and outcome here. First backing up the solution DB.. Then creating Unicorn file repository now looks like this Unicorn logged this
YAML for
And just to make sure Unicorn DID update the parent ID correctly (log file states saving was ignored because of inconsequential changes) - it matches This is now your target state. Going to reset IIS, restore the DB, warm up Sitecore and then Sync Unicorn. See what happens. Warming up Sitecore, it now looks like this again Telling Unicorn to (at first glance this looks somewhat surprising, I would have expected a [M] operation) Unicorn log
Template has been moved as expected So now - the real kicker. How is our content item doing? Which means I can confirm this issue. Now that I can reliably reproduce it, I will look into why this is happening. |
A fix for this problem has just been committed. I will be publishing Rainbow 2.0.6-pre4 to NuGet within an hour or so. Please update your Rainbow version and see if it works for you. It solves the problem entirely on my local setup; Sitecore 9.0.1. |
FWIW I could have found a way to make Rainbow issue a [M] command instead of [D] and [A] - but that would still have had problems when templates moved between predicates and configurations. This fix should effectively close the book on that. |
NuGet has now accepted and published the release. https://www.nuget.org/packages/Rainbow/2.0.6-pre4 Please test it out and revert @zaheer-tariq |
@cassidydotdk I have tested the fix locally in different scenarios and found that the issue is resolved. We will gradually test the fix on staging, per-production and production environments. I will get back to you with details if we see the issue in any other scenario/environment. For now this issue can be closed. I really appreciate your help and support. Thank you |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Unicorn removes data/content of Shared and Unversioned fields when a template is moved to another folder. This happens to items that are not controlled by Unicorn. The data of Versioned fields is however preserved. In production the content items are not controlled by Unicorn therefore this data loss is a very BIG issue. Urgent help/support on this issue will be really appreciated.
If the current behavior is a bug, please provide the steps to reproduce.
I investigated in details and noted that the data is removed when the template is added again. I then tested if Sitecore removes the data or Unicorn by removing the template via Unicorn and adding it via Sitecore package and found that Sitecore does not remove the data. Therefore I am certain that it is Unicorn who clears Shared and Versioned fields when adding a template.
What is the expected behavior?
The data should not be lost in any case what so ever.
Please mention your Sitecore version and Unicorn version.
Sitecore = 9.0.2
Unicorn = 4.0.7
The text was updated successfully, but these errors were encountered: