umbraco / Umbraco.Deploy.Issues

1 stars 0 forks source link

Umbraco allows composition setup but Deploy fails #127

Open FransdeJong opened 2 years ago

FransdeJong commented 2 years ago

Umbraco 8.18.4 Deploy 4.6

I haven't found out exactly where this goes wrong but I get the following error:

EXCEPTION
Umbraco.Deploy.Exceptions.ProcessArtifactException: Process pass #2 failed for artifact umb://document-type/1b19a68535f44d0fa403444be6290c45. ---> Umbraco.Core.Exceptions.InvalidCompositionException: Content type with alias 'contentBase' has an invalid composition. Property groups with the same alias must also have the same type across all compositions, these aliases have different types: content.
   at Umbraco.Core.Services.Implement.ContentTypeServiceBase`3.ValidateLocked(TItem compositionContentType)
   at Umbraco.Core.Services.Implement.ContentTypeServiceBase`3.Save(TItem item, Int32 userId)
   at Umbraco.Deploy.Connectors.ServiceConnectors.ContentTypeConnector.ContentTypeConnectorBase`2.Process(DeployState state, IDeployContext context, Int32 pass)
   at Umbraco.Deploy.Environments.CurrentEnvironment.ProcessArtifacts(IEnumerable`1 arts, IDeployContext context, CancellationToken token)
   --- End of inner exception stack trace ---
   at Umbraco.Deploy.Environments.CurrentEnvironment.ProcessArtifacts(IEnumerable`1 arts, IDeployContext context, CancellationToken token)
   at Umbraco.Deploy.Environments.CurrentEnvironment.ProcessPackageAsync(Guid sessionId, Package package, CancellationToken token)
   at Umbraco.Deploy.Work.WorkItems.DiskReadWorkItem.<Proceed>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Umbraco.Deploy.Work.WorkItems.DiskReadWorkItem.<ExecuteAsyncSub>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Umbraco.Deploy.Work.WorkItems.DiskReadWorkItem.<ExecuteAsync>d__15.MoveNext()

It looks like it has to do with adding content to a group created on a composition.

I have a composition called baseContent with a few properties in a tab without a group. On a doctype using this composition I add a few properties to that tab. Umbraco allows it without issues but deploy breaks.

I expect Deploy to allow it since it is possible in Umbraco and it is how compositions should work? At least we are using them like this since V7. The way it behaves now means I can't add properties to a tab created in a composition. Or I am missing something...


_This item has been added to our backlog AB#32763_

FransdeJong commented 2 years ago

It seems to be kind of related to this issue: https://github.com/umbraco/Umbraco-CMS/issues/11202

But still, I got it to work in Umbraco so it should allow it or it shouldn't be allowed in Umbraco.

FransdeJong commented 2 years ago

While solving this issue is seems the conclusion is that deploy doesn't allow adding items to a tab that is inherited from a composition. This is a issue since that is how compositions are used..

FransdeJong commented 2 years ago

And finally I think I found what the exact issue is.

I made the exact same changes on live, deleted my local project and restored from live. Now deploy allowed the compositions. There seems to be a issue in the order Deploy handles changes in the compositions that block changing them all.

For example: I have a composition called Banner. It has a property named banner image in a group called Banner. I have a documenttype using this composition and it had a property Banner text inside the group called banner.

I changed the composition to use a tab called Banner and removed the banner group. On the documenttype using it I moved banner text in that same tab and removed the group as well. This blocks Deploy since it seems to think the groups are still there.

@AndyButland Does this description make any sense to you? Otherwise I'll try to make it more clear.

AndyButland commented 2 years ago

Hi @FransdeJong - was just taking a look at this this morning. The description is clear but I'm running into a CMS issue trying to setup the scenario you outline.

Firstly though, from the comment above:

the conclusion is that deploy doesn't allow adding items to a tab that is inherited from a composition. This is a issue since that is how compositions are used..

This seems to be OK. I've created both of these from scratch in a local environment...

... and deployed them upstream without problems.

From your last comment though it seems you have found an issue that occurs when you create the former (i.e. using a group) and then convert it into the latter (using a tab).

And that's the bit I can't replicate, when I try to edit the composition I:

I can avoid this error only if I first delete the document type that uses the composition. Then I can save the changes, and if I deploy them, they are transferred upstream correctly.

Can you see what I'm doing different to you please?

LennardF1989 commented 12 months ago

Any update on this? This is still present in v12 if you have a composition adding properties to the Generic tab (in a group), while the document types it's applied to also adds groups to the generic tab. Umbraco is fine with it, Deploy isn't (on import, not on export).

AndyButland commented 12 months ago

Nothing further as I wasn't able to replicate the issue following the last discussion on it. Will have another look as you seem to have been able to describe how to demonstrate the problem.

LennardF1989 commented 12 months ago

Okay, I investigated this a bit and found out one of my colleagues did the following:

Somehow this merged with the default "Generic" tab Umbraco has (which probably also uses the "general" alias internally).

I fixed this moving the propertygroup out of the tab, removing the home-made General-tab then dragging the property group back to the umbraco-provided Generic tab. I've attached the UDA's from before and after. UDA.zip

This may or may not be a bug in Umbraco, rather.

AndyButland commented 11 months ago

Still having trouble seeing the problem I'm afraid. I've tried on Umbraco 8 (which is where the original issues was reported) and Umbraco 12, and both I can create a document type that's as described:

image

And transfer that between environments correctly.

I also took the old.uda you shared. Made one small change which was to remove the document type container reference. And then tried to import in into an environment. And that seemed OK too:

image

Maybe you can spot from the screenshots and/or description above if I'm doing something different compared to what you have found?