在1GP软件包创建期间,从包装组织中删除元数据对象的错误

发布于 2025-02-01 10:26:26 字数 4929 浏览 1 评论 0 原文

我正在尝试使用[cumulusci] [1]创建一个1GP软件包,作为工作流程的一部分,如果代码中不存在,则有一个步骤“ deploy_packaging.uninstall_packaged_incremental”,它从包装org中删除元数据。在包装组织中,该组织有权删除元数据。 过去,我从同一包装组织发布了1GP包装,但是现在我面临删除元数据的问题。

我的错误是以下内容。如何克服此错误?有什么想法吗?

我正在考虑允许从包装组织中删除包装组件。我可以在存在的组织中看到过时的自定义元数据,当我尝试删除它是在我单击删除时键入“是”的,它告诉我我无法删除托管托管的软件包组件。

[05/26/22 10:15:01] Deleting metadata:                                                                                                                                         
                        CustomField: One_Degree_Attribute_Setting__mdt.Active__c                                                                                               
                        CustomField: One_Degree_Attribute_Setting__mdt.Attribute_Tag__c                                                                                        
                        CustomField: One_Degree_Attribute_Setting__mdt.Last_Run_Datetime__c                                                                                    
                        CustomField: One_Degree_Zipcode_Search__mdt.Zipcode__c                                                                                                 
                        CustomField: One_Degree_Zipcode_Search__mdt.lat__c                                                                                                     
                        CustomField: One_Degree_Zipcode_Search__mdt.long__c                                                                                                    
                        CustomMetadata: One_Degree_Attribute_Setting.health_clinic                                                                                             
                        CustomMetadata: One_Degree_Zipcode_Search.X94118                                                                                                       
                        CustomObject: One_Degree_Attribute_Setting__mdt                                                                                                        
                        CustomObject: One_Degree_Zipcode_Search__mdt                                                                                                           
                        Layout: One_Degree_Attribute_Setting__mdt-One Degree Attribute Setting Layout                                                                          
                        Layout: One_Degree_Zipcode_Search__mdt-One Degree Zipcode Search Layout                                                                                
                    Deleting metadata in package OneDegree from target org                                                                                                     
                    Pending                                                                                                                                                    
[05/26/22 10:15:02] [Pending]: next check in 1 seconds                                                                                                                         
[05/26/22 10:15:03] [Pending]: next check in 1 seconds                                                                                                                         
[05/26/22 10:15:04] [Pending]: next check in 2 seconds                                                                                                                         
[05/26/22 10:15:06] [Done]                                                                                                                                                     
[05/26/22 10:15:08] [Failed]: Update of CustomMetadata One_Degree_Attribute_Setting.health_clinic: Error: Cannot delete managed object                                         
                                                                                                                                                                               
                    Update of CustomField One_Degree_Attribute_Setting__mdt.Last_Run_Datetime__c: Error: Cannot delete managed object                                          
                                                                                                                                                                               
                    Update of CustomField One_Degree_Attribute_Setting__mdt.Active__c: Error: Cannot delete managed object                                                     
                                                                                                                                                                               
                    Update of CustomField One_Degree_Zipcode_Search__mdt.long__c: Error: Cannot delete managed object  


  [1]: https://cumulusci.readthedocs.io/en/stable/managed_package.html

I am trying to create a 1GP package using [cumulusci][1] as part of workflow there is a step "deploy_packaging.uninstall_packaged_incremental" where it deletes metadata from the packaging org if it does not exist in the code. In the packaging org, the org has permission to delete metadata.
In the past I have released 1GP packages from the same packaging org, but now I am facing a problem with deleting metadata.

The error I am having is the following. How can I get past this error ? Any ideas ?

I am thinking permission to delete packaged components from the packaging org. I can see the stale custom metadata in the org that exists, when I am trying to delete it is prompting to type "Yes" when I am clicking delete, it is telling me I cannot delete managed package components.

