2

We are using Azure Devops to install packages which are generated during Build Pipelines. We are using Sitecore CLI - SCS - to install these packages.

This command is the one -> dotnet sitecore ser pkg install

For some reason, it started throwing these exception on one of the packages:

One or more errors occurred. (One or more errors occurred. (A task was canceled.)) (One or more errors occurred. (A task was canceled.)) (One or more errors occurred. (A task was canceled.)) (One or more errors occurred. (A task was canceled.)) (One or more errors occurred. (A task was canceled.)) (One or more errors occurred. (A task was canceled.))
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.CreateParallelQuery[T](String parallelQueryFragment, TreeScope scope, ItemSpec[] specs, CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.GetTreeNodesInternal(IEnumerable`1 itemSpecs, TreeScope scope, CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.Initialize(CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.TreeSyncOperation.Initialize(CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.TreeSyncOperationExecutor.ExecuteTreeSyncOperation(TreeSyncOperation operation, Boolean whatIf, Boolean performValidation, Boolean force, SyncDirection direction, CancellationToken cancellationToken)
   at Sitecore.DevEx.Extensibility.Serialization.Tasks.PackageInstallTask.Execute(PackageInstallTaskOptions options)
   at Sitecore.DevEx.Extensibility.Serialization.Commands.PackageInstallCommand.Handle(PackageInstallTask task, PackageInstallArgs args)
   at Sitecore.DevEx.Extensibility.Serialization.Commands.PackageInstallCommand.Handle(PackageInstallTask task, PackageInstallArgs args)
   at Sitecore.Devex.Client.Cli.Extensibility.Subcommands.SubcommandBase`2.HandleInternal(TArgs args) in C:\BA\ca7111d945a16af4\src\Sitecore.Devex.Client.Cli.Extensibility\Subcommands\SubcommandBase.cs:line 84
Execution was cancelled. This occurs when the task is killed or requests timeout.

We are using Sitecore CLI 5.1.25 with these plugins:

  • Sitecore.DevEx.Extensibility.Serialization v.5.1.25
  • Sitecore.DevEx.Extensibility.Publishing v.5.1.25
  • Sitecore.DevEx.Extensibility.Indexing v.5.1.25
  • Sitecore.DevEx.Extensibility.ResourcePackage v.5.1.25
  • Sitecore.DevEx.Extensibility.Database v.5.1.25

Is this timeout issue or something else? Where we can configure timeout / session for Sitecore cli via some command or configuration?

When I install the package from local machine, it installs it without this error. Very same package on same environment.

1

1 Answer 1

0

We have first attempted to fix this issue by increasing apiClientTimeoutInMinutes parameter in sitecore.json definition as suggested by Maarten Willebrands:

{
  "$schema": "./.sitecore/schemas/RootConfigurationFile.schema.json",
  "modules": [
    ...
  ],
  "plugins": [
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]"
  ],
  "serialization": {
    ...
  },
  "settings": {
    "apiClientTimeoutInMinutes": 30,
    "telemetryEnabled": false,
    "versionComparingEnabled": true
  }
}

But it did not help.

I have then attempted to install the same package from my local instance connected to that higher environment and it was successful.

I have then used Fiddler Everywhere to sniff all traffic and requests done during package installation and found the root cause of time outs.

It was this definition in one of our module.json files:

{
   "name": "site",
   "path": "/sitecore/content/Internet/MarketingSite",
   "rules": [
        {
            "path": "/Data",
            "scope": "SingleItem",
            "allowedPushOperations": "CreateOnly"
        },
        {
            "path": "/Settings",
            "scope": "ItemAndDescendants",
            "allowedPushOperations": "CreateOnly"
        },
        {
            "path": "*",
            "scope": "ignored"
        }
    ]
}

I have rewrote it like this:

{
  "name": "site",
  "path": "/sitecore/content/Internet/MarketingSite",
  "scope": "SingleItem",
  "allowedPushOperations": "CreateOnly"
},
{
  "name": "siteData",
  "path": "/sitecore/content/Internet/MarketingSite/Data",
  "scope": "SingleItem",
  "allowedPushOperations": "CreateOnly"
},
{
  "name": "siteSettings",
  "path": "/sitecore/content/Internet/MarketingSite/Settings",
  "scope": "ItemAndDescendants",
  "allowedPushOperations": "CreateOnly"
}

I have therefore removed the rule and instead of one definition we had three.

More information can be found here: https://tothecore.sk/2024/04/10/sitecore-cli-serialization-installation-of-package-fails-on-timeout/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.