# Error messages

Troubleshooting information for common error messages customers may experience when using the Tray builder

## Data storage step error: "message": "No value found under this key."

### The message

```
\{
 "message": "No value found under this key."
\}
```

This error message means you are trying to access a data storage value under a key that doesn't exist.

Example:

### Adding to a list that doesn't exist

In this situation, the storage-17 step is attempting to "append to list" but the list "items" doesn't exist yet. The builder has set the scope of the data storage step to "current run" which means the data storage step is only looking for keys that *exist within the current execution* (as opposed to the lifetime of the workflow or account-level scopes):
![adding-to-list-that-doesnt-exist](https://tray.ai/documentation/images/help/troubleshooting/error-messages/6aCxL4BGjpQqbnC3zbfBfy_accessing-list-that-doesn-t%20exist.png)

### Create list if missing

If you want to create the list if it doesn't exist yet, you can select this option in the properties panel of a data storage step:
![create-if-missing](https://tray.ai/documentation/images/help/troubleshooting/error-messages/6jpwXUnKnSC0ajVMxECePZ_create-if-missing.png)

### Change storage scope if required

Or, if "items" is a list that should persist across the lifetime of the workflow or persist as account-level storage, you can change the scope here:
![change-scope](https://tray.ai/documentation/images/help/troubleshooting/error-messages/1zbIGLXtw82GUAIlunueuA_change-scope.png)

##

"Incompatible Type"

### Explanation

This error message means you are attempting to input data of one type into a field that's expecting a different type.
The data type menu can tell you what types are available:
![type-list](https://tray.ai/documentation/images/help/troubleshooting/error-messages/4Bnwnt2r24YePbfvLH92A3_type-list.png)
Some common data type errors are:
Attempting to use a boolean value as a string, i.e. setting the boolean value true to the string version of 'true' (the string version has quotation marks).
Attempting to use an ID as a number when it should be a string or vice versa.

### Example: Stripe object IDs are strings

Charge objects in Stripe have IDs, but they are stored as strings, not as numbers (indicated by the ""):
![stripe-object-ids](https://tray.ai/documentation/images/help/troubleshooting/error-messages/4NG945qz7QXkhTPu7qT4hU_stripe-object-ids.png)

### Example: HubSpot object IDs are numbers

Company IDs in HubSpot are stored as numbers, not strings (indicated by the **absence of ""**):
![hubspot-object-ids](https://tray.ai/documentation/images/help/troubleshooting/error-messages/2Vt0R7S1k4sCEWNWSlzlBd_hubspot-object-ids.png)

## What does (401, 503, 200, etc) status code mean?

### Explanation

Status codes are universal 3-digit numerical codes that servers use to indicate the success or failure of an HTTP request. Seeing a status code in your Tray execution logs can indicate that a Tray connector successfully made contact with a service's servers, but may or may not have actually completed the request due to one of the following situations:

| **Code**                           | **Explanation**                                                                                 |
| ---------------------------------- | ----------------------------------------------------------------------------------------------- |
| 200 - OK                           | Everything worked as expected                                                                   |
| 400 - Bad Request                  | The request was unacceptable, often due to missing a required parameter                         |
| 401 - Unauthorized                 | No valid API credentials provide.                                                               |
| 402 - Request Failed               | The parameters were valid but the request failed                                                |
| 403 - Forbidden                    | The API credentials entered don't have permission to perform the request                        |
| 404 - Not Found                    | The requested resource doesn't exist                                                            |
| 409 - Conflict                     | The request conflicts with another request (perhaps due to using the same idempotent key)       |
| 429 - Too Many Requests            | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests |
| 500, 502, 503, 504 - Server Errors | Something went wrong on the service's server end                                                |

### More info

For more information on HTTP status codes, read [MDN Web Docs: HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) or [HTTP Status Codes for Beginners](https://aloneonahill.com/blog/http-status-codes).

## "message": "Reference: $.steps.connector-1.*\[ in property: '*' did not resolve to any value."

### Explanation

This message means that the jsonpath you're using in the connector's input can't find any value associated with that jsonpath -- it doesn't exist.
Whenever you encounter that kind of error, inspect the json body to verify what is or isn't there. 

### Example

In this workflow, the builder is using a JSON path to reference the 'content' field of the 'result' of the script-6 step:
![did-not-resolve-screenshot](https://tray.ai/documentation/images/help/troubleshooting/error-messages/3Tnl52mtSaVP5aXfspaD8r_did-not-resolve-screenshot.png)
Looking at this JSON path, I would expect to go to the output of script-6 step and find a 'content' field inside the 'result' field.

The output of the script-6 step looks like this, however:

```json
{
 "result": \{
  "isValid": false
 \},
 "console": []
}
```

There's a similar error on another execution step:

```json
\{
 "message": "Reference: $.steps.script-6.result.content in property: 'body.raw.product.media_gallery_entries[].content.base64_encoded_data' did not resolve to any value."
\}
```

Anytime you see the message, "did not resolve to any value," you'll need to check that the JSON path is referencing something that actually exists.

### Fallback values

It is important to note that some service APIs will be erratic in the fields and values that they return.
For example, if there is no value stored for a particular field in the service then that field might be absent entirely when it comes through to Tray.
So one customer may come through as:

`\&#123;
        "first_name": "Eleanor",
        "last_name": "Rivera",
        "email": "eleanorrivera83@ymail.com",
        "phone": "725-015-9623"
    \&#125;`
While another customer with no value entered for 'phone' in the service may come through as:

`\&#123;
        "first_name": "Samuel",
        "last_name": "Powell",
        "email": "spowell@aol.com"
    \&#125;
    `
This will cause the 'did not resolve' error if any subsequent steps try to reference 'phone' for Samuel Powell.
The solution here is to use [Fallback values](https://tray.ai/documentation/platform/automation-integration/building-workflows/mapping-data/fallback-values) to set the value for 'phone' as null or 'not found' any time the field is missing.

##

## "Bad API Request"

### Explanation

This error message is letting you know that you've configured your connector inputs improperly and the API you're connecting to doesn't like the format of your request. You should inspect your input carefully and compare it to what's required per the API documentation of your chosen service.
You should also take a close look at the data type indicators in Tray's input panel. These visual indicators will tell you if the input requires a string, boolean, number, array, or object.
For example, sending a record ID as a number when the API documentation requires a String is the type of 'Bad API Request' to watch out for:

### Example: InfusionSoft 'Create Contact'

For this operation, the input field "email addresses" actually takes a list (the \[ ] symbol specifies that) instead of a single field (i.e. a single email address).
The list contains objects (sets of key/value pairs) that contain a "field" and an "Email".
In the example below, the workflow builder needs to specify an email address for the 'Email' field below as opposed to filling in 'Contact' with a single email address:
![infusionsoft-email-address](https://tray.ai/documentation/images/help/troubleshooting/error-messages/1sEqK20Q0glAoIuZHYH3EQ_infusionsoft-email-address.png)

## "message": "Unfortunately, the connector unexpectedly failed. Please contact support if this persists. Error ID: \*\*\*\*\*\*\*\*\*\*"

### Explanation

This is an error message from Tray indicating there's an issue with the connector's attempts to process your data. The most common reason for this error is attempting to send a payload that is too large.
Here's a quick summary of Tray's data payload limits:

| Case                                                                                                                      | Limit                           | Notes                                                                               |
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------------------------------------------------------------------------------- |
| Data that can pass between any 2 steps in the workflow builder                                                            | 6 MB                            | any more will cause issues                                                          |
| Data that can be sent using the [Trigger Event Reply](https://tray.ai/documentation/connectors/core/trigger-event-reply/) | 1 MB                            |                                                                                     |
| Data that can be consumed by our Webhook Trigger                                                                          | 1 MB                            | file content can be sent as multi-part http requests, with an overall limit of 10MB |
| Data that can be sent via the [Form Trigger](https://tray.ai/documentation/connectors/triggers/form-trigger/)             | 1 MB (10 MB for attached files) |                                                                                     |
| Data that can be attached to an [inbound email](https://tray.ai/documentation/connectors/triggers/email-trigger/)         | 10 MB                           |                                                                                     |

You can read more about Tray's technical limits [here](https://tray.io/documentation/platform/connectors/technical-limits-and-retry-info/).

## "Already part of another organization. Please leave the other organization if you want to join this one."

### Explanation

You'll get this error message when you reply to an email invitation to join a Tray organization and you already belong to another one.
You'll need to contact the owner of the other organization and have them delete you before you can join a new organization.
If you continue to have trouble, please contact us at <support@tray.io>.
![already-part-of-another-org](https://tray.ai/documentation/images/help/troubleshooting/error-messages/6PT7RspxsYuRG6ywpNJu0k_already-part-of-another-org.png)
