Skip to content

Looking for best practice for "Error: The object ID site:*:web:* is invalid." #596

@aaclage

Description

@aaclage

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:
pnp/PnP-Sites-Core#2025
pnp/PnP-Sites-Core#2019

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions