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

Showing Posts 1 to 10

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

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
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
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews