Skip to content
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

UnauthorizedAccessException with SyncSilent #429

Open
hkiezebrink opened this issue Apr 1, 2022 · 2 comments · May be fixed by #440
Open

UnauthorizedAccessException with SyncSilent #429

hkiezebrink opened this issue Apr 1, 2022 · 2 comments · May be fixed by #440

Comments

@hkiezebrink
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Synchronizing with the SyncSilent verb throws an exception when the Retryer tries to process items.

2452 12:52:18 ERROR ERROR: Some directories could not be loaded. (1 inner failures)
master:/sitecore/content/retry-item (Unicorn.DeserializationAggregateException)
at Unicorn.Loader.DeserializeFailureRetryer.RetryAll(ISourceDataStore sourceDataStore, Action`1 retrySingleItemAction, Action`1 retryTreeAction)
   at Unicorn.Loader.SerializationLoader.LoadAll(IItemData[] rootItemsData, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker, Action`1 rootLoadedCallback)
   at Unicorn.SerializationHelper.SyncTree(IConfiguration configuration, Action`1 rootLoadedCallback, Boolean runSyncStartPipeline, IItemData partialSyncRoot)
   at Unicorn.SerializationHelper.SyncConfigurations(IConfiguration[] configurations, IProgressStatus progress, ILogger additionalLogger)
 
INNER EXCEPTION
master:/sitecore/content/retry-item (Rainbow.Storage.Sc.Deserialization.DeserializationException)
No stack trace available.
INNER EXCEPTION
Failed to paste item: /sitecore/content/retry-item (Rainbow.Storage.Sc.Deserialization.DeserializationException)
at Rainbow.Storage.Sc.Deserialization.DefaultDeserializer.Deserialize(IItemData serializedItemData, IFieldValueManipulator fieldValueManipulator)
   at Rainbow.Storage.Sc.SitecoreDataStore.Save(IItemData item, IFieldValueManipulator fieldValueManipulator)
   at Unicorn.Evaluators.SerializedAsMasterEvaluator.EvaluateUpdate(IItemData sourceItem, IItemData targetItem)
   at Unicorn.Loader.SerializationLoader.DoLoadItem(IItemData serializedItemData, IConsistencyChecker consistencyChecker)
   at Unicorn.Loader.DeserializeFailureRetryer.RetryAll(ISourceDataStore sourceDataStore, Action`1 retrySingleItemAction, Action`1 retryTreeAction)
