pnp / pnp/pnpframework

KeyNotFoundException in TokenParser.GetListTitleForMainLanguage

Open
#509 0 comments 1 reaction 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,

when using ClientContext.Web.ApplyProvisioningTemplate we sometimes get this exception:

System.Collections.Generic.KeyNotFoundException: The given key 'NameOfTheList' was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey key) at PnP.Framework.Provisioning.ObjectHandlers.TokenParser.GetListTitleForMainLanguage(Web web, String name) at PnP.Framework.Provisioning.ObjectHandlers.TokenParser.RebuildListTokens(Web web) at PnP.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation) at PnP.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo, Boolean calledFromHierarchy, TokenParser tokenParser) at Microsoft.SharePoint.Client.WebExtensions.ApplyProvisioningTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation applyingInformation)

We are at this moment using PnP.Framework 1.7.0, but we noticed the same problem already in version 1.6.0. Before we were working the the "old" PnP-Sites-Core library and we were able to provision without any problems.

Please advice.

Kind regards,

Domen

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 TokenParser.GetListTitleForMainLanguage and trace its callers through RebuildListTokens and ObjectListInstance.ProvisionObjects when Web.ApplyProvisioningTemplate runs. Reproduce the intermittent KeyNotFoundException with the reported list name and determine why that name is absent from the dictionary; done means provisioning completes without the exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
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.