dersar00

dersar00

Hello!
Like a mongodb driver for elixir I using Mongo.Ecto.

When I try to save something using using command insert:

of = %Friends.Person{age: 44}
Friends.Repo.insert(of)

I got error:

** (exit) exited in: GenServer.call(Friends.Repo.Pool, :topology, 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:824: GenServer.call/3
    (mongodb) lib/mongo.ex:750: Mongo.select_servers/4
    (mongodb) lib/mongo.ex:727: Mongo.select_server/3
    (mongodb) lib/mongo.ex:501: Mongo.insert_one/4
    (mongodb_ecto) lib/mongo_ecto/connection.ex:120: Mongo.Ecto.Connection.insert/3
    (mongodb_ecto) lib/mongo_ecto.ex:630: Mongo.Ecto.insert/6
    (ecto) lib/ecto/repo/schema.ex:469: Ecto.Repo.Schema.apply/4
    (ecto) lib/ecto/repo/schema.ex:205: anonymous fn/13 in Ecto.Repo.Schema.do_insert/4

I did everything as in a guide: Getting Started — Ecto v3.14.0

First 10 of 20 Posts Switch mode

NobbZ

NobbZ

Please double check if you have started your supervision tree and your repo gets started as a part of it.

dersar00

dersar00 OP

My lib/friends/aplication.ex file:

defmodule Friends.Application do
  # See https://hexdocs.pm/elixir/Application.html
  # for more information on OTP Applications
  @moduledoc false

  use Application

  def start(_type, _args) do
    # List all child processes to be supervised
    children = [
      Friends.Repo
      # {Friends.Worker, arg},
    ]

    # See https://hexdocs.pm/elixir/Supervisor.html
    # for other strategies and supported options
    opts = [strategy: :one_for_one, name: Friends.Supervisor]
    Supervisor.start_link(children, opts)
  end
end
Ankhers

Ankhers

Can you tell me which versions of the mongodb_ecto and mongodb packages you are using?

dersar00

dersar00 OP

mongo_ecto -v 0.2.0

Ankhers

Ankhers

Are you getting any errors on startup saying that something failed? Have you tried running a mix deps.clean?

dersar00

dersar00 OP

I didn’t got any error.
mix deps.clean didn’t help.

Ankhers

Ankhers

What version of the mongodb package are you using?

dersar00

dersar00 OP

v3.6.3

Ankhers

Ankhers

That version doesn’t exist for the mongodb package. The latest version is 0.4.5 (unless you are using a different package). Can you just copy the relevant lines from the mix.lock file?

dersar00

dersar00 OP

ohh, sorry I realy use 0.4.5 version:

"mongodb": {:hex, :mongodb, "0.4.5", "b46e7fdbbcc1f6ba7b893f5ddcc154b59858e0940794a955ab3ce8ae8bbe970b", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: false]}], "hexpm"},
  "mongodb_ecto": {:hex, :mongodb_ecto, "0.2.0", "5eccf19f3798c0a5c39428c6d33394b55038f902bd60f7a4fb1f9ffb1f4ece97", [:mix], [{:ecto, "~> 2.1.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:mongodb, "~> 0.4.2", [hex: :mongodb, repo: "hexpm", optional: false]}], "hexpm"}

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement