Affected: Relay Proxy v2.x, server-side SDKs
Symptoms
When attempting to use server-side streaming endpoints, the Relay does not serve a 400 status code.
Cause
The Relay Proxy itself is not configured to serve 400 status codes for server-side streaming endpoints. This behavior is by design and aligns with its intended functionality.
Solution
If you are encountering 400 status codes and want to look into them further, follow these steps:
-
Enable debug logging:
- Enable debug logging on the Relay to monitor all incoming requests and their respective status codes.
- Confirm that no 400 status codes are being logged for server-side streaming endpoints.
Example:./ld-relay --log-level debug
-
Identify the source of the 400 status code:
- If the Relay Proxy does not log any 400 status codes, investigate other components in your architecture that might be returning the 400 error.
- Use the SDK’s "Monitor SDK Status" feature to gather more information about connectivity issues and the reasons behind any failures.
Example:ldClient.on('error', (err) => { console.error('LaunchDarkly SDK encountered an error:', err); });
-
Check client-side SDK connections and event ingestion:
- The Relay’s client-side flag delivery endpoints can return a 400 if the context provided is not formatted correctly. Ensure that the SDK sends properly formatted contexts.
- Similarly, the Relay’s event ingestion endpoint could respond with a 400 if the request body is unreadable or empty. Ensure the SDK sends properly formatted request bodies.
Example:curl -X POST "https://relay.example.com/events" -H "Content-Type: application/json" -d '{"key": "value"}'