Code Monkey home page Code Monkey logo

Comments (3)

amir-invozone avatar amir-invozone commented on June 20, 2024

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
children = [
  {Phoenix.PubSub, name: Demo.PubSub},
  Demo.Repo,
  DemoWeb.Endpoint,
  {Demo.ExpireCodesJob, []},
  {Demo.DistributeCodesJob, []},
  {Oban, oban_config()},
  worker(PlugAttack.Storage.Ets, [Demo.PlugAttack.Storage, [clean_period: 60_000]])
]
    opts = [strategy: :one_for_one, name: Demo.Supervisor]
    Supervisor.start_link(children, opts)
end

It happens occasionally not all the time as other users reported.

from phoenix_pubsub.

alecernas avatar alecernas commented on June 20, 2024

Hi there, I am facing similar issues, I had updated to version 2 and now I am confused, the code documentation establish this as a valid example - name as an atom {Phoenix.PubSub, name: :my_pubsub},
but the notes on the readme says {Phoenix.PubSub, name: MyApp.PubSub})

What's the correct one? my test suite is failing since multiple errors like ** (FunctionClauseError) no function clause matching in Phoenix.PubSub.broadcast/4 Any help is very appreciated :D

from phoenix_pubsub.

enewbury avatar enewbury commented on June 20, 2024

@sashaafm What does the test look like that is causing the issue? I know it's silly, but since you've confirmed pubsub is starting first in the supervision tree, is it possible there is a typo in the name MyAppServer.PubSub when you call broadcast? Also, if there is or isn't an alias present in that file, that's tripped me up in the past.
But yeah, likely the devil is in the details, and seeing the actual test implementation (or place where you call broadcast) might help.

from phoenix_pubsub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.