pnp / pnpframework

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions
https://pnp.github.io/pnpframework/
MIT License
205 stars 142 forks source link

ConvertTo-PnPPage transformation error: Asset was not transferred. Asset: /_layouts/15/images/icpdf.png #621

Open baharehesf opened 2 years ago

baharehesf commented 2 years ago

Hi everyone,

I have transformation project: SharePoint Online (Classic) to modern (Publishing pages). I use PnP PowerShell to transform. I got critical error as below:

Date Source Page Operation Message
2022-03-11 5:04:36 PM /en-ca/Pages/*****/048378.aspx Asset Transfer Asset was not transferred. Asset: /_layouts/15/images/icpdf.png
2022-03-11 5:04:37 PM /en-ca/Pages/*****/048378.aspx Asset Transfer Asset was not transferred. Asset: /_layouts/15/images/icpdf.png
2022-03-11 5:04:37 PM /en-ca/Pages/*****/048378.aspx Asset Transfer Asset was not transferred. Asset: /_layouts/15/images/icxlsx.png
2022-03-11 5:04:37 PM /en-ca/Pages/*****/048378.aspx Asset Transfer Asset was not transferred. Asset: /_layouts/images/icxlsx.png

Critical Errors during transformation

_'0x0A' is invalid within a JSON string. The string should be correctly escaped. Path: $ | LineNumber: 0 | BytePositionInLine: 86. at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, JsonReaderException ex) at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack) at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader) at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at PnP.Core.Model.SharePoint.PageWebPart.setPropertiesJson(String value) at PnP.Framework.Modernization.Transform.ContentTransformator.Transform(List`1 webParts) at PnP.Framework.Modernization.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)

Individual Page details

Transformation Details: /en-ca/Pages/****/048378.aspx

Page Transformation Settings

Property Setting
Engine version 1.8.3.0
Overwrite True
Target Page Name
Target Page Folder
Target Page Folder Overrides Default Folder False
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 True
Keep Page Creation Modification Information True
Publish Created Page True
Post As News False
Disable Page Comments False
Skip Url Rewrite False
Skip Default Url Rewrite False
Url Mapping File
Skip Hidden Web Parts False
Term Mapping File
Skip Term Store Mapping False
Skip User Mapping False
User Mapping File
L D A P Connection String
Skip Telemetry False

2022-03-11 5:04:36 PM | Adding Web Parts to Target Page | Added 'Client Side Text Web Part' to target page 2022-03-11 5:04:36 PM | Web Part Mapping | Web Part:'Image in wiki text' of type 'SharePointPnP.Modernization.WikiImagePart' is being transformed 2022-03-11 5:04:36 PM | Web Part Mapping | Processing selector functions 2022-03-11 5:04:36 PM | Asset Transfer | Asset was not transferred. Asset: /_layouts/15/images/icpdf.png 2022-03-11 5:04:36 PM | Web Part Mapping | Combining mapping data 2022-03-11 5:04:36 PM | Adding Web Parts to Target Page | Using 'Image' modern web part 2022-03-11 5:04:36 PM | Adding Web Parts to Target Page | Added 'Image' Client Side Web Part to target page 2022-03-11 5:04:36 PM | Web Part Mapping | Web Part:'Image in wiki text' of type 'SharePointPnP.Modernization.WikiImagePart' is being transformed 2022-03-11 5:04:36 PM | Web Part Mapping | Processing selector functions 2022-03-11 5:04:37 PM | Web Part Mapping | Combining mapping data 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Using 'Image' modern web part 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Added 'Image' Client Side Web Part to target page 2022-03-11 5:04:37 PM | Web Part Mapping | Web Part:'Image in wiki text' of type 'SharePointPnP.Modernization.WikiImagePart' is being transformed 2022-03-11 5:04:37 PM | Web Part Mapping | Processing selector functions 2022-03-11 5:04:37 PM | Asset Transfer | Asset was not transferred. Asset: /_layouts/15/images/icpdf.png 2022-03-11 5:04:37 PM | Web Part Mapping | Combining mapping data 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Using 'Image' modern web part 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Added 'Image' Client Side Web Part to target page 2022-03-11 5:04:37 PM | Web Part Mapping | Web Part:'Image in wiki text' of type 'SharePointPnP.Modernization.WikiImagePart' is being transformed 2022-03-11 5:04:37 PM | Web Part Mapping | Processing selector functions 2022-03-11 5:04:37 PM | Web Part Mapping | Combining mapping data 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Using 'Image' modern web part 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Added 'Image' Client Side Web Part to target page 2022-03-11 5:04:37 PM | Web Part Mapping | Web Part:'Image in wiki text' of type 'SharePointPnP.Modernization.WikiImagePart' is being transformed 2022-03-11 5:04:37 PM | Web Part Mapping | Processing selector functions 2022-03-11 5:04:37 PM | Asset Transfer | Asset was not transferred. Asset: /_layouts/15/images/icxlsx.png 2022-03-11 5:04:37 PM | Web Part Mapping | Combining mapping data 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Using 'Image' modern web part 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Added 'Image' Client Side Web Part to target page 2022-03-11 5:04:37 PM | Web Part Mapping | Web Part:'Image in wiki text' of type 'SharePointPnP.Modernization.WikiImagePart' is being transformed 2022-03-11 5:04:37 PM | Web Part Mapping | Processing selector functions 2022-03-11 5:04:37 PM | Asset Transfer | Asset was not transferred. Asset: /_layouts/images/icxlsx.png 2022-03-11 5:04:37 PM | Web Part Mapping | Combining mapping data 2022-03-11 5:04:37 PM | Adding Web Parts to Target Page | Using 'Image' modern web part

Anybody has experience on it? @pkbullock @jansenbe

jansenbe commented 2 years ago

@baharehesf : this issue seems to be related to a special character in the page html content (see https://github.com/pnp/pnpframework/issues/311) or Azure FrontDoor that rewrites the image url (see https://github.com/pnp/pnpframework/issues/592). Can you cross check these and see if they fix your issue?

baharehesf commented 2 years ago

@jansenbe I removed all the "0x0A" from HTML source manually, the page was transformed successfully. I have more than 40,000 pages, my question is how to do it automatically?