2

I have this error when trying login to sitecore using CLI.

Unhandled exception. System.IO.FileNotFoundException: The configuration file 'cdp.config.json' was not found and is not optional.
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
   at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at Sitecore.DevEx.Telemetry.ContainerExtensions.AddSitecoreCdpTelemetryClient(IServiceCollection serviceCollection, String channel) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Telemetry\ContainerExtensions.cs:line 34
   at Sitecore.DevEx.Client.Cli.CliInvoker.Run(String[] args) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Client.Cli\CliInvoker.cs:line 118
   at Sitecore.DevEx.Client.Cli.Tool.Program.Main(String[] args) in C:\BA\ca7111d945a16af4\src\Sitecore.DevEx.Client.Cli.Tool\Program.cs:line 13
   at Sitecore.DevEx.Client.Cli.Tool.Program.<Main>(String[] args)`

this is the command

dotnet sitecore login --authority  xxxxxx xxxxxx --allow-write true

even when I ran simple sitecore command like "dotnet sitecore -h", I still get the above error but when I tried "dotnet sitecore --version" it shows the version. So it's already installed.

Sitecore cli version: 5.2.113

Have someone encounter this error before? Thank you in advance.

2
  • Unhandled exception. System.IO.FileNotFoundException: The configuration file 'cdp.config.json' was not found and is not optional.
    – Mark Cassidy
    Commented Feb 4 at 10:15
  • @MarkCassidy do you know where to put the configuration file "cdp.config.json". Is it the root of the project folder? I have tried the dotnet sitecore login command with the "--no-telemetry" flag but still giving the same error. Commented Feb 8 at 13:57

1 Answer 1

1

The error you're encountering seems related to the Sitecore CLI not being able to find the 'cdp.config.json' configuration file (this is a mandatory one). This issue might be due to misconfiguration or missing files. Here are some steps you can take to troubleshoot and resolve the problem (note- this is not the perfect solution but this might help to troubleshoot the issue):

Configuration File:

Ensure that the 'cdp.config.json' file is present in the expected location. The configuration file might be missing or incorrectly named. You can create it manually if it doesn't exist.

Configuration File Content:

If the 'cdp.config.json' file exists, check its content for correctness. It should contain the necessary configuration settings, including authentication details.

Here's a basic example of what the 'cdp.config.json' file might look like:

{
  "Authority": "https://your-identity-server",
  "ClientId": "your-client-id",
  "ClientSecret": "your-client-secret",
  "SitecoreAuthority": "https://your-sitecore-instance",
  "SitecoreApiHost": "https://your-sitecore-instance/sitecore/api",
  "TelemetryChannel": "your-telemetry-channel"
}

Telemetry Configuration:

The error mentions telemetry. If you don't need telemetry, try running the command without it:

dotnet sitecore login --authority xxxxxx xxxxxx --allow-write true --no-telemetry

Sitecore Support:

If nothing works then I would suggest checking with the Sitecore Support Team.

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.