umbraco / Umbraco.Deploy.Issues

1 stars 0 forks source link

Umbraco Deploy fails when changing Media Folder to have permission for Article Media #145

Open jomehmet opened 1 year ago

jomehmet commented 1 year ago

Specifics

Using Umbraco Cloud on Standard plan. Umbraco Deploy fails when changing Media Folder to have permission for Article Media

Steps to reproduce

Expected result

Last deployment operation completed

Actual result

It fails complaining about a node id it can't find

Workaround

AndyButland commented 1 year ago

I've tried to replicate this in my setup but have been unable to I'm afraid. If you are still seeing the issue, please could update with the versions of CMS and Deploy you are using, and also if you can share any more details about the error message you receive? Thanks.

jomehmet commented 1 year ago

@AndyButland I'm currently on Umbraco: 10.3.2 with Deploy: 10.1.2

I just got this same error after adding SVG alias:umbracoMediaVectorGraphics as allowed child node type to Media Types -> Folder and it worked with the Workaround mentioned in the previous post.

The exception before making the workaround is:

Umbraco.Cms.Core.Exceptions.PanicException: failed to get child with id=18835 at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.GetRequiredLinkedNode(Int32 id, String description, Nullable1 gen) at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.ClearBranchLocked(ContentNode content) at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.ClearBranchLocked(ContentNode content) at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.ClearBranchLocked(ContentNode content) at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.UpdateContentTypesLocked(IReadOnlyCollection1 removedIds, IReadOnlyCollection1 refreshedTypes, IReadOnlyCollection1 kits) at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.RefreshMediaTypesLocked(List1 removedIds, List1 refreshedIds, List1 otherIds, List1 newIds) at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.Notify[T](ContentStore store, JsonPayload[] payloads, Action4 action) at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.Notify(JsonPayload[] payloads) at Umbraco.Cms.Core.Cache.ContentTypeCacheRefresher.<>c__DisplayClass11_0.b__6() at Umbraco.Extensions.PublishedModelFactoryExtensions.WithSafeLiveFactoryReset(IPublishedModelFactory factory, Action action) at Umbraco.Cms.Core.Cache.ContentTypeCacheRefresher.Refresh(JsonPayload[] payloads) at Umbraco.Cms.Infrastructure.Sync.ServerMessengerBase.DeliverLocal[TPayload](ICacheRefresher refresher, TPayload[] payload) at Umbraco.Cms.Infrastructure.Sync.ServerMessengerBase.Deliver[TPayload](ICacheRefresher refresher, TPayload[] payload) at Umbraco.Cms.Infrastructure.Sync.ServerMessengerBase.QueueRefresh[TPayload](ICacheRefresher refresher, TPayload[] payload) at Umbraco.Cms.Core.Cache.DistributedCache.RefreshByPayload[TPayload](Guid refresherGuid, IEnumerable1 payloads) at Umbraco.Extensions.DistributedCacheExtensions.RefreshContentTypeCache(DistributedCache dc, ContentTypeChange1[] changes) at Umbraco.Deploy.Infrastructure.DeployScopedNotificationPublisher.HandleNotifications() at Umbraco.Deploy.Infrastructure.DeployScopedNotificationPublisher.ScopeExit(Boolean completed) at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)`

Something strange is that I coudn't find any urls working with the node id: 18835 that is in this panic exception

I tried /umbraco#/settings/mediaTypes/edit/18835, /umbraco#/settings/dataTypes/edit/18835 etc... on all possible types.

Snippet of the permission I need to remove and add back again: image

Snippet of failing deploy, the same happened in both dev and stage: image

This issue also happens if a new dev is initializing the repo from scratch on their local machine.

hfloyd commented 1 year ago

I am seeing the same type of error message. I am working on migrating an Umbraco Cloud v7 site to v10. I used SQL Management Studio to connect to the remote DB, made a bacpac, restored it locally, ran through the various version upgrades (8, 10) and now the v10 site loads up fine, but when I try to run "Update Umbraco Schema From Data Files" on my local setup (to make sure all new v10 DataTypes are sync'd properly from the v10 Cloud site), I am getting that same type of message:

{
  "Date": "2023-04-25T13:10:39.1716179-04:00",
  "Message": "failed to get child with id=4748",
  "Ex": {
    "ClassName": "Umbraco.Cms.Core.Exceptions.PanicException",
    "Message": "failed to get child with id=4748",
    "Data": null,
    "InnerException": null,
    "HelpURL": null,
    "StackTraceString": "   at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.GetRequiredLinkedNode(Int32 id, String description, Nullable`1 gen)\r\n   
    at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.ClearBranchLocked(ContentNode content)\r\n   
    at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.ClearBranchLocked(ContentNode content)\r\n   
    at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.UpdateContentTypesLocked(IReadOnlyCollection`1 removedIds, IReadOnlyCollection`1 refreshedTypes, IReadOnlyCollection`1 kits)\r\n
    at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.RefreshMediaTypesLocked(List`1 removedIds, List`1 refreshedIds, List`1 otherIds, List`1 newIds)\r\n
    at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.Notify[T](ContentStore store, JsonPayload[] payloads, Action`4 action)\r\n
    at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.Notify(JsonPayload[] payloads)\r\n
    at Umbraco.Cms.Core.Cache.ContentTypeCacheRefresher.<>c__DisplayClass11_0.<Refresh>b__6()\r\n
    at Umbraco.Extensions.PublishedModelFactoryExtensions.WithSafeLiveFactoryReset(IPublishedModelFactory factory, Action action)\r\n
    at Umbraco.Cms.Core.Cache.ContentTypeCacheRefresher.Refresh(JsonPayload[] payloads)\r\n
    at Umbraco.Cms.Infrastructure.Sync.ServerMessengerBase.DeliverLocal[TPayload](ICacheRefresher refresher, TPayload[] payload)\r\n
    at Umbraco.Cms.Infrastructure.Sync.ServerMessengerBase.Deliver[TPayload](ICacheRefresher refresher, TPayload[] payload)\r\n
    at Umbraco.Cms.Core.Cache.DistributedCache.RefreshByPayload[TPayload](Guid refresherGuid, IEnumerable`1 payloads)\r\n
    at Umbraco.Extensions.DistributedCacheExtensions.RefreshContentTypeCache(DistributedCache dc, ContentTypeChange`1[] changes)\r\n
    at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)\r\n
    at Umbraco.Deploy.Infrastructure.DeployScopedNotificationPublisher.HandleNotifications()\r\n
    at Umbraco.Deploy.Infrastructure.DeployScopedNotificationPublisher.ScopeExit(Boolean completed)\r\n
    at Umbraco.Cms.Infrastructure.Scoping.Scope.TryFinally(Action[] actions)",
    "RemoteStackTraceString": null,

    "RemoteStackIndex": 0,
    "ExceptionMethod": null,
    "HResult": -2146233088,
    "Source": "Umbraco.PublishedCache.NuCache",
    "WatsonBuckets": null
  },
  "Sender": "Umbraco.Deploy.Infrastructure.Work.WorkItems.DiskReadWorkItem"
}

