pnp / pnp/pnpframework

Get-PnPSiteTemplate -Out lists.xml -Handlers Lists - Exception: Object reference not set to an instance of an object.

Open
#992 0 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

Getting "Object reference not set to an instance of an object" when trying to generate the template.
It fails on the same list every time I run the command.

PS C:\Users\xxxxx> Connect-PnPOnline https://xxxx.sharepoint.com/sites/xxxxx/yyyyy-Interactive
PS C:\Users\xxxxx> Get-PnPSiteTemplate -Out lists.xml -Handlers Lists -Force
Get-PnPSiteTemplate: Object reference not set to an instance of an object.
PS C:\Users\xxxxx> Get-PnPException

Message          : Object reference not set to an instance of an object.
Stacktrace       :    at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in
                   c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 101
                      at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord() in
                   c:\build\src\Commands\Base\PnPSharePointCmdlet.cs:line 131
                      at System.Management.Automation.CommandProcessor.ProcessRecord()
ScriptLineNumber : 1

Running PnP.PowerShell version 2.4.0.
User is site collection administrator

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

Reproduce the failure with Get-PnPSiteTemplate -Out lists.xml -Handlers Lists -Force using PnP.PowerShell 2.4.0, noting that it consistently fails on one list. Start at PnPConnectedCmdlet.cs line 101 and PnPSharePointCmdlet.cs line 131, then trace the Lists handler to determine which value is null. Done means the failing list is handled without the reported exception and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, 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.