Affected: All SDKs
Symptoms
When running an SDK and the SDK never finishes initializing, or one or more of these errors appears:
-
WARN: Error in stream connection (will retry):
Get "https://stream.launchdarkly.com/all": Forbidden -
WARN: Error in stream connection (will retry): EOF
-
* When using some form of variationDetail *
reason={'kind': 'ERROR', 'errorKind': 'CLIENT_NOT_READY'
Cause
These errors could occur if the SDK is unable to successfully make a long-lived streaming connection with LaunchDarkly servers.
If you are in AWS, then application load balancers (ALBs), by default, disconnect idle connections after 60 seconds of inactivity. The SDK sends one byte of data every 3 minutes to keep the connection alive. Since the SDK's heartbeat is 3 minutes, and ALBs' timeout is only 1 minute, ALB will keep closing the connection before the SDK has a chance to send its heartbeat.
Solution
To resolve these errors, our domains and/or public IPs need to be allow-listed. This could happen anywhere in the network, such as a VPN, firewall, or load balancer.
In AWS,
- Follow the instructions listed in the ALB documentation.
- Set the "Idle timeout" to a value >180 seconds (3 minutes).