Skip to content
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

Unexpected event in state :domain_lookup of type :info: #275

Open
riccardomanfrin opened this issue Aug 3, 2021 · 2 comments
Open

Unexpected event in state :domain_lookup of type :info: #275

riccardomanfrin opened this issue Aug 3, 2021 · 2 comments

Comments

@riccardomanfrin
Copy link

Ciao,

I'm opening a listening socket with netcat nc -l 127.0.0.2 8081.
Than I'm opening a gun connection like so:

gunopts = %{
      connect_timeout: 100,
      retry_timeout: 500,
      protocols: [:http2],
      http2_opts: %{
        keepalive: 15000,
        max_decode_table_size: 0,
        max_encode_table_size: 0
      }
    }
   {:ok, gunpid} = :gun.open(addr, port, gunopts)
   {:ok, protocol} = :gun.await_up(gunpid)

and I see the PRI * HTTP/2.0 section in netcat.
Roughly half a second later I get this message:

15:37:28.233 [error] [pid=<0.868.0> ] - Unexpected event in state :domain_lookup of type :info:
{:timeout, #Reference<0.3804564456.1687945217.62829>, {:cow_http2_machine, :undefined, :settings_timeout}}
{:state, #PID<0.857.0>, {:up, #Reference<0.3804564456.1687945217.62825>},
 {127, 0, 0, 2}, 8081, "http", {127, 0, 0, 2}, 8081, [],
 %{
   connect_timeout: 100,
   http2_opts: %{
     keepalive: 15000,
     max_decode_table_size: 0,
     max_encode_table_size: 0
   },
   protocols: [:http2],
   retry_timeout: 500
 }, :undefined, :undefined, :gun_tcp, true, {:tcp, :tcp_closed, :tcp_error},
 :undefined, :undefined, :undefined, :gun_default_event_h, :undefined}

I'm new to http2, gun and most things in this world, and I know that a netcat socket doing nothing is not exactly an HTTP/2 server, but I don't quite understand this error (the domain_lookup state thing in particular), and even more, how to catch it (since the connection is gone after it).

Thanks in advance for your help

@essen
Copy link
Member

essen commented Aug 3, 2021

I'm not sure why you're in the domain_lookup state, but that error is otherwise expected: the server doesn't acknowledge the initial SETTINGS frame and as a result the connection is dropped. You are not going to be able to get a connection using simply netcat.

That said the error should probably be fixed, thanks for reporting!

@riccardomanfrin
Copy link
Author

yw, thanks for the fast reply too

@essen essen added this to the 2.0 milestone Mar 3, 2022
@essen essen removed this from the 2.0 milestone Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants