0

I am trying to run the dotnet sitecore ser push command after non-interactive login (login works fine), but only ser push and ser pull command give the following error otherwise all the ser command like explain, info, validate etc, works fine.

This is the error:

PS C:\RSMRepo> dotnet sitecore ser push
Unhandled exception: System.Exception: Unhandled exception
 ---> System.AggregateException: One or more errors occurred. (Specified argument was out of the range of valid values. (Parameter 'baseUri')) (Specified argument was out of the range of valid values. (Parameter 'baseUri')) (Specified argument was out of the range of valid values. (Parameter 'baseUri'))
 ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'baseUri')
   at System.Uri..ctor(Uri baseUri, String relativeUri)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.SitecoreApiClient.<>c__DisplayClass13_0.<<RunQuery>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Sitecore.DevEx.Configuration.Authentication.OidcAuthenticationProvider.MakeAuthenticatedRequestInternal(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\OidcAuthenticationProvider.cs:line 80
   at Sitecore.DevEx.Configuration.Authentication.OidcAuthenticationProvider.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\OidcAuthenticationProvider.cs:line 25
   at Sitecore.DevEx.Configuration.Authentication.ClientCredentialsAuthenticationProvider.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\ClientCredentialsAuthenticationProvider.cs:line 89
   at Sitecore.DevEx.Configuration.Models.EnvironmentConfiguration.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Models\EnvironmentConfiguration.cs:line 182
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.SitecoreApiClient.RunQuery(String servicePath, GraphQLRequest request, Boolean assertNoErrors, CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.ExecuteSingleBatchQuery[T](String batchQueryFragment, TreeScope scope, ItemSpec[] specs, CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.<>c__DisplayClass19_0`1.<<CreateParallelQuery>b__0>d.MoveNext()
   --- End of inner exception stack trace ---
   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.Extensibility.Serialization.Tasks.TreeSyncOperationExecutor.ExecuteTreeSyncOperation(TreeSyncOperation operation, Boolean whatIf, Boolean performValidation, SyncDirection direction, CancellationToken cancellationToken)
   at Sitecore.DevEx.Extensibility.Serialization.Tasks.SyncTask.Execute(SyncTaskOptions options)
   at Sitecore.DevEx.Extensibility.Serialization.Commands.SyncCommandBase.Handle(SyncTask task, SyncArgs 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 75
 ---> (Inner Exception #1) System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'baseUri')
   at System.Uri..ctor(Uri baseUri, String relativeUri)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.SitecoreApiClient.<>c__DisplayClass13_0.<<RunQuery>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Sitecore.DevEx.Configuration.Authentication.OidcAuthenticationProvider.MakeAuthenticatedRequestInternal(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\OidcAuthenticationProvider.cs:line 80
   at Sitecore.DevEx.Configuration.Authentication.OidcAuthenticationProvider.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\OidcAuthenticationProvider.cs:line 25
   at Sitecore.DevEx.Configuration.Authentication.ClientCredentialsAuthenticationProvider.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\ClientCredentialsAuthenticationProvider.cs:line 89
   at Sitecore.DevEx.Configuration.Models.EnvironmentConfiguration.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Models\EnvironmentConfiguration.cs:line 182
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.SitecoreApiClient.RunQuery(String servicePath, GraphQLRequest request, Boolean assertNoErrors, CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.ExecuteSingleBatchQuery[T](String batchQueryFragment, TreeScope scope, ItemSpec[] specs, CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.<>c__DisplayClass19_0`1.<<CreateParallelQuery>b__0>d.MoveNext()<---

 ---> (Inner Exception #2) System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'baseUri')
   at System.Uri..ctor(Uri baseUri, String relativeUri)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.SitecoreApiClient.<>c__DisplayClass13_0.<<RunQuery>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Sitecore.DevEx.Configuration.Authentication.OidcAuthenticationProvider.MakeAuthenticatedRequestInternal(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\OidcAuthenticationProvider.cs:line 80
   at Sitecore.DevEx.Configuration.Authentication.OidcAuthenticationProvider.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\OidcAuthenticationProvider.cs:line 25
   at Sitecore.DevEx.Configuration.Authentication.ClientCredentialsAuthenticationProvider.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Authentication\ClientCredentialsAuthenticationProvider.cs:line 89
   at Sitecore.DevEx.Configuration.Models.EnvironmentConfiguration.MakeAuthenticatedRequest(HttpClient client, Func`2 requestAction) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Configuration\Models\EnvironmentConfiguration.cs:line 182
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.SitecoreApiClient.RunQuery(String servicePath, GraphQLRequest request, Boolean assertNoErrors, CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.ExecuteSingleBatchQuery[T](String batchQueryFragment, TreeScope scope, ItemSpec[] specs, CancellationToken cancellationToken)
   at Sitecore.DevEx.Serialization.Client.Datasources.Sc.Query.SitecoreTreeDataStore.<>c__DisplayClass19_0`1.<<CreateParallelQuery>b__0>d.MoveNext()<---

   --- End of inner exception stack trace ---
   at Sitecore.Devex.Client.Cli.Extensibility.Subcommands.SubcommandBase`2.HandleExceptionMessageConsoleLogging(Exception exception, ILogger logger) in C:\BA\ca7111d945a16af4\src\Sitecore.Devex.Client.Cli.Extensibility\Subcommands\SubcommandBase.cs:line 120
   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 81
   at System.CommandLine.Invocation.CommandHandler.GetResultCodeAsync(Object value, InvocationContext context)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass24_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseExceptionHandler>b__0>d.MoveNext()

Below is the environment detail:

  • Sitecore version: 10.2 XP0

  • Sitecore CLI version: 4.1.0

  • Sitecore.json looks like below:

    enter image description here

Please let me know if something else is required for your idea and provide help around fixing the ser push command error.

2 Answers 2

1

For this, I found some discrepancies which are as follows:

As per the screenshot above for the sitecore.json the package Sitecore.DevEx.Extensibility.Serialization was at version 3.0.0 but when I checked the Sitecore CLI version in PowerShell by command dotnet sitecore --version, then it was showing 4.1.0, so I upgraded the package from 3.0.0 to 4.1.0 to make it compatible with current CLI version.

Still, error was not resolved:

Then, I found somewhere that deleting the .sitecore/user.json file works so I deleted the user.json file and from PowerShell used the command for non-interactive Sitecore login to save the login information in the new user.json (created by command) and tried the ser pull.

Still, the error was there then:

I checked that the package for Sitecore Management Services that I had installed in the Sitecore was with version 4.1.1 so I downloaded the package with 4.1.0 and then installed it into the Sitecore and tried again with ser pull.

Still, the error was there then:

I noticed that there are two different config patches for the claimsMapping in my local, so I removed the irrelevant one and kept the one suggested by the steps as per the article https://doc.sitecore.com/xp/en/developers/102/developer-tools/configure-a-non-interactive-client-login.html

Still, the error was there, and then finally:

I checked that in my non-interactive command I was passing the --auth and --cm without https:// so I again deleted the user.json and used the non-interactive Sitecore login command, but now with https:// and then again tried the ser pull command and it worked.

-3

Please go to your solution folder and go check if you have .sitecore directory and ensure that you have user.json file in there, which contains the token, If you don't have it then try to re-create, Assuming you're are using an Admin user or some other account to log into CM node.

Cheers

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.