Coveo for Sitecore Activation Error Fix

Issue

I ran into this problem when installing Coveo on Sitecore 10.3 XM with Headless SXA and NextJS. Once the package install is completed and when clicking Activate Coveo for Sitecore package it redirected to the Coveo administration page and later automatically redirects to the Sitecore login page. Even after logging in as an admin, still unable to access the page and encountered the same error message.

Redirect to the Coveo Activation page

Investigation

Coveo Diagnostics

To check the issue opened the Coveo Diagnostics page and ran into the same problem. Since the configuration wizard is not completed it wouldn't load the diagnostics page.

Logs

Checking the Sitecore logs and found the following issue.

16700 20:34:10 WARN [Uri: GET /coveo/api/config/v1/configure/endpoints][Corr. Id: b46d8550-6e3b-42bc-b13a-d8532377b758] The Sitecore user 'extranet\Anonymous' does not have the required permissions. The user needs the Coveo Configuration Admin role.

API call

Tried opening the API directly and got this response

https://sc103cm.dev.local/coveo/api/index/v1/indexes

{"ErrorCode":"INSUFFICIENT_PERMISSIONS","Details":"The Sitecore user 'extranet\Anonymous' does not have the required permissions.","CorrelationId":"623655c1-7f2a-403e-8062-c6c29360eba1"}

Root Cause

When the Coveo admin pages are opened it authorizes by checking if the user is an administrator or member of the Coveo Configuration Admin role.

Solution

This is a temporary solution to bypass the issue but is not recommended. It looks like a bug in Coveo, I will update the approriate solution in this blog.

We have two options for this issue as a temporary solution.

Option 1:

Create a new Role Coveo Configuration Admin and add the user.

Add the extranet\anonymous as a member of that group

Option 2:

Make extranet\anonymous as administrator (Not recommended)

You can use this in a local development environment but do not use it in any other environment.

Final step

Now, we don't need to install the package again to run the wizard. Open the Configuration Manager under Coveo Search in Control Panel.

Now you should see the activation screen and proceed with the prompt and activate your Coveo instance.

Hope this helps.