Elixir: mix local.hex fails

Created on 1 Dec 2016  路  4Comments  路  Source: elixir-lang/elixir

Environment

  • Elixir version (elixir -v): 1.3.4
  • Operating system: Ubuntu 14.10

I have a problem as follows:

$ mix local.hex --force

18:48:09.477 [error] Failed updating session:
   ProfileName: :httpc_mix
   SessionId:   {{'repo.hex.pm', 443}, #PID<0.103.0>}
   Pos:         7
   Value:       0
when
   Session (db) info: :undefined
   Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.103.0>}, false, :https,
 {:sslsocket, {:gen_tcp, #Port<0.4024>, :tls_connection, :undefined},
  #PID<0.107.0>}, {:essl, []}, 1, :keep_alive, true}
   Session (record):  {:EXIT,
 {:badarg,
  [{:ets, :lookup,
    [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.103.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, :handle_empty_queue, 4,
    [file: 'httpc_handler.erl', line: 1368]},
   {:httpc_handler, :handle_info, 2, [file: 'httpc_handler.erl', line: 471]},
   {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 601]},
   {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 667]},
   {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}
   T: :error
   E: :badarg

18:48:09.478 [error] Failed updating session:
   ProfileName: :httpc_mix
   SessionId:   {{'repo.hex.pm', 443}, #PID<0.103.0>}
   Pos:         9
   Value:       true
when
   Session (db) info: :undefined
   Session (db):      {:session, {{'repo.hex.pm', 443}, #PID<0.103.0>}, false, :https,
 {:sslsocket, {:gen_tcp, #Port<0.4024>, :tls_connection, :undefined},
  #PID<0.107.0>}, {:essl, []}, 1, :keep_alive, false}
   Session (record):  {:EXIT,
 {:badarg,
  [{:ets, :lookup,
    [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.103.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

18:48:09.484 [error] GenServer #PID<0.103.0> terminating
** (stop) {:failed_updating_session, [profile: :httpc_mix, session_id: {{'repo.hex.pm', 443}, #PID<0.103.0>}, pos: 9, value: true, etype: :error, error: :badarg, stacktrace: [{:ets, :update_element, [:httpc_mix__session_db, {{'repo.hex.pm', 443}, #PID<0.103.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.4024>, :tls_connection, :undefined}, #PID<0.107.0>}, "HTTP/1.1 200 OK\r\nx-amz-id-2: rVbu9Hks72oOkwrB4hstdeCx95KLKJny7nTICQj3RLaAAkfD4VXlzdytXrvWzI8ynfso7u6aARs=\r\nx-amz-request-id: 11FB26DBD31BCB38\r\nx-amz-replication-status: FAILED\r\nLast-Modified: Fri, 25 Nov 2016 00:15:08 GMT\r\nETag: \"b4ca44f66ef8ebef3d8cc3d0cc46b873\"\r\nx-amz-version-id: ZJONu5HWk3s4s23KeKrWXXBABMRF8Jpi\r\nContent-Type: text/csv\r\nServer: AmazonS3\r\nContent-Length: 1136\r\nAccept-Ranges: bytes\r\nDate: Thu, 01 Dec 2016 18:48:09 GMT\r\nVia: 1.1 varnish\r\nAge: 1807\r\nConnection: keep-alive\r\nX-Served-By: cache-iad2130-IAD\r\nX-Cache: HIT\r\nX-Cache-Hits: 6\r\nX-Timer: S1480618089.446922,VS0,VE0\r\n\r\n0.14.0,b8a849be7e731f8d844229c029107e281364b55fe257d0f6d6ea9f7224d8c414d2ec2f0dee4bcdd9bc7672cab6c9d19e7e6bbb0539c740678fb6047821ce363d,1.0.0\n0.14.0,7559bc4e6ffd3e2bd6473aa9b10e1196d0fc0d802a01d9c562e69fc86883f03d4ef025db8bad9848482c67daee1c400eea88a2e2fdc527f8aa7a54e1ea7bdddf,1.1.0\n0.14.0,161cdc94010b31b11f8a19983617742a701ba7da82714dcc45157e1f9073206abd925710232a53514968aab8b4a05a8176c8273c44d4ba49e633f79bc3a015e6,1.2.0\n0.14.0,c22f832b3e4cb35851aeb26a7d592034901e0f9dc2bdeb2ec11f94fefedb837fefc169f834723e6f4bff2e3c5d5dfaf20b183229d2b459a69fafffe57a7132c0,1.3.0\n0.14.1,bdf1bd2c8774e6e7cdaa1844d8c17fd73b22e885f2ea84dc097b052eafdf830d127f056e7a5aea807671fc29ca9448965b662637d47c2089e52529f6fc4e6d91,1.0.0\n0.14.1,20cc9c2b5fac6ec133aef5da5feec428d2319e1df0879eff2bb51b812687a518fd9c8ecba36fd43c29239dee0cf4a08a5535d90f7c1769405b253580bbf6fc6c,1.1.0\n0.14.1,d8b194931a96cddba0bdb4ff4fbf9515991927f4173713585edf853fd20c614768325a94643bc072717e88dbc1e4fa17a62c1ad34444064a722fe4279f6c9d20,1.2.0\n0.14.1,73ea894bc78d18255a0a8d9f42d9eb0ffb43f83aeaecc7b5beb41dd5cc553e222ba0734ed6d22c8d9aed41f72806eb4de781d1d6728d2d9a7cdfc20e924eaf2a,1.3.0\n"}
State: {:state, {:request, #Reference<0.0.3.281>, #PID<0.71.0>, 0, :https, {'repo.hex.pm', 443}, '/installs/hex-1.x.csv', [], :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.4', :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/hex-1.x.csv', [], :none, [], 1480618089202, :undefined, :undefined, false}, {:session, {{'repo.hex.pm', 443}, #PID<0.103.0>}, false, :https, {:sslsocket, {:gen_tcp, #Port<0.4024>, :tls_connection, :undefined}, #PID<0.107.0>}, {:essl, []}, 1, :keep_alive, false}, :undefined, :undefined, :undefined, {:httpc_response, :parse, [:nolimit, true]}, {[], []}, {[], []}, :new, [], :nolimit, :nolimit, {:options, {:undefined, []}, {:undefined, []}, 0, 2, 5, 120000, 2, :disabled, false, :inet, :default, :default, []}, {:timers, [], :undefined}, :httpc_mix, :inactive}
* creating .mix/archives/hex-0.14.1

How to solve that?

Most helpful comment

The errors come from a race condition when the process is closing. Since it only happens when the OS process is done with everything it has no effect. I agree that the error output is annoying though.

It has been reported upstream and should be fixed in the coming OTP 19.2 release. https://bugs.erlang.org/browse/ERL-253

All 4 comments

What is your Erlang version?

Btw it seems the command succeeded after all?

root@ddee989595ea:~# erl -v
Erlang/OTP 19 [erts-8.1.1] [source] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V8.1.1  (abort with ^G)
1>

It seems it worked but why these errors are there?

It is an internal error with httpc. I believe @ericmj would be able to expand on them and he has likely already reported it. :)

The errors come from a race condition when the process is closing. Since it only happens when the OS process is done with everything it has no effect. I agree that the error output is annoying though.

It has been reported upstream and should be fixed in the coming OTP 19.2 release. https://bugs.erlang.org/browse/ERL-253

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GianFF picture GianFF  路  3Comments

LucianaMarques picture LucianaMarques  路  3Comments

vothane picture vothane  路  3Comments

lukaszsamson picture lukaszsamson  路  3Comments

sashaafm picture sashaafm  路  3Comments