CumulusCI icon indicating copy to clipboard operation
CumulusCI copied to clipboard

uninstall_post is not substituting %%%NAMESPACE%%%

Open zenibako opened this issue 3 years ago • 2 comments

Describe the bug

When running the uninstall_post task, Salesforce throws an error UNKNOWN_EXCEPTION: Custom metadata type %%%NAMESPACE%%%[CUSTOM_METADATA_TYPE] is not available in this organization.

Presumably, this is because the uninstall_post task is not doing namespace replacements in package.xml or the metadata itself. Thedeploy_post task in the install_beta flow is successfully completing with the same unpackaged/post contents.

Samples below (brackets are used throughout for substitute text):

package.xml

...
    <types>
        <members>%%%NAMESPACE%%%[CUSTOM_METADATA_TYPE].[CUSTOM_METADATA_NAME]</members>
        <name>CustomMetadata</name>
    </types>
...

___NAMESPACE___[CUSTOM_METADATA_TYPE].[CUSTOM_METADATA_NAME].md

...
    <values>
        <field>%%%NAMESPACE%%%[FIELD_NAME]</field>
        <value xsi:type="xsd:string">[VALUE]</value>
    </values>
...

Reproduction steps

  1. Create an unpackaged/post folder with metadata that requires namespace labels (such as custom metadata).
  2. Run the deploy_post task on a non-namespaced org.
  3. Confirm the uninstall_post task is configured with managed: True and your namespace.
  4. Run the uninstall_post task on a non-namespaced org.

Your CumulusCI and Python versions

CumulusCI version: 3.53.0 (/Users/chandleranderson/.local/bin/cci) Python version: 3.10.1 (/Users/chandleranderson/.local/pipx/venvs/cumulusci/bin/python)

Operating System

macOS Monterey 12.2

Windows environment

No response

CumulusCI installation method

pipx

Error Gist

https://gist.github.com/zenibako/15470b7d5fe85d934c50d6dc5931310d

Additional information

No response

zenibako avatar Mar 01 '22 13:03 zenibako

Thanks for the report and detailed instructions on how to reproduce the issue.

From initial inspection it looks like the problem is probably that the task is trying to replace ___NAMESPACE___ within package.xml instead of %%%NAMESPACE%%%. I've filed a bug W-10774453 in our internal tracker.

davisagli avatar Mar 01 '22 14:03 davisagli

No problem! Thank you for the quick response.

zenibako avatar Mar 01 '22 15:03 zenibako