Troubleshooting - Common Desk Connect Errors

Last Updated -

This article will explain common errors generated by the Desk Connect Integration and methods for troubleshooting.

1. Error: Failed to save Company from Salesforce, response: {"message":"Validation Failed","errors":{"name":["taken"]} xxxxxxxxxxxxxx (SF record ID)

This error can be generated if there are duplicate accounts in Salesforce bearing that same name and one of these accounts previously synced to Desk and created a Desk company. Since the Desk Company and Salesforce Account matching and mapping are done via the unique field identifier "Company/Account Name, this error will be generated when a duplicate account is trying to sync to Desk because the name is already taken.

If you grab the name of the SF Account which generated this error, and then you search using the Account name, this will show you the number of accounts bearing that name.

We recommend cleansing the Salesforce CRM of duplicate Salesforce accounts to avoid these type of conflict/errors. If the duplicate accounts already have contacts and cases associated with them, ensure that you re-associate them with the winning account record prior deleting the duplicate records. This will ensure a 1:1 record mapping between Desk and Salesforce.

2.  Warning: There is a problem with your Salesforce integration. You have requested access to a field in Salesforce that doesn't exist or is inaccessible.

This error implies that the Salesforce Integration user profile does not have permission to a field which was previously selected within the integration Salesforce widget. The field security level has been changed, or the name or field type has been changed in Salesforce, and the change hasn't synced to Desk yet.

Review the mentioned Field level security to ensure that it is visible and not hidden for the integrated user profile and make it visible.

If it is visible, sometimes clearing the fields from the widget and manually re-selecting standard fields that you know the integration user has access to can resolve this error. 

If field name/type has been changed and you see a different name/field in Salesforce, then Clear and then re-select the fields and click Save (if this doesn't work after a few attempts, click Reauthorize to reset the field cache and API connection). 

To "Clear" the Salesforce fields cache within the Desk Salesforce Widget,  go to Admin > Settings > Integrations > Salesforce Integration > Click on “Clear” button > click on Save button > Re-select your Salesforce object fields>> click on the Save button.

This approach will force the integration to recache the Salesforce objects/fields metadata.

3. The following required fields are missing from your Salesforce Integration: {"Salesforce Field Name"=>"salesforce_api_key"}

The error will dynamically show the field causing the problem - for example, if the Case Origin field is "missing" you would see this error: The following required fields are missing from your Salesforce Integration: {"Origin"=>"interaction_type_id"}

In this error, "missing" means the field referenced is not visible to the integration user on the page layout and/or there are FLS on that field for that object. 

The Salesforce Administrator needs to make the field visible on the object's page layout and grant Read and Write access to the field on the object for the integration user's profile through Field-Level Security. 

4.  invalid_grant: expired access/refresh token

When the Salesforce integration is authorized, a token is established which will allow you to connect the Salesforce org to a Desk site. If the integrated user login session has expired, or an admin revokes the token from within Salesforce or blocks the Desk.com app itself, then the integration is invalid, and Desk and Salesforce cannot communicate with each other. 

Try to Reauthorize the integration from within your Desk site via Admin > Settings > Integrations > Salesforce Integration. This will attempt to establish a new session, and the integration should work again.



However, if it doesn't work and still generates this error, then perhaps you may need to go to your Salesforce organization setup section > search for —→ "Connected Apps OAuth Usage" > under the Desk.com section click on the "User Count" number and on the next page click on "revoke" button to remove the token against the Salesforce Integration User. Then go back into Desk and Reauthorize the integration again to refresh the token/session against the integrated user account.

5. Warning: NOT_FOUND: The requested resource does not exist, OR The requested resource could not be found. Check the URI for errors, and verify that there are no sharing issues. (Salesforce Message: 'The requested resource does not exist,' Salesforce Error Code: 'NOT_FOUND') 

These errors are referencing a record or records which have been Deleted from the other instance. Or the Salesforce integration user does not have access to them anymore due to organization wide defaults – sharing rules or Integrated User profile changes.

Deletions aren't synced via Desk Connect and have to be handled manually in both systems. Check the recycle bin in Salesforce - if a record was deleted, it should appear in the recycle bin for 15 days. After 15 days, the record is removed from the recycle bin and is hard deleted after 30 days. If the record was deleted, the external link has been removed so the record can be re-updated.

If the record wasn't deleted, then the integration user may not be a full system admin as recommended. The Salesforce Integration User should be a full system administrator who has access to all data within the organization and therefore would need to review the Salesforce organization OWD (Organization-Wide Defaults), profile and role to make sure the integrated user has the right permissions. 

6. Error: STRING_TOO_LONG: {Field Name}: data value too large: {Value within the field} (max length=#)

This error occurs when Salesforce or Desk is trying to sync a field value which exceeds the recipient Org field character limit/s. 

Fix the value in the field in the offending system. For common offenders like Subject, Description, etc., suggest a Case Updated rule to truncate a field using liquid. This is especially important for Phone and Chat cases, since Next Gen defaults to using the case body as the Subject if a Subject is not specified. Here is a sample rule: 

Case Channel – is – Phone Call 

Case Subject – is not – {% if case.size > 100 }{{case.subject | truncate: 100}}{ else }{{case.subject}}{ end if %} 

Rule Action: Set Case Subject {{case.subject | truncate: 100}}

7. There is a problem with authenticating your Salesforce integration. You might want to increase the duration of your Sessions (see Session Settings in your Salesforce Admin). (SF Message: 'Session expired or invalid', SF Error Code: 'INVALID_SESSION_ID')

When Desk logs in and makes a connection with your Salesforce account, a 'session' is being created. However, a session does not stay active the whole time. When you are inactive for, for example, 30 minutes, you could be logged out again. Desk would then need to make a new connection again and setup a new session.

What the message is recommending here is to increase the duration of the Salesforce integrated user session timeout value (how much time must elapse before your session gets invalid).  To amend the session settings have a look at the following document: Modify Session Security Settings. (Desk recommends that the session timeout value is set to a maximum value) 

8. Error:Connection reset by peer (OpenSSL::SSL::SSLError)

These errors are timeout errors, and this relates to Salesforce load when trying to sync custom picklist field values. It can happen when there is an issue with the polling server or if the mapped list field values are deleted/renamed and Desk Connect hasn't synced the changes back to Desk yet.

The Salesforce Integration field caching requires a refresh, and this can be done by reauthorizing the integration. In Desk go to Admin > Settings > Integrations > Salesforce Integration and click on Reauthorize option i.e.:http://nimb.ws/iIeU09. 

9.  FIELD_CUSTOM_VALIDATION_EXCEPTION: <div style=“background-color: red; height: 20px; color: white; line-height: 20px;”>Duplicates for Contact</div><table width=“80%” cellspacing="0" cellpadding="0" class="list"><thead Desk Desk Connect class="rich-table-thead"><tr class

This error is generated due to an app in Salesforce called DupeCatcher. Potentially, the DupeCatcher has recognized a synced record as a duplicate contact/account, either by name or email address and the app validation rule has triggered generating the error. 

10. Warning-- DUPLICATES_DETECTED: You're creating a duplicate record. We recommend you use an existing record instead.

 This error is generated due to Salesforce Data Management duplicate contact/account rules and matching rules. The duplicate rule triggers when a contact email matches another email already in Salesforce. The block actions apply on create and/or edit.

If this issue is causing sync problems, review your Salesforce Data Management duplication rules and adjust the settings as required. If it works as expected, then there is no need to make any modifications to the related rules.

11.There was a problem setting up your connection. Please contact the Desk.com Support Team. [ SALESFORCE ERROR: undefined method `id' for nil:NilClass ]

Customers who previously used the native Salesforce integration (managed package) and then enabled the Desk Connect feature are most prone to receiving such errors if the managed package is still installed in Salesforce for reasons such as maintaining the Desk cases historic data in Salesforce.

For example, this issue can occur when the Security Token has expired or been revoked, or when the Salesforce Integrated User Account in Desk has changed. This can also occur when disconnecting and reconnecting the integration and a new set of Client Keys/Tokens are generated. Since customers may still have the managed package installed in Salesforce, this information is not updated with the new token keys and the system will generate the above error.

Within the following KB article section 10 "The last step is to enter your authentication credentials." it explains in details the steps required to insert and update the Desk.com Client keys and how to reauthenticate the integration in Salesforce.
 

Related Articles:

Desk Connect
Desk Connect: FAQs
Desk Connect: Syncing with a Salesforce Person Account
Step 1: Setting up the Salesforce to Desk Integration