Gravatar for bciancio@trident-it.com

Question by bciancio, Sep 21, 2017 8:03 PM

500: Server Error - Perform Authentication

We have just promoted the Coveo build out of our salesforce UAT sandbox and pushed to our BETA environment. We are using CoveoV2 for Salesforce using the Free/Express edition.

When/What: We are receiving an error when we navigate to the search logged in as a community user. We are not getting errors when viewing the same page as an internal user.

We have performed the steps in the documentation here. Which goes over authorizing specific users or profiles as well as setting up the JWT flow.

Here is the full error:

{
  "status": 500,
  "message": "Server Error",
  "type": "UnexpectedErrorFault",
  "name": "UnexpectedErrorFault",
  "queryExecutionReport": [
    {
      "children": [
        {
          "description": "Perform authentication",
          "duration": 1,
          "configured": {
            "primary": "CloudToken",
            "secondary": [],
            "mandatory": []
          },
          "result": {
            "userIds": [
              {
                "name": "bciancio@trident-it.com",
                "kind": "User",
                "provider": "Email Security Provider",
                "infos": {}
              }
            ],
            "roles": [
              "queryExecutor"
            ],
            "queryRestrictions": {
              "pipeline": null,
              "filter": "NOT @sfResource_Type__c==(\"Cloud Academy\",\"Product Video\",\"LOA/SOW\") ((NOT @sfDisplay_In_Community__c=false NOT @sfVisible_to_All_Sellers__c=false) OR (NOT @sfid)) NOT @sfrecordtypename==(\"Avant Accounts\",\"Provider: non-BattleApp\",\"Seller\",\"Team LED Accounts\") NOT @sfstatus__c==(\"Draft\",\"Inactive\") (NOT @objecttype)"
            },
            "userGroups": [
              "Avant Partner Community User"
            ]
          },
          "children": [
            {
              "description": "Resolve authentication of provider: CloudToken",
              "duration": 1,
              "result": {
                "userIds": [
                  {
                    "name": "bciancio@trident-it.com",
                    "kind": "User",
                    "provider": "Email Security Provider",
                    "infos": {}
                  }
                ],
                "roles": [
                  "queryExecutor"
                ],
                "queryRestrictions": {
                  "pipeline": null,
                  "filter": "NOT @sfResource_Type__c==(\"Cloud Academy\",\"Product Video\",\"LOA/SOW\") ((NOT @sfDisplay_In_Community__c=false NOT @sfVisible_to_All_Sellers__c=false) OR (NOT @sfid)) NOT @sfrecordtypename==(\"Avant Accounts\",\"Provider: non-BattleApp\",\"Seller\",\"Team LED Accounts\") NOT @sfstatus__c==(\"Draft\",\"Inactive\") (NOT @objecttype)"
                },
                "userGroups": [
                  "Avant Partner Community User"
                ]
              }
            },
            {
              "description": "Merge authentications (if needed)",
              "duration": 0,
              "result": {
                "userIds": [
                  {
                    "name": "bciancio@trident-it.com",
                    "kind": "User",
                    "provider": "Email Security Provider",
                    "infos": {}
                  }
                ],
                "roles": [
                  "queryExecutor"
                ],
                "queryRestrictions": {
                  "pipeline": null,
                  "filter": "NOT @sfResource_Type__c==(\"Cloud Academy\",\"Product Video\",\"LOA/SOW\") ((NOT @sfDisplay_In_Community__c=false NOT @sfVisible_to_All_Sellers__c=false) OR (NOT @sfid)) NOT @sfrecordtypename==(\"Avant Accounts\",\"Provider: non-BattleApp\",\"Seller\",\"Team LED Accounts\") NOT @sfstatus__c==(\"Draft\",\"Inactive\") (NOT @objecttype)"
                },
                "userGroups": [
                  "Avant Partner Community User"
                ]
              }
            }
          ]
        },
        {
          "description": "Resolve context",
          "duration": 1,
          "result": {
            "userAgent": {
              "raw": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",
              "browser": [
                "chrome"
              ],
              "device": [
                "desktop",
                "pc",
                "windows"
              ],
              "os": [
                "windows"
              ]
            },
            "expressions": {
              "q": {
                "original": "8x8",
                "parsed": "8x8"
              },
              "aq": {
                "original": "",
                "parsed": null
              },
              "cq": {
                "original": "@objecttype==(Account, Resource_List__c, scormanywhere__Course__c, redwing__Learning_Category__c, Lead_Forms__c)",
                "parsed": "@objecttype==(Account,Resource_List__c,scormanywhere__Course__c,redwing__Learning_Category__c,Lead_Forms__c)"
              },
              "dq": {
                "original": "",
                "parsed": null
              }
            },
            "enableDuplicateFiltering": false,
            "filterField": null,
            "filterFieldRange": 5,
            "parentField": null,
            "childField": null,
            "searchHub": "default",
            "tab": "All",
            "recommendation": null,
            "locale": "en",
            "lowercaseOperators": false,
            "context": {},
            "sortCriteria": [
              "relevancy"
            ]
          }
        },
        {
          "description": "Resolve pipeline",
          "duration": 0,
          "result": {
            "pipeline": "default",
            "splitTest": null
          }
        }
      ]
    }
  ]
}

We are unsure if this is related if the following is related, but when we were setting up Coveo in our UAT environment, we previously encountered configuration errors when setting up JWT and this was the reason:

"JWT flow needs the URL of the community, and the package is sending in www.battleapp.info to our backend (this being the public site url), but it should instead send in the force.com URL for the community."

Any help and thoughts are appreciated. Thank you!

2 Replies
Gravatar for bciancio@trident-it.com

Answer by bciancio, Sep 22, 2017 8:46 PM

@Martin Laporte suggestion worked.

The user performing the query didn't have the API Enabled permission on the profile.

Gravatar for maveilleux@coveo.com

Answer by maveilleux, Sep 21, 2017 8:20 PM

What Coveo for Salesforce package version are you using?

Gravatar for bciancio@trident-it.com

Comment by bciancio, Sep 21, 2017 8:22 PM

Coveo for Salesforce V2

Version Name: 1.2537.24-15

E* 2.45

Ask a question