没有进程:进程没有活动,用于连接到mongo

时间:2018-03-08 22:59:07

标签: mongodb elixir

我在我的elixir服务器上使用mongox fork

它曾经运作良好,直到今天,当我不断得到以下错误:

GenServer #PID<0.23055.0> terminating
** (stop) exited in: GenServer.call(Mongo.PBKDF2Cache, {\"a9f40827e764c2e9d74318e934596194\", <<88, 76, 231, 25, 765, 153, 136, 68, 54, 109, 131, 126, 543, 654, 201, 250>>, 10000}, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir) lib/gen_server.ex:766: GenServer.call/3
    (mongox) lib/mongo/connection/auth/scram.ex:66: Mongo.Connection.Auth.SCRAM.second_message/5
    (mongox) lib/mongo/connection/auth/scram.ex:25: Mongo.Connection.Auth.SCRAM.conversation_first/6
    (mongox) lib/mongo/connection/auth.ex:29: anonymous fn/3 in Mongo.Connection.Auth.run/1
    (elixir) lib/enum.ex:2914: Enum.find_value_list/3
    (mongox) lib/mongo/connection/auth.ex:28: Mongo.Connection.Auth.run/1
    (mongox) lib/mongo/connection.ex:206: Mongo.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
Last message: nil
State: %{auth: [{\"my-user\", \"mypassword\"}], database: \"my-db\", opts: [backoff: 1000, hosts: [{\"xxxxxx.mlab.com\", \"17060\"}], port: 17060, hostname: 'xxxxxx.mlab.com', name: MongoPool, max_overflow: 500], queue: %{}, request_id: 0, socket: nil, tail: nil, timeout: 5000, wire_version: nil, write_concern: [w: 1]}
在深入研究代码之后,我想出了:

在这一行上失败了(在deps上): https://github.com/work-capital/mongox/blob/feature/nan_type_support/lib/mongo/connection/auth/scram.ex#L66

尝试拨打pbkdf2时 这使得一个genserver调用

 def pbkdf2(password, salt, iterations) do
    GenServer.call(@name, {password, salt, iterations})

这是连接到mongo实例(在mlab上)的错误,还是代码问题?

这是我的配置:

config.exs

config :mongo_app,  MongoApp,
      host:         "xxxx.mlab.com",
      database:     "my-db",
      username:     "my-user",
      password:     "mypass**",
      port:         "17060",
      pool_size:    "100",
      max_overflow: "500"

mix.exs

  def application do
    [extra_applications: [:logger, :poolboy],
     mod: {MongoApp.Application, []}]
  end

  defp deps do
    [{:mongox, git: "https://github.com/work-capital/mongox.git", branch: "feature/nan_type_support"},
     {:poolboy, "~> 1.5"}
     ]

application.ex:

defmodule MongoApp.Application do
  use Application

  def start(_type, _args) do
    MongoApp.connect
    import Supervisor.Spec, warn: false

    children = [
    ]

    opts = [strategy: :one_for_one, name: MongoApp.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

0 个答案:

没有答案