banano
Hi guys!
I’m trying to upgrade the current library for phoenix socket client for elixir itself https://github.com/Aircloak/phoenix_gen_socket_client, which is more than a year old and works for 1.3, but has several outdated things, like Poison dependency, cowboy, among others, and i can’t fix the tests.
It creates a generic base phoenix app, but fails to launch the endpoint:
** (EXIT from #PID<0.265.0>) shutdown: failed to start child: Phoenix.PubSub.PG2
** (EXIT) shutdown: failed to start child: Phoenix.PubSub.LocalSupervisor
** (EXIT) an exception was raised:
** (ArgumentError) argument error
(stdlib) :ets.new(TestSite.Endpoint, [:set, :named_table, {:read_concurrency, true}])
(phoenix_pubsub) lib/phoenix/pubsub/local_supervisor.ex:24: Phoenix.PubSub.LocalSupervisor.init/1
(stdlib) supervisor.erl:295: :supervisor.init/1
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
The weird thing is that i run on iex :ets.new(TestSite.Endpoint, [:set, :named_table, {:read_concurrency, true}]) and runs ok
this is the declaration of the testSite:
defmodule TestSite do
@moduledoc false
defmodule PubSub do
@moduledoc false
def start_link(), do: Registry.start_link(keys: :duplicate, name: TestSite.PubSub)
def subscribe(subscriber_key), do: Registry.register(__MODULE__, subscriber_key, nil)
def notify(subscriber_key, message) do
__MODULE__
|> Registry.lookup(subscriber_key)
|> Enum.map(fn {pid, _value} -> pid end)
|> Enum.each(&send(&1, message))
end
end
defmodule Endpoint do
@moduledoc false
use Phoenix.Endpoint, otp_app: :phoenix_gen_socket_client
socket("/test_socket", TestSite.Socket, websocket: true, longpoll: false)
socket("/test_socket_updated", TestSite.SocketUpdated, websocket: true, longpoll: false)
@doc false
def init(:supervisor, config) do
{:ok,
Keyword.merge(
config,
https: false,
http: [port: 29_876],
secret_key_base: String.duplicate("abcdefgh", 8),
debug_errors: false,
server: true,
pubsub: [adapter: Phoenix.PubSub.PG2, name: __MODULE__]
)}
end
end
...
any clues?
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
** (ArgumentError) expected :max_attempts to be a positive integer, got: {:@, [line: 10, column: 19], [{:max_attempts, [line: 10, column:...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex











Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
benwilson512
This probably means the endpoint is already started, or that there is at least an
:etstable with that name already:Maybe that helps point you in the right direction?
banano
I checked ets tables right before start, and there’s no table with that name:
the endpoint:
the test results:
If i remove the init() it doesn’t start at all.
Would be that
Endpoint.start_link()isn’t the right way to start the endpoint without a supervisor anymore?any other hint?
benwilson512
Ah so for one thing, in a test, use
start_supervised(Endpoint). This will ensure that the endpoint is shut down in the given test case before it is started in another test case. Can you show where you’re calling start_link right now?banano
same thing with start_supervised(Endpoint)
This is where it’s being called at Phoenix.Channels.GenSocketClientTest
this is the repo and the test file that i’m working on right now
https://github.com/naaano/phoenix_gen_socket_client/blob/jason/test/socket_client_test.exs