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

Multiple issues with dependencies during install of :amqp #54

Closed
garmoshka-mo opened this issue Feb 21, 2017 · 2 comments
Closed

Multiple issues with dependencies during install of :amqp #54

garmoshka-mo opened this issue Feb 21, 2017 · 2 comments

Comments

@garmoshka-mo
Copy link

To reproduce - generate fresh project:

mix new test
cd test/

Add this as specified in readme:

  def application do
    [applications: [:logger, :amqp]]
  end
...
  defp deps do
    [{:amqp, "0.2.0-pre.1"}]
  end

Then try to install:

$ mix deps.get
Could not find Hex, which is needed to build dependency :amqp
Shall I install Hex? (if running non-interactively, use: "mix local.hex --force") [Yn] Y

12:27:50.838 [error] Failed updating session:
   ProfileName: :httpc_mix
   SessionId:   {{'repo.hex.pm', 443}, #PID<0.119.0>}
   Pos:         9
   Value:       true
when
   Session (db) info: :undefined
   Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.119.0>}, false, :https,
 {:sslsocket, {:gen_tcp, #Port<0.4907>, :tls_connection, :undefined},
  #PID<0.120.0>}, {:essl, []}, 1, :keep_alive, false}
   Session (record):  {:EXIT,
 {:badarg,
  [{:ets, :lookup,
    [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.119.0>}], []},
   {:httpc_manager, :lookup_session, 2, [file: 'httpc_manager.erl', line: 189]},
   {:httpc_handler, :update_session, 4,
    [file: 'httpc_handler.erl', line: 1909]},
   {:httpc_handler, :maybe_make_session_available, 2,
    [file: 'httpc_handler.erl', line: 1516]},
   {:httpc_handler, :answer_request, 3,
    [file: 'httpc_handler.erl', line: 1507]},
   {:httpc_handler, :handle_response, 1,
    [file: 'httpc_handler.erl', line: 1251]},
   {:httpc_handler, :handle_info, 2, [file: 'httpc_handler.erl', line: 471]},
   {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 601]}]}}
   T: :error
   E: :badarg

12:27:50.855 [error] Failed updating session:
   ProfileName: :httpc_mix
   SessionId:   {{'repo.hex.pm', 443}, #PID<0.119.0>}
   Pos:         9
   Value:       true
when
   Session (db) info: :undefined
   Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.119.0>}, false, :https,
 {:sslsocket, {:gen_tcp, #Port<0.4907>, :tls_connection, :undefined},
  #PID<0.120.0>}, {:essl, []}, 1, :keep_alive, false}
   Session (record):  {:EXIT,
 {:badarg,
  [{:ets, :lookup,
    [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.119.0>}], []},
   {:httpc_manager, :lookup_session, 2, [file: 'httpc_manager.erl', line: 189]},
   {:httpc_handler, :update_session, 4,
    [file: 'httpc_handler.erl', line: 1909]},
   {:httpc_handler, :maybe_make_session_available, 2,
    [file: 'httpc_handler.erl', line: 1516]},
   {:httpc_handler, :answer_request, 3,
    [file: 'httpc_handler.erl', line: 1507]},
   {:httpc_handler, :terminate, 2, [file: 'httpc_handler.erl', line: 759]},
   {:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 629]},
   {:gen_server, :terminate, 7, [file: 'gen_server.erl', line: 795]}]}}
   T: :error
   E: :badarg

