Looking for best practice for "Error: The object ID site:*:web:* is invalid."
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
Error: The object ID "site:111111111-11111-11111-1111-11111111:web:1111111-" is invalid.
I understand the reason why is failing (Out of the box behavior from SP provision that same site is provisioning multiple times and some type issue keep id of web/site incorrect) and also aware this was also discuss in other places.
I'm also aware that from the pnp.framework cannot do a lot, but is more to keep this ticket alive since this was already reported in old versions of the repo.
If this repo is not the correct one., there are other github place that could report this issue? Will be great.
Since am relying in pnp.framework for provisioning process and associated follow up web updates want to reduce the scenario of unpredictability of errors where "wait some minutes and try again" is a confuse answer to give when you have automatic process and red to blink.
What could be the best practice from the pnp.framework team for this type of issue?
(Provision of site that is recreated multiple times and error appear on web object update)
- Should we create a Thread.Sleep(****) with some * minutes and then try and hope works?
- Try to retrieve correct WebID after site provision from SpoOperation.IsComplete or other place and then make another loop of Thread.Sleep to see if is avaliable?
- For each time create a new context, context is using AAD with client ID and associated api permission to retrieve associated token.
Code actions to error appear:
Business Reason:
For current development was provisioning/deleted the same site multiple times
Code sample of error:
var siteOp = tenant.CreateSite(siteCreationProperties);
Provision goes well with associated timer/IsComplete to ensure web was created.
Create new context after the site collection is create, also try to use the same context/web Object that is generated from the "tenant.CreateSite"
Web web = ctx.Web;
Group MemberGroup = ctx.Web.AssociatedMemberGroup;
ctx.Load(web);
ctx.Load(MemberGroup);
ctx.ExecuteQuery();
---> error appears here after recreating the site collection multiple times.
Topic already discuss in following url's:
https://github.com/pnp/PnP-Sites-Core/issues/2025
https://github.com/pnp/PnP-Sites-Core/issues/2019
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked PnP-Sites-Core issues 2025 and 2019, then review the provisioning sequence around tenant.CreateSite, SpoOperation.IsComplete, and the subsequent ctx.Web and AssociatedMemberGroup loads. The issue provides no named source files or tests; it would be done when the team documents a reliable handling strategy for recreated sites and invalid object IDs.
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