Skip to content
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

Compilation failures when creating keyspace #19

Open
hackmad opened this issue Jun 3, 2019 · 2 comments
Open

Compilation failures when creating keyspace #19

hackmad opened this issue Jun 3, 2019 · 2 comments

Comments

@hackmad
Copy link

hackmad commented Jun 3, 2019

I've been following the README to get the project up and running. When I add the example Schema.Keyspace module, I get compile time errors. I have a very basic Elixir application running against a single node Cassandra in docker.

The error message we get:

$ iex -S mix
Erlang/OTP 21 [erts-10.3.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe] [dtrace]

Compiling 3 files (.ex)

== Compilation error in file lib/schema_user.ex ==
** (exit) exited in: GenServer.call(DBConnection.Watcher, {:watch, DBConnection.ConnectionPool.PoolSupervisor, [#PID<0.173.0>, #Reference<0.1861776828.1076232197.26507>, Xandra.Connection, [prepared_cache: #Reference<0.1861776828.1076232197.26500>, pool: DBConnection.ConnectionPool, idle_interval: 30000, default_consistency: :one, address: '127.0.0.1', port: 9042]]}, :infinity)
    ** (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

Is there something I'm missing? Also, is there a way to disable the compile time schema creation?

Please see the code below.

mix.exs:

defmodule Cassie.MixProject do
  use Mix.Project

  def project do
    [
      app: :cassie,
      version: "0.1.0",
      elixir: "~> 1.8",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger],
      mod: {Cassie.Application, []}
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [{:triton, "~> 0.2"}]
  end
end

config.exs:

use Mix.Config

config :triton,
  clusters: [
    [
      conn: Triton.Conn,
      nodes: ["127.0.0.1"],
      pool: Xandra.Cluster,
      underlying_pool: DBConnection.Poolboy,
      pool_size: 10,
      keyspace: "my_keyspace",
      health_check_delay: 2500,  # optional: (default is 5000)
      health_check_interval: 500  # optional: (default is 1000)
    ]
  ]

application.ex:

defmodule Cassie.Application do
  @moduledoc false

  use Application

  def start(_type, _args) do
    children = []

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

schema_keyspace.ex:

defmodule Schema.Keyspace do
  use Triton.Keyspace

  keyspace :my_keyspace, conn: Triton.Conn do
    with_options [
      replication: "{'class' : 'SimpleStrategy', 'replication_factor': 1}"
    ]
  end
end

cassie.ex

defmodule Cassie do
  def hello do
    :world
  end
end
@sewinter
Copy link

You can either force Xandra to 0.10.0 or use this: https://github.com/theblitzapp/triton.git. There's an outstanding PR here: #22

@cjayross
Copy link

cjayross commented Aug 21, 2020

I'm using 0.2.4 and am still encountering this issue. This problem exists while using Xandra 0.12 and 0.13 though using 0.10 seems to work with some CQL errors.

Edit: I see that using the current master branch works. The CQL errors were my fault. Could it therefore be of interest to get a new release out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants