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

Crash during Mix.install([:jason]) #996

Closed
lukaszsamson opened this issue May 31, 2023 · 4 comments
Closed

Crash during Mix.install([:jason]) #996

lukaszsamson opened this issue May 31, 2023 · 4 comments

Comments

@lukaszsamson
Copy link

Versions

Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.14.5 (compiled with Erlang/OTP 25)
hex 2.0.6

Report

iex(1)> Mix.install([:jason])
Resolving Hex dependencies...
Resolution completed in 0.013s
New:
  jason 1.4.0
* Getting jason (Hex package)

16:50:56.327 [error] GenServer Hex.Registry.Server terminating
** (ArgumentError) errors were found at the given arguments:

  * 1st argument: the table identifier does not refer to an existing ETS table

    (stdlib 4.3.1) :ets.insert(nil, {:last_update, {{2023, 5, 31}, {14, 50, 56}}})
    (hex 2.0.6) lib/hex/registry/server.ex:203: Hex.Registry.Server.handle_call/3
    (stdlib 4.3.1) gen_server.erl:1149: :gen_server.try_handle_call/4
    (stdlib 4.3.1) gen_server.erl:1178: :gen_server.handle_msg/6
    (stdlib 4.3.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message (from Hex.UpdateChecker): {:last_update, {{2023, 5, 31}, {14, 50, 56}}}
State: %{closing_fun: nil, ets: nil, fetched: MapSet.new([]), path: nil, pending: MapSet.new([]), waiting: %{}}
Client Hex.UpdateChecker is alive

    (stdlib 4.3.1) gen.erl:256: :gen.do_call/4
    (elixir 1.14.5) lib/gen_server.ex:1035: GenServer.call/3
    (hex 2.0.6) lib/hex/update_checker.ex:76: Hex.UpdateChecker.handle_info/2
    (stdlib 4.3.1) gen_server.erl:1123: :gen_server.try_dispatch/4
    (stdlib 4.3.1) gen_server.erl:1200: :gen_server.handle_msg/6
    (stdlib 4.3.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
 
16:50:56.344 [error] GenServer Hex.UpdateChecker terminating
** (stop) exited in: GenServer.call(Hex.Registry.Server, {:last_update, {{2023, 5, 31}, {14, 50, 56}}}, 60000)
    ** (EXIT) an exception was raised:
        ** (ArgumentError) errors were found at the given arguments:

  * 1st argument: the table identifier does not refer to an existing ETS table

            (stdlib 4.3.1) :ets.insert(nil, {:last_update, {{2023, 5, 31}, {14, 50, 56}}})
            (hex 2.0.6) lib/hex/registry/server.ex:203: Hex.Registry.Server.handle_call/3
            (stdlib 4.3.1) gen_server.erl:1149: :gen_server.try_handle_call/4
            (stdlib 4.3.1) gen_server.erl:1178: :gen_server.handle_msg/6
            (stdlib 4.3.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
    (elixir 1.14.5) lib/gen_server.ex:1038: GenServer.call/3
    (hex 2.0.6) lib/hex/update_checker.ex:76: Hex.UpdateChecker.handle_info/2
    (stdlib 4.3.1) gen_server.erl:1123: :gen_server.try_dispatch/4
    (stdlib 4.3.1) gen_server.erl:1200: :gen_server.handle_msg/6
    (stdlib 4.3.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {#Reference<0.2874879593.3228631046.49008>, {:installs, {:ok, {200, "0.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\n0.15.0,c83863b551e9ac49f3b6371bc4b11c1636df989d0c2389185baf7f9162d7ca7af26fe3361c11403f16ced84ac8d097f7f5df162e5cdf407d40f42a995668c750,1.0.0\n0.15.0,ceb0e88ca09e11e4e4910132787ac15e550b7b01e130a0d05540193c8410627c23c431077d9cef63503eb65271d26cdaa092d990c82000f7413de2d1dcca9803,1.1.0\n0.15.0,32b0008cfa11a46e883387047b3fd4b8d7bd291d7e97a8e39b5f27d867640793f161af067266f2832d41336d2c2db6013e0dec5ed4977f998055796e10a610a3,1.2.0\n0.15.0,f09cd159080aa50d41d9098cb38e020d006ec139ca8c839ef0b720567a9acc3b6e93a989ca923239ec98f92e4e401e62b38239d0038ceec86af4bd9596bd8e98,1.3.0\n0.16.0,87758b49a6472ec54407ec68c38ec5b7b6dd1d543ff489bc58c8ad285daea38ed43cb9bff1678add803d95d4dcc2b5828ab9dfefeb29c3e52bb2174c6797e68c,1.0.0\n0.16.0,094c4a07a958cd99acfb6f8bee62d8433aaedaa82c0376beb9fa718ffb00b16dd97b879c2955afd960e59381bc1f22cdfaa200f02b8e1f7042d5387c5f782763,1.1.0\n0.16.0,1d05266fac2e741c58f003f70b1ea0c5aae7008c64d203ed05de3a8a0fafa2b680c8f9e7473bc57aa63f70fb62a02155d284de197f0c10ca2a417aff88b35a17,1.2.0\n0.16.0,5daa88a17cd8352793e6abf091e65b616227a8ae163ce7726e993af2ff7887263d167f9025a3737d4d90f9a1aa32a044ba9f08e3615bfe82eb2ca87c71431ae5,1.3.0\n0.16.0,ad70a58ebfca25c36b0f76b34bb52d9e2650538b8b81d57ec48361722b8ee22eca290c2b787bd74ef3931476f41a10007f3a4233c9e541ab0a11cbc99331a5cc,1.4.0\n0.16.1,c12e36c1f6e9a6bea250b789999f0649adb82fea884be026d385d64b2f7bbe70ab625b717fd51c88029cc0432a8bc13b300cef67a991a214719b68fa9f7f56a0,1.0.0\n0.16.1,8568b784d28849a506950530937390e241682407a095fa50f7edc9437c8abdae029a2967e883de165ae2fe92637528ab58425ceaaaef992433f288f40f59c0bc,1.1.0\n0.16.1,31c621d3ee672571746a7b7a536e85d3e0fb26b82c3ab24f2d0f54e9de619085d7d0146fc17bb9a3dc8c096556ce036ac7325eed719206568770c244082e88ab,1.2.0\n0.16.1,5129617b2f0917d786ce4854b87aa489f7a5372289b9f069610a79d5b78444b1361a609c82c5c0750955be572e2e824a186f402e0c84a93dd325ffdb9f141ae1,1.3.0\n0.16.1,fc3785034d91a1a6692bcaf587a73d62c6508d7c6332eb0e9b6e32d12c5cb4a97a52a01017c741c0c1e978293057d9860237259cd6fa9e7014f9413cb5a03664,1.4.0\n0.17.0,218978f135ab68458da41bb7890143e17bfff2506719fff5866c5a1be19a00bf0a3c547838147451b2b1b6ded1a9934025a5c1e33c47faa258da000288c47188,1.0.0\n0.17.0,9fc57abf9944b41f61a88ffec04517e5238c67ec03762b7d523bf2f55b9b7de960e40f46851d30f6c0ad8d037d65d17d95eb7f6c05e85d95e6ba2e0a66a3be08,1.1.0\n0.17.0,65d595e86ab4d9bcc346a3131e0a76612e1a9f795c7ee76c093145d9a06d558b80f107121ef1fc31f16362e6d8f1bbc15bebbd92fa3cf7257e7485a7a1a0edc5,1.2.0\n0.17.0,2f5508462cc1ad16a5e02bf008864885685a0ebc4b929e1c72419c5d1cdf52d8a2ae427759950e7625b810fff5f4e4704d51f03a01b234cd3e72cb36b9b3c550,1.3.0\n0.17.0,9699a7def990e6353f9052dc10003dfffaeb228fd8641d86105b8341b8a836e90049c67b9b8b7ed5bf042cd631ee56a76d5c703b272b0e1bb766ed35e0fc75ef,1.4.0\n0.17.0,16c1948f9c6f3a6530823e153cb896228bb7dfe5cfa0720cd5f4bd978e0241acf0c8e92ee1054b73ca084e58eb8979c7189427bb3d38dbdce6497f6f0a659e69,1.5.0\n0.17.1,6d621bccbf424db5a923d4f3f76abefb952297c12dc670f152e92fcd894e094228dc776bb322c6e6395dbe52c24d574866a1c2bdefd845415" <> ..., %{'accept-ranges' => 'bytes', 'age' => '177182', 'cache-control' => 'public, max-age=604800', 'connection' => 'keep-alive', 'content-length' => '52208', 'content-type' => 'text/csv', 'date' => 'Wed, 31 May 2023 14:50:56 GMT', 'etag' => '"66bab2cdbac416c0c53891419fcdcee7"', 'last-modified' => 'Mon, 06 Feb 2023 18:04:07 GMT', 'server' => 'AmazonS3', 'via' => '1.1 varnish', 'x-amz-id-2' => 'QvjKTp25ea1jN3kQPZk2UMgfuSZ0CheCyLA9i1LZsRo3kdij5yp+EqSqFiX9VQVx0qApugLtO9Y=', 'x-amz-meta-surrogate-key' => 'installs', 'x-amz-request-id' => '2QJF7VY4GQZJ9DE5', 'x-amz-server-side-encryption' => 'AES256', 'x-amz-version-id' => 'P0TuGgYQZGdi.7R..x5Vs8UU.t0og7LD', 'x-cache' => 'HIT, HIT', 'x-cache-hits' => '12, 2', 'x-served-by' => 'cache-iad-kcgs7200147-IAD, cache-fra-eddf8230105-FRA', 'x-timer' => 'S1685544656.294615,VS0,VE0'}}}}}
State: %{check_timeout: 60000, done: true, from: nil, reply: nil, started: true}
** (exit) exited in: GenServer.call(Hex.UpdateChecker, :check, 120000)
    ** (EXIT) exited in: GenServer.call(Hex.Registry.Server, {:last_update, {{2023, 5, 31}, {14, 50, 56}}}, 60000)
        ** (EXIT) an exception was raised:
            ** (ArgumentError) errors were found at the given arguments:

  * 1st argument: the table identifier does not refer to an existing ETS table

                (stdlib 4.3.1) :ets.insert(nil, {:last_update, {{2023, 5, 31}, {14, 50, 56}}})
                (hex 2.0.6) lib/hex/registry/server.ex:203: Hex.Registry.Server.handle_call/3
                (stdlib 4.3.1) gen_server.erl:1149: :gen_server.try_handle_call/4
                (stdlib 4.3.1) gen_server.erl:1178: :gen_server.handle_msg/6
                (stdlib 4.3.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
    (elixir 1.14.5) lib/gen_server.ex:1038: GenServer.call/3
    (hex 2.0.6) lib/hex/update_checker.ex:26: Hex.UpdateChecker.check/0
    (hex 2.0.6) lib/hex/remote_converger.ex:9: Hex.RemoteConverger.post_converge/0
    (mix 1.14.5) lib/mix/dep/converger.ex:75: Mix.Dep.Converger.converge/4
    (mix 1.14.5) lib/mix/dep.ex:193: Mix.Dep.converge/1
    (mix 1.14.5) lib/mix/dep.ex:114: Mix.Dep.load_and_cache/0
    (mix 1.14.5) lib/mix/tasks/deps.loadpaths.ex:27: Mix.Tasks.Deps.Loadpaths.run/1
    iex:1: (file)
iex(1)> Mix.install([:jason])
==> jason
Compiling 10 files (.ex)
Generated jason app
:ok

on the second try it works

I can reproduce it every few tries when I remove Mix.Utils.mix_cache() directory

@ericmj
Copy link
Member

ericmj commented Jun 1, 2023

Can you try with the main branch? mix archive.install github hexpm/hex branch main

It's possible it's been fixed in 15f9e66.

@lukaszsamson
Copy link
Author

@ericmj I couldn't reproduce it on master but I don't know hex internals well enough to tell if this PR fixed it. The crash was in Hex.UpdateChecker.check() call before Registry.close(). The issue is most likely a race conditions so I might have been unlucky.

@ericmj
Copy link
Member

ericmj commented Jul 12, 2023

Closing because it can't be reproduced.

@ericmj ericmj closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2023
@garazdawi
Copy link

Just FYI we just got the same crash in our CI: https://github.com/erlang/otp/actions/runs/9314132088/job/25637893845.

This is using hex 2.1.1 and seems like a race somewhere as so far we've only seen it once out of 100s of runs.

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