pnp / modernization

All modernization tooling and guidance
http://aka.ms/sppnp-modernize
MIT License
156 stars 86 forks source link

Error is 'asp' is an undeclared prefix when migrating publishing pages from SP2013 to SPO #267

Closed jansenbe closed 5 years ago

jansenbe commented 5 years ago

Log output of the failed request.

Modernisation Summary Report

Date Duration Source Page Target Page Url Status
9/9/2019 11:03:06 PM 00:00:06 /dept/opa/pages/default.aspx []() A issue prevented successful transformation

Warnings during transformation

Date Source Page Operation Message
9/9/2019 11:03:06 PM /dept/opa/pages/default.aspx Input Validation Keep Specific Permissions was set, however this is not currently supported when contexts are cross-farm/tenant - this feature has been disabled

Critical Errors during transformation

9/9/2019 11:03:12 PM - /dept/opa/pages/default.aspx

'asp' is an undeclared prefix. Line 82, position 2. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node) at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup() at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.LoadXml(String xml) at SharePointPnP.Modernization.Framework.Pages.BasePage.LoadPublishingPageFromWebServices(String fullUrl) at SharePointPnP.Modernization.Framework.Pages.PublishingPageOnPremises.Analyze(PageLayout publishingPageTransformationModel) at SharePointPnP.Modernization.Framework.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)

Individual Page details

Transformation Details: /dept/opa/pages/default.aspx

Page Transformation Settings

Property Setting
Overwrite False
Target Page Name
Keep Page Specific Permissions True
Remove Empty Sections And Columns True
Handle Wiki Images And Videos True
Add Table List Image As Image Web Part False
Publish Created Page True
Disable Page Comments False
Skip Url Rewrite False
Skip Default Url Rewrite False
Url Mapping File
Skip Telemetry False

Transformation Operation Details

Date Operation Actions Performed
9/9/2019 11:03:06 PM Input Validation Keep Specific Permissions was set, however this is not currently supported when contexts are cross-farm/tenant - this feature has been disabled
9/9/2019 11:03:06 PM Input Validation Validation checks complete
9/9/2019 11:03:06 PM SharePoint Connection Loading client context objects
9/9/2019 11:03:07 PM SharePoint Connection Loading target client context object
9/9/2019 11:03:07 PM Page Creation Detect if the page is living inside a folder
9/9/2019 11:03:07 PM Page Creation In Cross-Site transform mode the original source file name is used
9/9/2019 11:03:07 PM Page Creation Just try to load the page in the fastest possible manner, we only want to see if the page exists or not
9/9/2019 11:03:08 PM Load Page does not exist in current web
9/9/2019 11:03:08 PM Page Creation Checking Page Exists
9/9/2019 11:03:08 PM Page Creation Modern page created
9/9/2019 11:03:08 PM Article page handling Transforming source page as Article page
9/9/2019 11:03:08 PM Article page handling Recognized source page as a Publishing Page. - Analyzing web parts and page layouts
9/9/2019 11:03:08 PM Page Layout Manager Page uses xxxx as page layout, mapping that will be used is xxxx
jansenbe commented 5 years ago

@pkbullock : was looking at LoadPublishingPageFromWebServices and as things go wrong when parsing the page file for web part properties, more specifically because the "cleaning" work did not result in valid XML.

I was wondering why we don't use the AngleSharp HtmlParser instead, the document was already loaded in there and we could retrieve all WebPartContent/WebPart nodes that way...this would possibly avoid the XML issues.

This is just an observation, did not test this and maybe there's a specific reason for the current approach that I'm not aware of.

pkbullock commented 5 years ago

@jansenbe I did start to look at using AngleSharp initially, but had problems where HTML/XML mixture was causing issues with node crawling and encoding (if i remember), AngleSharp does support XML but because we are using version 0.9 of AngleSharp, the XML module isn't supported, at the time, i felt the code change was too great but perhaps should have discussed this with you.

There are points in the code that are smelly, i don't particular like my approach. I will patch for now, and revisit this after.

jansenbe commented 5 years ago

Thx @pkbullock : do you have time to handle this before the October release?

pkbullock commented 5 years ago

@jansenbe in a peak but hopefully will be clear after this weekend or sooner. Client Intranet went live weekend just gone so clearing the sawdust. ☺️

pkbullock commented 5 years ago

@jansenbe how did the above get produced btw? Think might seen a reference in another ticket to web part in wiki page?

jansenbe commented 5 years ago

It was referenced in #234, but I moved it over here as it was something different than the original issue

pkbullock commented 5 years ago

@gautamdsheth i suspect just need to add "asp" to list of prefixes because its the built in asp.net prefix. The rest are dynamically determined by the assembly references at the top of the page. If i remember custom controls need to be referenced in the header.

gautamdsheth commented 5 years ago

hey @pkbullock , the issue is coming from the OOTB dataform webpart. Not sure how to fix it. When reaching this line, it throws the error:

https://github.com/SharePoint/sp-dev-modernization/blob/95c17776761479808ed77000e79dd2b373e30161/Tools/SharePoint.Modernization/SharePointPnP.Modernization.Framework/Pages/BasePage.cs#L1041

Have attached the generated xml, the issue occurs when reaching this section:

<asp:Parameter DefaultValue="{134230eb-f079-4802-8e4d-d26529454f70}" Name="ListID"></asp:Parameter>

webpartxml.txt

pkbullock commented 5 years ago

@gautamdsheth thank you for this, it is very useful in reproduction steps. I just need to add a step to either declare the prefix or remove it from Xml parsing. I will submit PR for this.

pkbullock commented 5 years ago

Hi both,

been investigating this one, i am not sure its worth fixing, i cannot reproduce this easily, for example not able to create a data form web part on Publishing Page in 2013 in the pages library, SharePoint Designer doesn't allow me to do that, possibly a remnant from a previous migration .

In addition, there is no web part modern option for this - https://github.com/SharePoint/sp-dev-modernization/blob/master/Tools/SharePoint.Modernization/SharePointPnP.Modernization.Framework/Nuget/webpartmapping.xml#L748

Granted its a bug in the XML parsing with 'asp' but that a ASP.NET prefix and perhaps, i should just do something dirty by removing the prefix, we cannot do anything with the tag. We just need it not to blow up the page.

Thoughts?

jansenbe commented 5 years ago

Hi @pkbullock , @gautamdsheth ,

DataForm web part is from 2010 timeframe and has most likely just survived the migrations. We indeed can't migrate that one but that same page hosting this web part most likely will also contain other content/webparts that can be migrated. Having a fix that prevents this page from failing is something we need to enable that scenario. Ideally we at least see there's a DataForm web part, not having it's properties is fine.

pkbullock commented 5 years ago

Sorry! looking back my response wasn't the right attitude to this problem, i will get on and fix this soon submit a PR.

jansenbe commented 5 years ago

@pkbullock , thanks for your PR, I've just merged it.

@gautamdsheth / @krishnachaluvadi : this will be part of the upcoming October release. Alternatively you need to build from our dev branch (like @gautamdsheth already has been doing for testing things).

TroyHostetter commented 4 years ago

Question .. we are seeing this on a migration and rather than "asp" we are seeing "spssvc". Do you know of a way to get around this error? Is there anything we can do to the source page layout to permit the page to migrate without the error? Any other work around suggestions?