INNER EXCEPTION
The current user does not have write access to this item. User: domain\Anonymous, Item: retry-item ({00000000-0000-0000-0000-000000000000}) (System.UnauthorizedAccessException)
at Sitecore.Data.Items.ItemEditing.BeginEdit()
   at Rainbow.Storage.Sc.Deserialization.DefaultDeserializer.PasteSharedFields(IItemData serializedItemData, Item targetItem, Boolean newItemWasCreated, List`1 softErrors, IFieldValueManipulator fieldValueManipulator)
   at Rainbow.Storage.Sc.Deserialization.DefaultDeserializer.Deserialize(IItemData serializedItemData, IFieldValueManipulator fieldValueManipulator)

SecurityDisabler is missing
When the exception occurs there is no SecurityDisabler active. The Sitecore.Context.Items["SecurityStateSwitcher_State"] is missing the Disabled state. The SyncSilent verb runs inside as a Task and the Sitecore.Context.Items values from the originating HttpContext are not available. The collection falls back on a new thread static object.

This only happens to the Retryer items. I guess that the Retryer is not running inside a UnicornOperationContext.

It doesn't always happen
The exception above does not happen constantly. Sometimes (2/10) it still has a security disabler active somehow and it returns the original non-fatal warning below. Not sure how this happens.

13852 13:10:51 ERROR ERROR: Non-fatal warnings occurred during loading. (1 inner failures)
The fields 00000000-0000-0000-0000-000000000001 (likely field-x), 00000000-0000-0000-0000-000000000002 (likely field-y) are not present in Sitecore on the TemplateName template. (Unicorn.DeserializationSoftFailureAggregateException)
at Unicorn.Loader.DeserializeFailureRetryer.RetryAll(ISourceDataStore sourceDataStore, Action`1 retrySingleItemAction, Action`1 retryTreeAction)
   at Unicorn.Loader.SerializationLoader.LoadAll(IItemData[] rootItemsData, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker, Action`1 rootLoadedCallback)
   at Unicorn.SerializationHelper.SyncTree(IConfiguration configuration, Action`1 rootLoadedCallback, Boolean runSyncStartPipeline, IItemData partialSyncRoot)
   at Unicorn.SerializationHelper.SyncConfigurations(IConfiguration[] configurations, IProgressStatus progress, ILogger additionalLogger)

If the current behavior is a bug, please provide the steps to reproduce.
Use the SyncSilent verb. Make sure one configuration will at least add one (failed) item to retry.

Please mention your Sitecore version and Unicorn version.

  • Sitecore 10.0
  • Unicorn 4.1.3
@tobidemski
Copy link

tobidemski commented Jul 11, 2022

Can confirm this behaviour in Sitecore 9.3 with Unicorn 4.1.6.
On my local instance the SyncSilent verb works with no problems. Only on remote instances (Azure) we are facing this issue.

Example log entry:

13436 11:23:44 ERROR ERROR: Some directories could not be loaded. (10 inner failures)
master:/sitecore/templates/System/Media/Unversioned/Image/__Standard Values (482c3a4c-b1df-4816-9c04-1711af2f58d2)

master:/sitecore/templates/Foundation/Common/Resources Folder/__Standard Values (68548fe0-96c7-4dcf-962c-614d807a11f5)

master:/sitecore/templates/Foundation/Common/Shared Content Folder/__Standard Values (b22f1269-72b0-43b2-81d7-464dd9bf6967)

master:/sitecore/templates/Foundation/Common/Site Folder/__Standard Values (c5d0c5e2-6c7a-43f4-8a5d-c1e0ee73d4f6)

master:/sitecore/templates/Foundation/Common/Site Settings/__Standard Values (c47351bb-8a0f-4dc0-9e4e-684bc687491c)

master:/sitecore/templates/Foundation/Common/Sitemap Settings/__Standard Values (52dcf69b-6650-4bf5-a4ea-4c0369a839d8)

master:/sitecore/templates/Foundation/Common/Configurations Folder/__Standard Values (0a1e5eb9-6cb1-4e6a-b956-c5a26435afe1)

master:/sitecore/templates/Foundation/Common/Global Resources Folder/__Standard Values (4d4b042e-e511-404e-947a-c6d686bfd2cd)

master:/sitecore/templates/Foundation/Common/Global Shared Content Folder/__Standard Values (4c76073f-b45f-4791-8ecd-4f1d2a2f4398)

master:/sitecore/templates/Foundation/Common/Global Shared Elements/__Standard Values (c8228387-452f-42c1-acb7-30d45b3b7104) (Unicorn.DeserializationAggregateException)
at Unicorn.Loader.DeserializeFailureRetryer.RetryAll(ISourceDataStore sourceDataStore, Action`1 retrySingleItemAction, Action`1 retryTreeAction)
   at Unicorn.Loader.SerializationLoader.LoadAll(IItemData[] rootItemsData, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker, Action`1 rootLoadedCallback)
   at Unicorn.SerializationHelper.SyncTree(IConfiguration configuration, Action`1 rootLoadedCallback, Boolean runSyncStartPipeline, IItemData partialSyncRoot)
   at Unicorn.SerializationHelper.SyncConfigurations(IConfiguration[] configurations, IProgressStatus progress, ILogger additionalLogger)

INNER EXCEPTION
master:/sitecore/templates/System/Media/Unversioned/Image/__Standard Values (482c3a4c-b1df-4816-9c04-1711af2f58d2) (Rainbow.Storage.Sc.Deserialization.DeserializationException)
No stack trace available.
INNER EXCEPTION
Failed to paste item: /sitecore/templates/System/Media/Unversioned/Image/__Standard Values (Rainbow.Storage.Sc.Deserialization.DeserializationException)
at Rainbow.Storage.Sc.Deserialization.DefaultDeserializer.Deserialize(IItemData serializedItemData, IFieldValueManipulator fieldValueManipulator)
   at Rainbow.Storage.Sc.SitecoreDataStore.Save(IItemData item, IFieldValueManipulator fieldValueManipulator)
   at Unicorn.Evaluators.SerializedAsMasterEvaluator.EvaluateUpdate(IItemData sourceItem, IItemData targetItem)
   at Unicorn.Loader.SerializationLoader.DoLoadItem(IItemData serializedItemData, IConsistencyChecker consistencyChecker)
   at Unicorn.Loader.DeserializeFailureRetryer.RetryAll(ISourceDataStore sourceDataStore, Action`1 retrySingleItemAction, Action`1 retryTreeAction)
INNER EXCEPTION
The current user does not have write access to this item. User: extranet\Anonymous, Item: __Standard Values ({482C3A4C-B1DF-4816-9C04-1711AF2F58D2}) (System.UnauthorizedAccessException)
at Sitecore.Data.Items.ItemEditing.BeginEdit()
   at Rainbow.Storage.Sc.Deserialization.DefaultDeserializer.PasteSharedFields(IItemData serializedItemData, Item targetItem, Boolean newItemWasCreated, List`1 softErrors, IFieldValueManipulator fieldValueManipulator)
   at Rainbow.Storage.Sc.Deserialization.DefaultDeserializer.Deserialize(IItemData serializedItemData, IFieldValueManipulator fieldValueManipulator)

....

@AbhishekKumar26
Copy link

Hi,

Faced the same issue with Unicorn: 4.1.4 Sitecore: 10.1.1

Thankls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants