pnpframework
pnpframework copied to clipboard
Looking for best practice for "Error: The object ID site:*:web:* is invalid."
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
Hi @aaclage
We are experiencing the same issue as part of an on prem SP2013 migration to SPO.
For a small amount of background, we are migrating several thousand sites and are creating/configuring them using PnP scripts.
We ran into this issue as part of an initial test run where a number of sites were created, configured, deleted and then re-provisioned which then fails randomly with the errors you describe.
I am curious to know if you have found a reliable way around this?
The other threads mention allowing some time after deleting and then attempting to re-provision, but this has not worked for us even after allowing two weeks.
In the same session when the process fails, commands like Get-PnPSite will also error on and off and completely at random, stating 404 not found, and then returning the site moments later.
Thanks.