nikitas

nikitas

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.

Showing Posts 1 to 7

hauleth

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

nikitas OP

Thanks for the reply. I am not sure how to proceed and whether I interpreted your suggestion correctly. I compiled phoenix_pubsub with mix deps.compile phoenix_pubsub and now this dependency as reported by mix deps is

  • phoenix_pubsub 1.1.2 (Hex package) (mix)
    locked at 1.1.2 (phoenix_pubsub) 1f13f9f0
    ok

I still get the same error though when I run mix phx.server.

josevalim

josevalim

Creator of Elixir

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.

15
Post #3
nikitas

nikitas OP

Thanks a million guys. I updated phoenix to 1.5.9 and phoenix_pubsub to 2.0.0 and now everything works fine!

johns10davenport

johns10davenport

This did not fix me, probably because I have a direct :pg2 call in my Application code:

def start(_type, _args) do
    children = [
      UserDocs.Repo,
      UserDocs.Vault,
      {Phoenix.PubSub, name: UserDocs.PubSub, adapter: Phoenix.PubSub.PG2}
    ]

    :pg2.create(UserDocs.PubSub)
    Supervisor.start_link(children, strategy: :one_for_one, name: UserDocs.Supervisor)
  end

I believe this came in with the phoenix boilerplate. I’ll have to replace this with whatever is current.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

You can simply remove that line. I don’t remember it being part of Phoenix but certainly these days it is not a necessary line.

axelson

axelson

Scenic Core Team

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

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews