Skip to content

Hexpm adapter: hex package fetch handling #1464

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

Open
ChGen opened this issue Jun 20, 2024 · 2 comments
Open

Hexpm adapter: hex package fetch handling #1464

ChGen opened this issue Jun 20, 2024 · 2 comments
Labels

Comments

@ChGen
Copy link
Collaborator

ChGen commented Jun 20, 2024

Hexpm adapter recently started to have issues with installing package in Artipie integration tests. Since tools/docker image versions have been stable and package data also stable, looks like some extra dependencies/scripts/metadata files are used by mix package manager which are downloaded from its repositories by mix on every test run. I tried elixir:1.12.3, elixir:1.17.1 and few other versions of the client docker container with the same result.
I also tried to force install old version of hexpm/hex dependency too, but it didn't help:

mix archive.install github hexpm/hex branch v1.0

The repository list looks like this:

mix hex.repo list

Name     URL                                        Public key                                          Auth key
hexpm    https://repo.hex.pm                        SHA256:O1LOYhHFW4kcrblKAxROaDEzLD8bn1seWbe5tq8TRsk
my_repo  http://host.testcontainers.internal:34955

This issue could be reproduced locally, as well as in GitHub CI.
Another alternative could be to update/change test packages data. May be some of the dependencies or its features got obsolete.
Below is the error log:

mix hex.package fetch decimal 2.0.0 --repo=my_repo

12:53:22.789 [error] GenServer Hex.Registry.Server terminating
** (FunctionClauseError) no function clause matching in anonymous fn/1 in Hex.Registry.Server.write_result/4
    (hex 2.1.1) lib/hex/registry/server.ex:367: anonymous fn({:name, "decimal"}) in Hex.Registry.Server.write_result/4
    (elixir 1.13.4) lib/enum.ex:942: anonymous fn/3 in Enum.each/2
    (stdlib 3.17.2.4) maps.erl:410: :maps.fold_1/3
    (elixir 1.13.4) lib/enum.ex:2408: Enum.each/2
    (hex 2.1.1) lib/hex/registry/server.ex:367: Hex.Registry.Server.write_result/4
    (hex 2.1.1) lib/hex/registry/server.ex:226: Hex.Registry.Server.handle_info/2
    (stdlib 3.17.2.4) gen_server.erl:695: :gen_server.try_dispatch/4
    (stdlib 3.17.2.4) gen_server.erl:771: :gen_server.handle_msg/6
Last message: {:get_package, "my_repo", "decimal", {:ok, {200, <<31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 1, 99, 0, 156, 255, 10, 95, 10, 75, 10, 5, 50, 46, 48, 46, 48, 18, 32, 167, 130,
 150, 230, 23, 176, 245, 221, 76, 108, 175, 87, 199, 20, ...>>, %{"content-length" => "122", "content-type" => "application/octet-stream"}}}}
State: %{ets: #Reference<0.2307738241.3500539905.219719>, fetched: #MapSet<[]>, path: "/root/.hex/cache.ets", pending: #MapSet<[{"my_repo", "decimal"}]>, pending_fun: nil, waiting:
 %{{"my_repo", "decimal"} => [{{#PID<0.94.0>, [:alias | #Reference<0.2307738241.3500474369.219751>]}, #Function<7.32886354/0 in Hex.Registry.Server.handle_call/3>}]}}
** (exit) exited in: GenServer.call(Hex.Registry.Server, {:outer_checksum, "my_repo", "decimal", "2.0.0"}, 60000)
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in anonymous fn/1 in Hex.Registry.Server.write_result/4
            (hex 2.1.1) lib/hex/registry/server.ex:367: anonymous fn({:name, "decimal"}) in Hex.Registry.Server.write_result/4
            (elixir 1.13.4) lib/enum.ex:942: anonymous fn/3 in Enum.each/2
            (stdlib 3.17.2.4) maps.erl:410: :maps.fold_1/3
            (elixir 1.13.4) lib/enum.ex:2408: Enum.each/2
            (hex 2.1.1) lib/hex/registry/server.ex:367: Hex.Registry.Server.write_result/4
            (hex 2.1.1) lib/hex/registry/server.ex:226: Hex.Registry.Server.handle_info/2
            (stdlib 3.17.2.4) gen_server.erl:695: :gen_server.try_dispatch/4
            (stdlib 3.17.2.4) gen_server.erl:771: :gen_server.handle_msg/6
    (elixir 1.13.4) lib/gen_server.ex:1030: GenServer.call/3
    (hex 2.1.1) lib/hex/scm.ex:416: Hex.SCM.fetch/3
    (hex 2.1.1) lib/mix/tasks/hex.package.ex:199: Mix.Tasks.Hex.Package.fetch_tarball!/3
    (hex 2.1.1) lib/mix/tasks/hex.package.ex:159: Mix.Tasks.Hex.Package.fetch/5
    (mix 1.13.4) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.4) lib/mix/cli.ex:84: Mix.CLI.run_task/2

See also: #1435

@ChGen
Copy link
Collaborator Author

ChGen commented Jun 21, 2024

So, the issue needs further investigation, for now download tests will be disabled for hexpm tests in hexpm-adapter and in artipie-main. And in smoke tests too. See corresponding PR: #1465

Copy link

Issue is stale, CC: @artipie/maintainers

@github-actions github-actions bot added the stale label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant