tab_key

tab_key

Elixir Unknown Registery Error on Pubsub upgrade

I recently upgraded the pubsub dependency in my project following the documentation, but I am getting this error whenever I run the server:

an exception was raised:
** (ArgumentError) unknown registry: Demo.PubSub
    (elixir 1.10.2) lib/registry.ex:1239: Registry.info!/1
    (elixir 1.10.2) lib/registry.ex:920: Registry.register/3
    (phoenix_pubsub 2.0.0) lib/phoenix/pubsub.ex:117: Phoenix.PubSub.subscribe/3
    (phoenix 1.5.8) lib/phoenix/channel/server.ex:420: Phoenix.Channel.Server.init_join/3
    (phoenix 1.5.8) lib/phoenix/channel/server.ex:378: Phoenix.Channel.Server.channel_join/4
    (phoenix 1.5.8) lib/phoenix/channel/server.ex:298: Phoenix.Channel.Server.handle_info/2
    (stdlib 3.7) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib 3.7) gen_server.erl:711: :gen_server.handle_msg/6

Here is my application.ex

def start(_type, _args) do
# List all child processes to be supervised
children = [
  Demo.Repo,
  {Demo.ExpireCodesJob, []},
  {Demo.DistributeCodesJob, []},
  {Oban, oban_config()},
  DemoWeb.Endpoint,
  {Phoenix.PubSub, [name: Demo.PubSub, adapter: Phoenix.PubSub.PG2]},
  worker(PlugAttack.Storage.Ets, [Demo.PlugAttack.Storage, [clean_period: 60_000]])
]

Here is my config.ex

# Configures the endpoint
config :demo, DemoWeb.Endpoint,
  url: [host: System.get_env("HOST")],
  secret_key_base: System.get_env("SECRET_KEY_BASE"),
  render_errors: [view: DemoWeb.ErrorView, accepts: ~w(json)],
  pubsub_server: Demo.PubSub,
  check_origin: [...]

I’ve searched a lot about it, but since I am still a newbie, could not figure out where does it goes wrong. Please help me out.

First Post!

Nicd

Nicd

Try starting the pubsub before your endpoint in your application.ex and see if it fixes it. (I.e. move it earlier in the children list.)

Where Next?

Popular in Questions Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

We're in Beta

About us Mission Statement