I tried ALL the options under "Published Status", and also rebuilt the indexes, in case it was some weird Examine thing....

I was still getting the error, though.

After reading @jomehmet 's report here, I went to the "Folder" Media Type and removed all the other media types from the "permissions" tab. I saved it, and the ran "Update Umbraco Schema From Data Files" and it completed. I then re-added all the media types to the folder again, and then ran "Update Umbraco Schema From Data Files" and it completed again successfully.

So, a strange issue, but this workaround helped.

tormnator commented 1 year ago

@hfloyd Interesting! I've been also struggling with the same deployment error for the last couple hours. First, images in the Development environment didn't show. That was resolved by rebooting the env. Then the deploy from Development to Live failed with Umbraco.Cms.Core.Exceptions.PanicException "failed to get child with id=1787". After fiddling and Googling I found this issue, and that gave me the idea. I had changed the Description property on the Folder media type earlier today, and now I went into that media type, removed one of the allowed child types ("File"), saved, re-added it, and saved again. Now I went to Settings, Deploy and triggered "Update Umbraco Schema" again. This time it succeeded.

tormnator commented 8 months ago

I had the same situation happen again today, except this time the deploy error happened on the Development environment after a push and deploy from my Local env. I tried two workarounds to see if they would fix the issue, the first one was just to make a change to a Folder media type's description, and the second one was to do the same thing as in my previous comment above (remove/readd of an allowed media type). The steps did fix the "failed to get child" error, but unfortunately, due to UI issues in the deploy dashboard (see https://github.com/umbraco/Umbraco.Deploy.Issues/issues/196), I'm not sure which of the two workarounds made the difference.

I took a closer look at the relevant source code and I can't see any bugs in the code in the exception call stack, and I can't see that the issue occurs from "user error" (me) either. Instead it does seem to be an issue with the NuCache not staying in sync with "reality", and since none of the Reload/Rebuild/Collect actions in the Published Status dashboard seem to work, this indicates that the NuCache somehow isn't being completely rebuilt until you force it by making the necessary changes to your Content/Media Types.

tormnator commented 8 months ago

On second thought, it is possible that one of the Reload/Rebuild/Collect actions fixed the issue, and that the deploy dashboard's status made me think they didn't fix it because the status didn't reflect a possible deploy operation taking much longer time and the status not showing this.

hfloyd commented 5 months ago

I just came across this same issue again today on an Umbraco Cloud site: Umbraco 10.8.4, Deploy 10.3.3

Doing the "Memory Cache --> Reload" did NOT allow the Deploy to complete. Doing the "Database Cache --> Rebuild" did NOT allow the Deploy to complete. Doing "Internals --> Collect" did NOT fix it either.

So, as the old standby - I went to the Media Type "Folder", removed permissions for all Media Types, and Saved. After that, I was able to successfully run "Update Umbraco Schema".

Then I went back and re-added Media Types to Folder permissions, and Saved. I was able to successfully run "Update Umbraco Schema" again.

@Migaroez (https://github.com/umbraco/Umbraco-CMS/issues/15569#issuecomment-1916543746) mentioned that HQ was able to reproduce the error.

Zhaph commented 1 month ago

Apparently we've also been able to work around this by supressing the cache notifications as a temp fix:

https://docs.umbraco.com/umbraco-deploy/getting-started/deploy-settings#suppresscacherefreshernotifications