12:27:50.880 [error] GenServer #PID<0.119.0> terminating
** (stop) {:failed_updating_session, [profile: :httpc_mix, session_id: {{'repo.hex.pm', 443}, #PID<0.119.0>}, pos: 9, value: true, etype: :error, error: :badarg, stacktrace: [{:ets, :update_element, [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.119.0>}, {9, true}], []}, {:httpc_manager, :update_session, 4, [file: 'httpc_manager.erl', line: 210]}, {:httpc_handler, :update_session, 4, [file: 'httpc_handler.erl', line: 1887]}, {:httpc_handler, :maybe_make_session_available, 2, [file: 'httpc_handler.erl', line: 1516]}, {:httpc_handler, :answer_request, 3, [file: 'httpc_handler.erl', line: 1507]}, {:httpc_handler, :terminate, 2, [file: 'httpc_handler.erl', line: 759]}, {:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 629]}, {:gen_server, :terminate, 7, [file: 'gen_server.erl', line: 795]}]]}
    (inets) httpc_handler.erl:1911: :httpc_handler.update_session/4
    (inets) httpc_handler.erl:1516: :httpc_handler.maybe_make_session_available/2
    (inets) httpc_handler.erl:1507: :httpc_handler.answer_request/3
    (inets) httpc_handler.erl:759: :httpc_handler.terminate/2
    (stdlib) gen_server.erl:629: :gen_server.try_terminate/3
    (stdlib) gen_server.erl:795: :gen_server.terminate/7
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: {:ssl, {:sslsocket, {:gen_tcp, #Port<0.4907>, :tls_connection, :undefined}, #PID<0.120.0>}, <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 1, 2, 0, 104, 101, 120, 45, 48, 46, 49, 53, 46, 48, 47, 101, 98, 105, 110, 47, 69, 108, 105, 120, 105, 114, 46, 77, 105, 120, 46, 84, 97, 115, 107, ...>>}
State: {:state, {:request, #Reference<0.0.2.133>, #PID<0.71.0>, 0, :https, {'repo.hex.pm', 443}, '/installs/1.3.0/hex-0.15.0.ez', [], :get, {:http_request_h, :undefined, 'keep-alive', :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, 'repo.hex.pm', :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, [], 'Mix/1.3.1', :undefined, :undefined, :undefined, '0', :undefined, :undefined, :undefined, :undefined, :undefined, ...}, {[], []}, {:http_options, 'HTTP/1.1', :infinity, true, {:essl, []}, :undefined, true, :infinity, false}, 'https://repo.hex.pm/installs/1.3.0/hex-0.15.0.ez', [], :none, [], 1487680070263, :undefined, :undefined, false}, {:session, {{'repo.hex.pm', 443}, #PID<0.119.0>}, false, :https, {:sslsocket, {:gen_tcp, #Port<0.4907>, :tls_connection, :undefined}, #PID<0.120.0>}, {:essl, []}, 1, :keep_alive, false}, {'HTTP/1.1', 200, 'OK'}, {:http_response_h, 'public, max-age=604800', 'keep-alive', 'Tue, 21 Feb 2017 12:27:50 GMT', :undefined, :undefined, :undefined, :undefined, '1.1 varnish', :undefined, 'bytes', '354703', '"32639417cd22865fe37dd2eba7597f8a"', :undefined, :undefined, :undefined, 'AmazonS3', :undefined, :undefined, :undefined, :undefined, :undefined, '478371', :undefined, :undefined, :undefined, 'application/andrew-inset', :undefined, 'Fri, 23 Dec 2016 23:29:31 GMT', [{'x-amz-id-2', 'YcuzbLY69wJibQhxHS7Ab+vWP+pTax+yGM1tOYEYOuEp/rOmeUrWjnMU+NtwdILC9M/qM+uCaDQ='}, {'x-amz-request-id', '55D20D92FB98DA4B'}, {'x-amz-replication-status', 'FAILED'}, {'x-amz-meta-surrogate-key', 'installs'}, {'x-amz-version-id', 'OClpliznSKNcQv3EnXaKQigPoUrT5Ftm'}, {'fastly-debug-digest', '5db161298266899fd3e93f292ed51788ae6e376328c4d76c0190675b35234c98'}, {'x-served-by', 'cache-iad2130-IAD, cache-hhn1534-HHN'}, {'x-cache', 'HIT, HIT'}, {'x-cache-hits', '1, 1'}, {'x-timer', 'S1487680070.414301,VS0,VE0'}]}, :undefined, {:httpc_response, :whole_body, [<<80, 75, 3, 4, 20, 0, 0, 0, 0, 0, 137, 3, 152, 73, 173, 155, 214, 230, 32, 108, 0, 0, 32, 108, 0, 0, 34, 0, 0, 0, 104, 101, 120, 45, 48, 46, 49, 53, 46, 48, ...>>, 478371]}, {[], []}, {[], []}, :new, [], :nolimit, :nolimit, {:options, {:undefined, []}, {:undefined, []}, 0, 2, 5, 120000, 2, :disabled, false, :inet, :default, :default, []}, {:timers, [], :undefined}, :httpc_mix, :inactive}
* creating /home/vagrant/.mix/archives/hex-0.15.0
Running dependency resolution...
Dependency resolution completed:
  amqp 0.2.0-pre.1
  amqp_client 3.6.7-pre.1
  rabbit_common 3.6.7-pre.1
* Getting amqp (Hex package)
  Checking package (https://repo.hex.pm/tarballs/amqp-0.2.0-pre.1.tar)
  Fetched package
* Getting amqp_client (Hex package)
  Checking package (https://repo.hex.pm/tarballs/amqp_client-3.6.7-pre.1.tar)
  Fetched package
$ iex -S mix
Erlang/OTP 19 [erts-8.0.2] [source-753b9b9] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

Unchecked dependencies for environment dev:
* rabbit_common (Hex package)
  the dependency is not available, run "mix deps.get"
** (Mix) Can't continue due to errors on dependencies

Running mix. deps.get goes just fine 2nd time:

mix deps.get
Running dependency resolution...
* Getting rabbit_common (Hex package)
  Checking package (https://repo.hex.pm/tarballs/rabbit_common-3.6.7-pre.1.tar)
  Using locally cached package

But then problem of same nature happens with second dependency (rebar3):

$ iex -S mix
Erlang/OTP 19 [erts-8.0.2] [source-753b9b9] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

Could not find "rebar3", which is needed to build dependency :rabbit_common
I can install a local copy which is just used by Mix
Shall I install rebar3? (if running non-interactively, use: "mix local.rebar --force") [Yn] Y
* creating /home/vagrant/.mix/rebar

12:35:42.966 [error] Failed updating session:
   ProfileName: :httpc_mix
   SessionId:   {{'repo.hex.pm', 443}, #PID<0.138.0>}
   Pos:         9
   Value:       true
when
   Session (db) info: :undefined
   Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.138.0>}, false, :https,
 {:sslsocket, {:gen_tcp, #Port<0.5586>, :tls_connection, :undefined},
  #PID<0.139.0>}, {:essl, []}, 1, :keep_alive, false}
   Session (record):  {:EXIT,
 {:badarg,
  [{:ets, :lookup,
    [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.138.0>}], []},
   {:httpc_manager, :lookup_session, 2, [file: 'httpc_manager.erl', line: 189]},
   {:httpc_handler, :update_session, 4,
    [file: 'httpc_handler.erl', line: 1909]},
   {:httpc_handler, :maybe_make_session_available, 2,
    [file: 'httpc_handler.erl', line: 1516]},
   {:httpc_handler, :answer_request, 3,
    [file: 'httpc_handler.erl', line: 1507]},
   {:httpc_handler, :handle_response, 1,
    [file: 'httpc_handler.erl', line: 1251]},
   {:httpc_handler, :handle_info, 2, [file: 'httpc_handler.erl', line: 471]},
   {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 601]}]}}
   T: :error
   E: :badarg

12:35:42.967 [error] Failed updating session:
   ProfileName: :httpc_mix
   SessionId:   {{'repo.hex.pm', 443}, #PID<0.138.0>}
   Pos:         9
   Value:       true
when
   Session (db) info: :undefined
   Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.138.0>}, false, :https,
 {:sslsocket, {:gen_tcp, #Port<0.5586>, :tls_connection, :undefined},
  #PID<0.139.0>}, {:essl, []}, 1, :keep_alive, false}
   Session (record):  {:EXIT,
 {:badarg,
  [{:ets, :lookup,
    [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.138.0>}], []},
   {:httpc_manager, :lookup_session, 2, [file: 'httpc_manager.erl', line: 189]},
   {:httpc_handler, :update_session, 4,
    [file: 'httpc_handler.erl', line: 1909]},
   {:httpc_handler, :maybe_make_session_available, 2,
    [file: 'httpc_handler.erl', line: 1516]},
   {:httpc_handler, :answer_request, 3,
    [file: 'httpc_handler.erl', line: 1507]},
   {:httpc_handler, :terminate, 2, [file: 'httpc_handler.erl', line: 759]},
   {:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 629]},
   {:gen_server, :terminate, 7, [file: 'gen_server.erl', line: 795]}]}}
   T: :error
   E: :badarg

12:35:42.987 [error] GenServer #PID<0.138.0> terminating
** (stop) {:failed_updating_session, [profile: :httpc_mix, session_id: {{'repo.hex.pm', 443}, #PID<0.138.0>}, pos: 9, value: true, etype: :error, error: :badarg, stacktrace: [{:ets, :update_element, [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.138.0>}, {9, true}], []}, {:httpc_manager, :update_session, 4, [file: 'httpc_manager.erl', line: 210]}, {:httpc_handler, :update_session, 4, [file: 'httpc_handler.erl', line: 1887]}, {:httpc_handler, :maybe_make_session_available, 2, [file: 'httpc_handler.erl', line: 1516]}, {:httpc_handler, :answer_request, 3, [file: 'httpc_handler.erl', line: 1507]}, {:httpc_handler, :terminate, 2, [file: 'httpc_handler.erl', line: 759]}, {:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 629]}, {:gen_server, :terminate, 7, [file: 'gen_server.erl', line: 795]}]]}
    (inets) httpc_handler.erl:1911: :httpc_handler.update_session/4
    (inets) httpc_handler.erl:1516: :httpc_handler.maybe_make_session_available/2
    (inets) httpc_handler.erl:1507: :httpc_handler.answer_request/3
    (inets) httpc_handler.erl:759: :httpc_handler.terminate/2
    (stdlib) gen_server.erl:629: :gen_server.try_terminate/3
    (stdlib) gen_server.erl:795: :gen_server.terminate/7
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: {:ssl, {:sslsocket, {:gen_tcp, #Port<0.5586>, :tls_connection, :undefined}, #PID<0.139.0>}, <<179, 208, 236, 238, 148, 180, 83, 8, 33, 252, 119, 167, 120, 208, 244, 210, 118, 222, 247, 121, 59, 211, 52, 133, 55, 213, 34, 216, 10, 120, 133, 64, 182, 196, 36, 163, 120, 179, 223, 199, 131, 41, 15, 135, 135, 222, 229, 109, ...>>}
State: {:state, {:request, #Reference<0.0.1.182>, #PID<0.80.0>, 0, :https, {'repo.hex.pm', 443}, '/installs/1.0.0/rebar-2.6.2', [], :get, {:http_request_h, :undefined, 'keep-alive', :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, 'repo.hex.pm', :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, :undefined, [], 'Mix/1.3.1', :undefined, :undefined, :undefined, '0', :undefined, :undefined, :undefined, :undefined, :undefined, ...}, {[], []}, {:http_options, 'HTTP/1.1', :infinity, true, {:essl, []}, :undefined, true, :infinity, false}, 'https://repo.hex.pm/installs/1.0.0/rebar-2.6.2', [], :none, [], 1487680542620, :undefined, :undefined, false}, {:session, {{'repo.hex.pm', 443}, #PID<0.138.0>}, false, :https, {:sslsocket, {:gen_tcp, #Port<0.5586>, :tls_connection, :undefined}, #PID<0.139.0>}, {:essl, []}, 1, :keep_alive, false}, {'HTTP/1.1', 200, 'OK'}, {:http_response_h, 'public, max-age=604800', 'keep-alive', 'Tue, 21 Feb 2017 12:35:42 GMT', :undefined, :undefined, :undefined, :undefined, '1.1 varnish', :undefined, 'bytes', '368449', '"9b5bfb52e8b106dc5ef1bb1e21cf7485"', :undefined, :undefined, :undefined, 'AmazonS3', :undefined, :undefined, :undefined, :undefined, :undefined, '204449', :undefined, :undefined, :undefined, 'binary/octet-stream', :undefined, 'Tue, 28 Jun 2016 23:59:10 GMT', [{'x-amz-id-2', 'rMDvTzlux7WLEr8DqnkEUqM8Y3dMcP0CxVJQ4AAiWZnepvpoD2VfetTbx7K+F3pN/uYEnQuTEQM='}, {'x-amz-request-id', '737D5A3C20A8DA41'}, {'x-amz-replication-status', 'COMPLETED'}, {'x-amz-meta-surrogate-key', 'installs'}, {'x-amz-version-id', '0cgtvdRF75tyFYn.QPwoiys8_8hU2tMn'}, {'fastly-debug-digest', 'd858d9a6a6c39f818898cfe6e8ecb325cc9c225033a5896c7be5e5df1ba34d4d'}, {'x-served-by', 'cache-iad2131-IAD, cache-hhn1528-HHN'}, {'x-cache', 'HIT, HIT'}, {'x-cache-hits', '1, 1'}, {'x-timer', 'S1487680542.770337,VS0,VE0'}]}, :undefined, {:httpc_response, :whole_body, [<<35, 33, 47, 117, 115, 114, 47, 98, 105, 110, 47, 101, 110, 118, 32, 101, 115, 99, 114, 105, 112, 116, 10, 37, 37, 10, 37, 37, 33, 32, 45, 112, 97, 32, 114, 101, 98, 97, 114, 47, ...>>, 204449]}, {[], []}, {[], []}, :new, [], :nolimit, :nolimit, {:options, {:undefined, []}, {:undefined, []}, 0, 2, 5, 120000, 2, :disabled, false, :inet, :default, :default, []}, {:timers, [], :undefined}, :httpc_mix, :inactive}
* creating /home/vagrant/.mix/rebar3
===> Compiling rabbit_common
===> Compiling amqp_client
==> amqp
Compiling 9 files (.ex)
Generated amqp app
==> test
Compiling 1 file (.ex)
Generated test app
Interactive Elixir (1.3.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> {:ok, conn} = AMQP.Connection.open
@pma
Copy link
Owner

pma commented Feb 21, 2017

@garmoshka-mo I think this is actually two separate issues.

cc @ono

  1. Mix only picks up rabbit_common as a dependency on a second run. I can confirm that dependency resolution is not working as expected for amqp_client 3.6.7-pre.1. For some reason Mix is not determining that rabbit_common is a dependency on the first run. This could be an issue with Mix itself or with how the latest amqp_client package was published.

As a workaround, amqp, could dependency explicitly on rabbit_common or for now you could dependent explicitly on rabbit_common in your application mix.exs.

  1. The other issue (inets/ssl stackstrace) seems unrelated with the amqp lib. It's the Mix plugins complaining about HTTPS/TLS errors. I suspect your Erlang installation is missing some SSL related libraries. Some Linux distros split Erlang into several packages. It may be that you only installed the base package and are missing the SSL related ones. You could alternatively try using Erlang Solutions packages, which include the full Erlang VM and all libraries (https://www.erlang-solutions.com/resources/download.html).

@ono
Copy link
Collaborator

ono commented Feb 21, 2017

Thanks @garmoshka-mo for reporting. Hope @pma's advise will help you to sort it out.

I merged #55 and released 0.2.0-pre.2. It should fix the issue rabbit_common is not installed at first mix deps.get run.

@ono ono closed this as completed Mar 28, 2017
ashkan18 added a commit to ashkan18/APR that referenced this issue Apr 20, 2017
ashkan18 added a commit to artsy/APR that referenced this issue Apr 20, 2017
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

3 participants