[05/26/22 10:15:01] Deleting metadata:                                                                                                                                         
                        CustomField: One_Degree_Attribute_Setting__mdt.Active__c                                                                                               
                        CustomField: One_Degree_Attribute_Setting__mdt.Attribute_Tag__c                                                                                        
                        CustomField: One_Degree_Attribute_Setting__mdt.Last_Run_Datetime__c                                                                                    
                        CustomField: One_Degree_Zipcode_Search__mdt.Zipcode__c                                                                                                 
                        CustomField: One_Degree_Zipcode_Search__mdt.lat__c                                                                                                     
                        CustomField: One_Degree_Zipcode_Search__mdt.long__c                                                                                                    
                        CustomMetadata: One_Degree_Attribute_Setting.health_clinic                                                                                             
                        CustomMetadata: One_Degree_Zipcode_Search.X94118                                                                                                       
                        CustomObject: One_Degree_Attribute_Setting__mdt                                                                                                        
                        CustomObject: One_Degree_Zipcode_Search__mdt                                                                                                           
                        Layout: One_Degree_Attribute_Setting__mdt-One Degree Attribute Setting Layout                                                                          
                        Layout: One_Degree_Zipcode_Search__mdt-One Degree Zipcode Search Layout                                                                                
                    Deleting metadata in package OneDegree from target org                                                                                                     
                    Pending                                                                                                                                                    
[05/26/22 10:15:02] [Pending]: next check in 1 seconds                                                                                                                         
[05/26/22 10:15:03] [Pending]: next check in 1 seconds                                                                                                                         
[05/26/22 10:15:04] [Pending]: next check in 2 seconds                                                                                                                         
[05/26/22 10:15:06] [Done]                                                                                                                                                     
[05/26/22 10:15:08] [Failed]: Update of CustomMetadata One_Degree_Attribute_Setting.health_clinic: Error: Cannot delete managed object                                         
                                                                                                                                                                               
                    Update of CustomField One_Degree_Attribute_Setting__mdt.Last_Run_Datetime__c: Error: Cannot delete managed object                                          
                                                                                                                                                                               
                    Update of CustomField One_Degree_Attribute_Setting__mdt.Active__c: Error: Cannot delete managed object                                                     
                                                                                                                                                                               
                    Update of CustomField One_Degree_Zipcode_Search__mdt.long__c: Error: Cannot delete managed object  


  [1]: https://cumulusci.readthedocs.io/en/stable/managed_package.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

§普罗旺斯的薰衣草 2025-02-08 10:26:26

元数据API只是反映了试图删除这些字段时在组织包UI中遇到的可管理性规则。因此,在这种情况下,Cumulusci触发了正常工作的错误。

uninstall_packaged_incremental任务旨在确保您不会在您创建的软件包版本中使用陈旧的元数据(即包装org中的元数据)。如果由于某种原因它找到了陈旧的元数据并且无法将其删除,则它应该失败,因此您不会使用“损坏的”软件包版本。

不幸的是,在这种特殊情况下,您正在尝试删除CustomTadataType上的字段,而不是由托管包装的Guard Rails(可管理性规则)禁止的自定义对象。

  • sf.custommetadatatypes_req_managed_pkgs.htm&type=5" rel="nofollow noreferrer">https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_req_managed_pkgs.htm&type=5

Normally, you would需要从托管软件包中获取删除组件,将删除组件应用于您的包装org per

The Metadata API simply mirrors the manageability rules you're encountering in the org's package UI when trying to delete those fields. So, in this case CumulusCI is triggering the error which is working as expected.

The uninstall_packaged_incremental task is intended to ensure you don't wind up with stale metadata (i.e. metadata in the packaging org that's not in git) in the package version you're creating. If for some reason it finds stale metadata and can't delete it, it should fail so you don't wind up with a "corrupted" package version.

Unfortunately, in this particular case you're trying to delete fields on a CustomMetadataType rather than a CustomObject which appears to be prohibited by the guard rails (manageability rules) of managed packaging.

Normally, you would need to get the Delete Components from Managed Packages permission applied to your packaging org per https://help.salesforce.com/s/articleView?id=000326278&type=1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文