nikitas
Cannot start app after update with Erlang 24
After updating with Erlang 24 I cannot start app because the function :pg2.create/1 is undefined or private. Here is the response I get after executing mix phx.server
** (Mix) Could not start application wui: Wui.Application.start(:normal, ) returned an error: shutdown: failed to start child: Wui.Endpoint
** (EXIT) shutdown: failed to start child: Phoenix.PubSub.PG2
** (EXIT) shutdown: failed to start child: Phoenix.PubSub.PG2Server
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function :pg2.create/1 is undefined or private
(kernel 8.0) :pg2.create({:phx, Wui.PubSub})
(phoenix_pubsub 1.1.2) lib/phoenix/pubsub/pg2_server.ex:43: Phoenix.PubSub.PG2Server.init/1
(stdlib 3.15) gen_server.erl:423: :gen_server.init_it/2
(stdlib 3.15) gen_server.erl:390: :gen_server.init_it/6
(stdlib 3.15) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Any advice on how to proceed will be much appreciated. Thanks in advance.
Marked As Solved
josevalim
Yeah, updating Phoenix.PubSub to the latest should be enough to address the issue. The latest version is 2.0.0, so you will have to update your deps so you can bump to latest.
Also Liked
hauleth
:pg2 was deprecated some time ago and was scheduled to be removed on OTP24. You probably need to update the dependency and recompile the phoenix_pubsub to compile time selection of the implementation.
nikitas
Thanks a million guys. I updated phoenix to 1.5.9 and phoenix_pubsub to 2.0.0 and now everything works fine!
axelson
Additionally as part of the Phoenix 1.4.x → 1.5.0 upgrade you should change that line to:
{Phoenix.PubSub, name: UserDocs.PubSub}
Assuming you’re already on Phoenix 1.5.x (which you probably should be if you want to be using OTP 24) I would take a close look at the upgrade guide to ensure that you’re not missing any of the other steps: phx-1.5-upgrade.md · GitHub
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









