function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pavan Dave 22Pavan Dave 22 

Cannot add component of type:null named:null subjectId:m0G53000000FDbY to this package because it is an installed component in another package with packageId:033XXXXXXXXXX

============
Problem (Packaging Issue)
============
Deployment error while package upgrade

Cannot add component of type:null named:null subjectId:m0G53000000FDbY to this package because it is an installed component in another package with packageId:0335p000000g8PW.
package.xml: Cannot add component of type:null named:nul


============
Steps to reproduce
============
1. package "Pacakge 1" is already installed/upgraded on the org
2. Now trying to install/upgrade the package "Package 2" on the same org
3. But I am getting deploy error mentioned above

Note - Both packages belongs to same namespace.

============
Actual Behaviour 
============
I am NOT able to upgrade the package "Pacakge 2" on the org where "Pacakge 1" is already install/upgraded 

============
Expected Behaviour 
============
I should be able to upgrade the package "Pacakge 2" on the org where "Pacakge 1" is already install/upgraded 

============
Root cause 
============
1. One custom metadata type record (Trigger_Setting.Default_Record) was present on Package 1 and now it is also present on Pacakge 2 as well
2. Hence now it's not allowing the Package 2 to be upgraded on the org

============
Steps already tried to resolve - 
============
1. Tried to activate feature to remove the metadata from 2GP but still cannot remove custom metadata type record

2. Since custom metadata type records are not supported to be removed as per this https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_remove_md_components.htm

============
Dead lock
============
1. The blocker is that Salesforce do not allow to remove the custom metadata type record from the package. 
2. So now how to upgrade Package 2 on the subscriber org? 
HarshHarsh (Salesforce Developers)