Max

Max

Hi,

after updating to Phoenix 1.5 and follwing the upgrade plan, my logs are full with:

[error] an exception was raised:
    ** (ArgumentError) unknown registry: RumblWeb.PubSub
        (elixir 1.12.0) lib/registry.ex:1332: Registry.info!/1
        (elixir 1.12.0) lib/registry.ex:985: Registry.register/3
        (phoenix_pubsub 2.0.0) lib/phoenix/pubsub.ex:117: Phoenix.PubSub.subscribe/3
        (phoenix 1.5.9) lib/phoenix/channel/server.ex:420: Phoenix.Channel.Server.init_join/3
        (phoenix 1.5.9) lib/phoenix/channel/server.ex:378: Phoenix.Channel.Server.channel_join/4
        (phoenix 1.5.9) lib/phoenix/channel/server.ex:298: Phoenix.Channel.Server.handle_info/2
        (stdlib 3.15) gen_server.erl:695: :gen_server.try_dispatch/4
        (stdlib 3.15) gen_server.erl:771: :gen_server.handle_msg/6

application.ex

defmodule Rumbl.Application do
  use Application

  # See https://hexdocs.pm/elixir/Application.html
  # for more information on OTP Applications
  def start(_type, _args) do
    import Supervisor.Spec

    # Define workers and child supervisors to be supervised
    children = [
      {Phoenix.PubSub, name: Rumbl.PubSub},
      # Start the Ecto repository
      supervisor(Rumbl.Repo, []),
      # Start the endpoint when the application starts
      supervisor(RumblWeb.Endpoint, []),
      # Start your own worker by calling: Rumbl.Worker.start_link(arg1, arg2, arg3)
      # worker(Rumbl.Worker, [arg1, arg2, arg3]),
    ]

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

  # Tell Phoenix to update the endpoint configuration
  # whenever the application is updated.
  def config_change(changed, _new, removed) do
    RumblWeb.Endpoint.config_change(changed, removed)
    :ok
  end
end

config.exs (partial)

config :rumbl,
  namespace: Rumbl

config :rumbl, ecto_repos: [Rumbl.Repo]

# Configures the endpoint
config :rumbl, RumblWeb.Endpoint,
  url: [host: "//*.mydomain.io"],
  # root: Path.dirname(__DIR__),
  secret_key_base: "123",
  render_errors: [view: RumblWeb.ErrorView, format: "json", accepts: ~w(html json)],
  pubsub_server: RumblWeb.PubSub

# Configures Elixir's Logger
config :logger, :console,
  format: "$time $metadata[$level] $message\n",
  metadata: [:request_id]

config :phoenix, :json_library, Jason

# Configure phoenix generators
config :phoenix, :generators,
  migration: true,
  binary_id: false

What can i do?

thanks

Showing Posts 1 to 6

APB9785

APB9785

Creator of ECSx

Maybe in config.exs try changing

pubsub_server: RumblWeb.PubSub

to

pubsub_server: Rumbl.PubSub

?

Max

Max OP

thanks, but not working
unknown registry: Rumbl.PubSub

kokolegorille

kokolegorille

You have an old syntax for your application.ex

Maybe try like this…

  def start(_type, _args) do
    # Define workers and child supervisors to be supervised
    children = [
      {Phoenix.PubSub, name: Rumbl.PubSub},
      # Start the Ecto repository
      Rumbl.Repo,
      # Start the endpoint when the application starts
      RumblWeb.Endpoint,
      # Start your own worker by calling: Rumbl.Worker.start_link(arg1, arg2, arg3)
      # worker(Rumbl.Worker, [arg1, arg2, arg3]),
    ]

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

stefan_z

Hi @Max,

Since name of PubSub is Rumbl.PubSub right now, you also need to changed name in functions where you call it, in this case function for subscribing the caller to the PubSub adapter’s topic.

APB9785

APB9785

Creator of ECSx

I found another thread where the same issue is discussed from #14 down. It seems the module naming conventions in the book are a little outdated now - but it’s easily fixable!

Max

Max OP

Thank you all for your help. Apart from your suggestions i also had an old code in mix:

  def application do
    [mod: {Rumbl, []}, extra_applications: [:logger]]
  end

needs to be

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

But the app worked all the time before. So not sure where i missed the change.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
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
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
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
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
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews