You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Event source returned unexpected content type '' #210
I'm attempting to update our code to use v7.0.2 of the ruby SDK. I'm receiving the following error when I try to boot up a client:
[2023-02-22T18:08:50] INFO | [LDClient] Initializing stream connection
[2023-02-22T18:08:50] INFO | Connecting to event stream at https://stream.launchdarkly.com/all
[2023-02-22T18:08:50] WARN | Event source returned unexpected content type ''
...
# Times out, then retries ad nauseum
Tracing this bug backwards, I was able to reproduce starting in v6.0.0.
After doing a little code spelunking in the ld-eventsource plugin, I ran the following code to see if something weird is going on with the http request:
cxn.headers["content-type"] is evaluating to an empty string, while cxn.headers["Content-Type"] evaluates to the correct value (text/event-stream; charset=utf-8). Correcting this locally establishes the connection without issue.
Hello @matt-dutchie, thank you so much for the report and investigation. To clarify, the issue is that while the Ruby SDK can connect to LaunchDarkly's backend and get flag data, it keeps splitting out this warning in the logs because of the upper-lower cases mismatch that you identified - is that correct?
Ah -- sorry, I misunderstood your comment. We were not able to connect without this change, the casing was causing an error not a warning and the initialization of the client was timing out.
I will still need to cut a release for you for both the event source and the SDK before this is fully resolved. There are some internal blockers at the moment but I will work to get this done by early next week at the latest.
Activity
matt-dutchie commentedon Feb 23, 2023
After some more exploration, it appears that the issue is with this line in the ruby-eventsource library:
https://github.com/launchdarkly/ruby-eventsource/blob/main/lib/ld-eventsource/client.rb#L271
cxn.headers["content-type"]is evaluating to an empty string, whilecxn.headers["Content-Type"]evaluates to the correct value (text/event-stream; charset=utf-8). Correcting this locally establishes the connection without issue.louis-launchdarkly commentedon Mar 1, 2023
Hello @matt-dutchie, thank you so much for the report and investigation. To clarify, the issue is that while the Ruby SDK can connect to LaunchDarkly's backend and get flag data, it keeps splitting out this warning in the logs because of the upper-lower cases mismatch that you identified - is that correct?
Keeping track of this issue with 190660.
matt-dutchie commentedon Mar 2, 2023
@louis-launchdarkly Yea, it works after tweaking the casing on the header access. I've opened a PR against the other lib here: launchdarkly/ruby-eventsource#36
matt-dutchie commentedon Mar 3, 2023
Ah -- sorry, I misunderstood your comment. We were not able to connect without this change, the casing was causing an error not a warning and the initialization of the client was timing out.
matt-dutchie commentedon Mar 10, 2023
This should be fixed by my PR against ruby-eventsource, closing!
keelerm84 commentedon Mar 10, 2023
I will still need to cut a release for you for both the event source and the SDK before this is fully resolved. There are some internal blockers at the moment but I will work to get this done by early next week at the latest.
Thanks again for your contribution!
Support included / excluded contexts in segments (#210)
prepare 7.0.3 release (#211)
keelerm84 commentedon Mar 17, 2023
Sorry for the delay, but this has been fixed in 7.0.3
prepare 7.0.4 release (#215)
prepare 7.1.0 release (#217)
prepare 7.2.0 release (#218)
prepare 7.0.0 release (launchdarkly#207)
prepare 7.0.1 release (launchdarkly#208)
prepare 7.0.2 release (launchdarkly#209)