launchdarkly/erlang-server-sdk

Error establishing streaming connection

Cgboal opened this issue · 4 comments

Describe the bug
Launchdarkly SDK fails to establish a streaming connection. I validated this by using the hello-elixir application with version 1.4 of the launchdarkly erlang sdk.

To reproduce
Clone hello-elixir, bump to version 1.4, run application, start genserver (see hello-elixir readme).

Expected behavior
Streaming connection establishes succesfully and SDK functions.

Logs

iex(1)> {:ok, pid} = HelloElixir.start

10:57:39.865 [notice] Starting instance supervisor for :default with name :ldclient_instance_default

10:57:39.873 [notice] Starting event supervisor for :default with name :ldclient_instance_events_default

10:57:39.875 [notice] Starting event storage server for :default with name :ldclient_event_server_default

10:57:39.876 [notice] Starting event processor for :default with name :ldclient_event_process_server_default

10:57:39.880 [notice] Starting ets server with name :ldclient_storage_ets_server_default

10:57:39.882 [notice] Starting streaming update server for :default

10:57:39.883 [notice] Starting streaming connection to URL: 'https://stream.launchdarkly.com/all'
{:ok, #PID<0.314.0>}
iex(2)>
10:57:39.898 [warning] Error establishing streaming connection (:error): :undef, will retry in 1000 ms

10:57:40.898 [notice] Reconnecting streaming connection...

10:57:40.899 [warning] Error establishing streaming connection (:error): :undef, will retry in 2991 ms

nil
iex(3)>
10:57:43.891 [notice] Reconnecting streaming connection...

10:57:43.891 [warning] Error establishing streaming connection (:error): :undef, will retry in 3459 ms

SDK version
1.4

Language version, developer tools

Erlang/OTP 25 [erts-13.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

OS/platform
MacOS Monterey 12.2.1

Additional context
This also happens in applications I have using launchdarkly. Polling connections function fine.

Hello @Cgboal,

I will look into this, but before we get too far are you seeing

dependency :shotgun is using Rebar 2, which is no longer maintained and no longer works in recent Erlang/OTP versions. Remove the :manager option or set it to :rebar3 instead

When you do mix deps.get?

And if so can you add:
{:shotgun, "~> 0.5.0", manager: :rebar3, override: true}
to the mix.exs

(I need to do a release updating to 0.5.3 that fixes this.)

Filed internally as 157515

Thank you,
Ryan

Hi,

Yeah I am using {:shotgun, "~> 0.5.0", manager: :rebar3, override: true} in my mix.exs file as per the other open issue on this repo.

Cheers,
Calum

@Cgboal Thank you. I am seeing the connection issue as well, and will see if I can get it sorted.

@Cgboal This was caused by the removal of http_string:parse in OTP 25. We have released version 1.5 which switches to uri_string:parse and should address your problem. Additionally it should no longer be required to override shotgun, becasue 0.5.3 corrects the dependency.

Thank you!
-Ryan