pnp / pnp/pnpframework

The JSON value could not be converted to System.Int32.

Open
#787 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

Hello,

I'm having the following issue when trying to run the following command over an specific site:

Get-PnPSiteTemplate -Connection $connection -Out $output -Encoding ([System.Text.Encoding]::UTF8) -IncludeAllPages -IncludeAllTermGroups -IncludeNativePublishingFiles -IncludeSearchConfiguration -PersistBrandingFiles -PersistPublishingFiles -Force

Everything goes normal until I get this error in debug output:
Extracting Template from https://n36j.sharepoint.com/sites/S… [Client Side Page Contents ] 81167717-0a13-41cc-9b59-8cd7924a2669
Get-PnPSiteTemplate: /tmp/regress/bin/M365-SP-Backup-Site.ps1:53 ed1677172292ms4181167717-0a13-41cc-9b59-8cd7924a2669
Line | 81167717-0a13-41cc-9b59-8cd7924a2669b59-8cd7924a2669
53 | Get-PnPSiteTemplate -Connection $connection -Out $output -Encodin …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The JSON value could not be converted to System.Int32. Path: $.position.sectionIndex | LineNumber: 0 | BytePositionInLine: 107.

This is happening using PnP.Powershell in latest version (1.11.0), but also in the most recent nightly (1.11.124-nightly). I'm opening the issue here as it's what they suggest in their git repo:
...

  1. Are you using Invoke-PnPSiteTemplate or Get-PnPSiteTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/pnpframework/issues.
    ...

How could I investigate further this problem?

Thanks for any help.
Best regards,
Jorge

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Get-PnPSiteTemplate provisioning-engine entry point and reproduce the command against the reported site or equivalent input. Trace the JSON conversion failure at $.position.sectionIndex, then identify the responsible source location and add a regression test showing the command completes with that data.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.