Resolve BND-500 unknown namespace prefix errors during Content Copy in AEM as a Cloud Service
This article explains how to resolve failures in the Content Copy tool in Adobe Experience Manager as a Cloud Service when the process is interrupted by a BND-500 error due to unregistered namespace prefixes in content properties.
Description description
Environment
Adobe Experience Manager as a Cloud Service Author environments using Content Copy
Issue/Symptoms
- Content Copy fails during export and reports
BND-500: Unknown namespace prefix in export request. - The error identifies a namespace prefix, such as
ns4_1_, that is not registered in the source repository.
Cause
Content Copy cannot export a property whose namespace prefix is not registered in the source repository. A prefix must map to the correct namespace URI. Confirm that mapping before registering a prefix or changing properties that use it.
Resolution resolution
Follow the steps below to resolve the issue:
-
Identify the affected content by scanning the repository for properties whose names begin with the unregistered prefix, such as
ns4_1_. Focus on the content paths that you plan to copy, such as/contentand/content/dam. -
If ACS AEM Commons Groovy Console is available in a non-production environment, use it to run a script that traverses the relevant content subtree and identifies nodes that contain properties with the unregistered prefix.
-
If Groovy Console is not available, work with the development team to create a custom OSGi service or utility that iterates through the content and logs property names that begin with the problematic prefix.
-
Determine whether the unregistered prefix should be removed or registered. If the prefix is not required, which is the most common scenario, plan to remove all properties whose names begin with the unregistered prefix from the affected content. If the prefix is required by the application, register it in the namespace registry by using a repo-init or CND definition in the codebase.
-
Implement the selected approach. To remove the properties, run a Groovy or Java script in a lower environment to delete properties that use the unregistered prefix from the relevant content paths. Validate the changes and then promote the solution to higher environments through the standard deployment process.
-
To register the namespace, add a repo-init or CND definition to the codebase. For example:
code language-none Repo-init: register namespace ("ns4_1_", "http://your/namespace/uri")code language-none CND: [ add appropriate definition] -
Deploy the namespace registration changes through the Cloud Manager pipeline.
-
After completing the property cleanup or namespace registration, run the Content Copy operation again.
-
Verify that the Content Copy operation completes successfully and that the namespace-related error no longer occurs.