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.)

Last Post!

tab_key

tab_key

I’ve already tried moving it to right above and below the Pubsub endpoint and also right below the Demo.Repo, but no use

Where Next?

Popular in Questions Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement