-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent invalid sdk key error when restarting relay proxy #113
Comments
Hmm. Even though the symptoms are similar, I don't think this is related to the other problem you reported— that one had a very specific cause. Since this one is intermittent it may be harder to reproduce, but I think I know the area of the code to look at; investigating. |
Shouldn't be too difficult to reproduce, it happens fairly often for me (>10% of the time) |
@simonkotwicz I do know the cause and can reproduce it with test-instrumented versions of the Relay components, but I think it'll inevitably be harder for us to reproduce with a real Relay instance in our test environment than it is for you, because we have very low latency for requests to our own LD servers. The longer it takes for Relay to contact LD and obtain the auto-config data, the more likely it is for a client to be able to get in with a request during that interval. This one is slightly harder to fix than the other bug, because we need to add a kind of synchronization that wasn't present before, but we're aiming to include fixes for both of these in the next patch release soon. |
Oh ok, it should be possible to reproduce just on a local machine running the ld relay docker image and client locally. |
…load update Go SDK to 4.14.1 for event payload ID fix
We've released version 6.1.1, which should fix this. The behavior now should be that if an SDK client makes a request while the Relay Proxy is still starting up and hasn't received its configuration from LD yet, so it does not know about any SDK keys yet, the response will be a 503 error rather than a 401. A 503 will cause the client to retry using a backoff. This is consistent with how the Relay Proxy behaves (regardless of whether automatic configuration is enabled) if a client gets a request in early during startup when we do know the SDK for the environment, but haven't yet received the flags for that environment from LD. |
Describe the bug
If you use the relay proxy automatic configuration profile and restart the relay proxy while some clients are running you sometimes get a 401 invalid SDK key error. Seems to be some kind of race condition where the relay proxy server doesn't wait and properly initialize itself before starting to listen for connections.
To reproduce
docker run --rm -p 8030:8030 --name ld-relay -e AUTO_CONFIG_KEY="***" launchdarkly/ld-relay
)ERROR: Error in stream connection (giving up permanently): HTTP error 401 (invalid SDK key)
Relay version
launchdarkly/ld-relay@sha256:2a3bdc8d8adf774a1631d7f13bacac5a8e9e89cdb2ce84f662104a3bb4be11fa
Client code
may be related to #112
The text was updated successfully, but these errors were encountered: