2

Has anyone ever experienced this error below on a Content Porter import before?

After a successful export, I have been able to identify that these are component and/or schema specific, for example, I get the error on just one component within the entire folder I am working in that contains 50 other items, this is how I drilled down to the specific component with a specific schema throwing this error on import

I can also open, save and close, publish the component correctly from the CM I exported out of and see no visible explanations of why it would have this error associated with it.

I think it is somehow schema related, but everything is working fine in our lower environments. This is the 1st CP into a new TCM with this environment setup.

[Error] System.Xml.XPath.XPathException: Namespace prefix 'ns2' is not defined. 
  at MS.Internal.Xml.XPath.CompiledXpathExpr.UndefinedXsltContext.LookupNamespace(String prefix)
  at MS.Internal.Xml.XPath.BaseAxisQuery.SetXsltContext(XsltContext context)
  at MS.Internal.Xml.XPath.FilterQuery.SetXsltContext(XsltContext input)
  at MS.Internal.Xml.XPath.MergeFilterQuery.SetXsltContext(XsltContext xsltContext)
  at MS.Internal.Xml.XPath.CompiledXpathExpr.SetContext(IXmlNamespaceResolver nsResolver)
  at System.Xml.XmlNode.SelectSingleNode(String xpath, XmlNamespaceManager nsmgr)
  at Tridion.ContentManager.ImportExport.ImportItemPreProcessor2013.PatchXLinks(IdentifiableObjectData item, PackageItem packageItem, IEnumerable`1 cutDependencies)
  at Tridion.ContentManager.ImportExport.ImportItemPreProcessor2013.ConvertToDataObject(PackageItem packageItem, IEnumerable`1 dependenciesToCut)
  at Tridion.ContentManager.ImportExport.ImportItemPreProcessor.GetDataObject(PackageItem packageItem, IEnumerable`1 dependenciesToCut, ImportAction action)
  at Tridion.ContentManager.ImportExport.AbortErrorHandler.Invoke[T](Func`2 function, LocalizableMessage message, Boolean retryAvailable, Boolean isCritical, UserReply additionalUserReplyOptions)
  at Tridion.ContentManager.ImportExport.Importer.GetImportItemData(WebDavUrl exportUrl, Dictionary`2 unresolvedDependencies, PackageItem packageItem, ImportAction importAction)
  at Tridion.ContentManager.ImportExport.Importer.ImportItem(WebDavUrl exportUrl, IList`1 dependentItemsChain, Dictionary`2 unresolvedDependencies, Boolean specialImport)
  at Tridion.ContentManager.ImportExport.Importer.ImportItems(IList`1 items, Boolean specialGroupImport)
  at Tridion.ContentManager.ImportExport.Importer.Import(String packageName)
2015/04/22 15:32:56  [Information] Transactional import failed at 4/22/2015 3:32:56 PM. No changes were committed to Tridion Content Manager.

I also notice that within the environment I am exporting from, the component when I view source contains all namespaces, whereas, the TCM I have done the import into, only contains one namespace for all components I open and check source on - below are just 2 examples had to remove opening tags on xml

Module xmlns="http://abc.xxxxx.com/example/somename/Module" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ns3="http://www.tridion.com/ContentManager/5.0/Instance">
Module xmlns="http://abc.xxxxx.com/example/somename/Module">
  • Do you get the same error when you import back to the same from which export package was generated? I may be wrong or totally unrelated, but I had similar issues in past which may be because of the 1) name of the schema which might have special characters 2) or some hot fixes/patches missing in the destination environment. – Harish A Apr 24 '15 at 4:39
4

After a lot of content porting with the same error, I watched what specific items would import successfully, and from there I knew it was related to a specific component type that was based upon a specific schema. So with that understanding, and looking into the .xml export files, I remember the person who created the schemas changed the namespaces to reflect best practice to be http://mycomany/schemas/myfolderschema @EricHuiza outlined here.

In the same article within the answer of the SE thread above, I noticed what @NunoLinhares said in his answer about: You do have to be careful when changing namespaces on a schema that is already in use, as this will invalidate existing content (content will not be valid according to schema).

So I looked the whole way back to our Dev environment where the schemas were 1st created, did a version history, compared versions with each other and wahlah, the person who initially created the schemas went back and changed the namespace to http://mycomany/schemas/myfolderschema from a uuid:123 after content was migrated via Core Services, hence the namespace throwing an error on all components associated with that schema and even dependencies of it..

enter image description here

One thing I have learned with Content Porter is that it exposes anything wrong with your implementation.. Some people hate CP, but I think I love it :)

  • 2
    That last sentence is gold. I think you're my new hero. – Nuno Linhares Apr 27 '15 at 13:31
1

It would appear that the schemas are not identical between your exporting and importing environments. How this has happened should be a matter of further investigation (to prevent future similar issues) but a solution could be to also export the schema in content porter and importing the schema first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.