modernization: Failed to modernize page, Index out of range error

Category

[ ] Bug

Problem Area

[ ] Page Transformation: Error during the use of page transformation from PnP PowerShell

Expected or Desired Behavior

The page should be transformed to modern normally.

Observed Behavior

Transformation failed and Index out of range exception is thrown

Steps to Reproduce

I’m using PnP version 3.13.19 and running the sample powershell script of pages transformation and just changing the site URL and it throws the below error on the attached homepage:

ConvertTo-PnPClientSidePage : Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
At C:\Users\gmohamed\source\repos\SharePointOnline-Migration-Tool\PowerShell
Scripts\ModernizationScripts\ModernizingPages.ps1:27 char:27
+ ... odernPage = ConvertTo-PnPClientSidePage -Identity $page.FieldValues[" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [ConvertTo-PnPClientSidePage], ArgumentOutOfRangeException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.ClientSidePages.ConvertToClientSidePage

Get-PnPException output:

Message          : Index was out of range. Must be non-negative and less than the size of the collection.
                   Parameter name: index
Stacktrace       :    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument,
                   ExceptionResource resource)
                      at SharePointPnP.Modernization.Framework.Transform.ContentTransformator.LastColumnOrder(Int32
                   row, Int32 col)
                      at SharePointPnP.Modernization.Framework.Transform.ContentTransformator.Transform(List`1
                   webParts)
                      at SharePointPnP.Modernization.Framework.Transform.PageTransformator.Transform(PageTransformation
                   Information pageTransformationInformation)
                      at SharePointPnP.PowerShell.Commands.ClientSidePages.ConvertToClientSidePage.ExecuteCmdlet()
                      at SharePointPnP.PowerShell.Commands.PnPCmdlet.ProcessRecord()
ScriptLineNumber : 27

Page

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @jansenbe Sorry for the late reply, I got busy throughout the last couple of days in work.

How do you migrate the pages from SP2013 to SPOnline? Using SPMT? Yes, I’m using MS SPMT

Can you share the wiki content of the failing page with me Yes sure, u can find it attached below WikiContent.txt

Can you try to directly modernize the page from your SP2013 on-premises environment? Unfortunately, I don’t have access to SP2013 on-premises environment now, I will try this later.

Did you test with the latest release 3.14.1910? Yes, I just tested it on the same page and it gave me the same error