I have the same error, when i try connecto to my mongodb.
this is the error
[error] GenServer #PID<0.524.0> terminating
** (stop) exited in: GenServer.call(Mongo.PBKDF2Cache, {"7fa53ac867620679d198f32788c692ab", <<178, 132, 122, 7, 0, 224, 234, 189, 233, 38, 179, 162, 21, 21, 223, 101>>, 10000}, 5000)
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function :crypto.hmac/3 is undefined or private
(crypto 5.0.3) :crypto.hmac(:sha, "7fa53ac867620679d198f32788c692ab", <<178, 132, 122, 7, 0, 224, 234, 189, 233, 38, 179, 162, 21, 21, 223, 101, 0, 0, 0, 1>>)
(mongodb 0.5.1) lib/mongo/pbkdf2.ex:46: Mongo.PBKDF2.generate/7
(mongodb 0.5.1) lib/mongo/pbkdf2_cache.ex:46: anonymous fn/4 in Mongo.PBKDF2Cache.run_task/1
(elixir 1.12.2) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
(elixir 1.12.2) lib/task/supervised.ex:35: Task.Supervised.reply/5
(stdlib 3.16) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
(elixir 1.12.2) lib/gen_server.ex:1024: GenServer.call/3
(mongodb 0.5.1) lib/mongo/auth/scram.ex:40: Mongo.Auth.SCRAM.first/5
(mongodb 0.5.1) lib/mongo/auth/scram.ex:17: Mongo.Auth.SCRAM.auth/2
(mongodb 0.5.1) lib/mongo/auth.ex:16: anonymous fn/3 in Mongo.Auth.run/2
(elixir 1.12.2) lib/enum.ex:3884: Enum.find_value_list/3
(mongodb 0.5.1) lib/mongo/auth.ex:15: Mongo.Auth.run/2
(mongodb 0.5.1) lib/mongo/protocol.ex:57: Mongo.Protocol.connect/2
(db_connection 2.4.1) lib/db_connection/connection.ex:82: DBConnection.Connection.connect/2
(connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.16) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Mongo.Protocol
and this is my mix.exs
defmodule App.MixProject do
use Mix.Project
def project do
[
app: :app,
version: "0.1.0",
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {App.Application, []},
extra_applications: [:logger, :runtime_tools]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.6.2"},
{:phoenix_live_dashboard, "~> 0.5"},
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
{:swoosh, "~> 1.3"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.18"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"},
{:mongodb, ">= 0.0.0"},
{:poolboy, ">= 0.0.0"}
]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to install project dependencies and perform other setup tasks, run:
#
# $ mix setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
setup: ["deps.get"],
"assets.deploy": ["esbuild default --minify", "phx.digest"]
]
end
end
I not understand, because I have the plug_crypto version 1.2.2,
elixir --version
Erlang/OTP 24 [erts-12.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Elixir 1.12.2 (compiled with Erlang/OTP 22)
and erl command
Erlang/OTP 24 [erts-12.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Eshell V12.1 (abort with ^G)
what is wrong???


















