Troubleshoot Optimizely Graph errors in C# SDK
Leatn more about Optimizely Graph errors, their causes, and how to resolve them.
When a request to Optimizely Graph fails, the service returns an HTTP status code and a specific error code that describes the problem. These errors usually occur because of authentication issues, invalid queries, or content that has not yet synchronized to the Graph index.
This reference lists common errors returned by Optimizely Graph, explains their typical causes, and provides guidance on how to resolve them. Use this information to diagnose problems in your queries and configuration more quickly.
WarningNever include API keys or secrets when sharing error details.
Common errors
400 — BAD_REQUEST
BAD_REQUESTMessage
Bad Request — the GraphQL request is malformed.
Possible causes
- The GraphQL query syntax is invalid.
- A field name is misspelled.
- The request body is not valid JSON.
- Required query parameters are missing.
Resolution:
- Check the error response body for details about the failure.
- Validate the query syntax for missing braces, parentheses, or quotation marks.
- Confirm that all required parameters are included in the request.
404 – NOT_FOUND
NOT_FOUNDMessage:
Not Found — the requested endpoint or content does not exist.
Cause: The content hasn't been synchronized to Optimizely Graph yet.
Possible cause Run the Graph Full Synchronization scheduled job in CMS. Once it completes, retry your query.
500 – INTERNAL_ERROR
INTERNAL_ERRORMessage
Internal Server Error — service issues
Possible causes
- Content Graph service is experiencing issues
- Query complexity exceeds processing limits
- Unexpected server-side errors
Resolution
- Simplify the query by reducing the result set or removing complex filters.
- If the issue persists, contact Optimizely support and include the
correlation-idvalue from the response header.
Authentication errors
401 – GRAPH_AUTH_FAILED
Message
Authentication failed – invalid or missing API key
Possible causes
AppKeyorSecretis not configured inappsettings.json- The configured keys are incorrect
Resolution
Verify that your appsettings.json (or environment variables) contain the correct values:
{
"Optimizely": {
"Graph": {
"Endpoint": "https://cg.optimizely.com",
"AppKey": "YOUR APPKEY HERE",
"Secret": "YOUR SECRET KEY HERE"
}
}
}See Authentication for credential setup.
Query errors
400 – GRAPH_QUERY_INVALID
GRAPH_QUERY_INVALIDMessage:
Query validation failed — syntax errors in GraphQL query
Possible causes
- Malformed lambda expressions in
.Where()clauses - Invalid filter expressions or comparison operators
- Incorrect method chaining order
- Missing brackets or parentheses
Resolution
-
Verify all brackets and parentheses are balanced
-
Check that
.Where()expressions use supported comparison operators -
Confirm methods are chained in a valid order, such as:
Where→OrderBy→Skip/Limit→GetAsContentAsync -
Build up the query step by step to identify the method causing the issue
400 – GRAPH_FIELD_UNKNOWN
GRAPH_FIELD_UNKNOWNMessage:
Unknown field – querying non-existent properties
Possible causes
- Field name is misspelled in the query
- Property doesn't exist on the content type
- Property isn't indexed in Content Graph
- Case-sensitivity mismatch (field names are case-sensitive)
Resolution
- Verify the exact spelling and casing of the field name.
- Confirm that the property exists on the content type.
- Confirm that the property is indexed in Content Graph.
- If you recently added the property, trigger reindexing by running the Graph Full Synchronization scheduled job in CMS.
Updated 13 days ago
