mythicalprogrammer

mythicalprogrammer

Phx 1.5 upgrade getting error: "failed to start child: Phoenix.PubSub.Supervisor"

Hi guys I can’t seem to fix this.

I’ve search this forum and google and couldn’t find the answer.

Thanks for your time.

Here’s the full error:

Generated fumigate app
** (Mix) Could not start application fumigate: Fumigate.Application.start(:normal, []) returned an error: shutdown: failed to start child: Phoenix.PubSub.Supervisor
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in Access.get/3
            (elixir 1.10.2) lib/access.ex:284: Access.get(Fumigate.PubSub, :name, nil)
            (phoenix_pubsub 2.0.0) lib/phoenix/pubsub/supervisor.ex:6: Phoenix.PubSub.Supervisor.start_link/1
            (stdlib 3.12) supervisor.erl:379: :supervisor.do_start_child_i/3
            (stdlib 3.12) supervisor.erl:365: :supervisor.do_start_child/2
            (stdlib 3.12) supervisor.erl:349: anonymous fn/3 in :supervisor.start_children/2
            (stdlib 3.12) supervisor.erl:1157: :supervisor.children_map/4
            (stdlib 3.12) supervisor.erl:315: :supervisor.init_children/2
            (stdlib 3.12) gen_server.erl:374: :gen_server.init_it/2
            (stdlib 3.12) gen_server.erl:342: :gen_server.init_it/6
            (stdlib 3.12) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

My mix.exs:

  40   defp deps do
  41     [
  42       {:phoenix, "~> 1.5.0", override: true},
  43       {:phoenix_pubsub, "~> 2.0"},
  44       {:phoenix_ecto, "~> 4.0"},
  45       {:ecto_sql, "~> 3.0"},
  46       {:postgrex, ">= 0.0.0"},
  47       {:phoenix_html, "~> 2.11"},
  48       {:phoenix_live_reload, "~> 1.2", only: :dev},
  49       {:gettext, "~> 0.11"},
  50       {:jason, "~> 1.0"},
  51       {:plug_cowboy, "~> 2.2"},
  52       {:ecto_enum, "~> 1.2"},
  53       {:scrivener_ecto, "~> 2.0"},
  54       {:edeliver, ">= 1.6.0"},
  55       {:distillery, "~> 2.0", warn_missing: false},
  56       {:credo, "~> 1.0.0", only: [:dev, :test], runtime: false},
  57       {:sobelow, "~> 0.7.6"},
  58       {:html_sanitize_ex, "~> 1.3"},
  59       {:scrivener_html, "~> 1.8"},
  60       {:comeonin, "~> 5.3"},
  61       {:bcrypt_elixir, "~> 2.0"},
  62       {:pow, "~> 1.0.4"},
  63       {:recaptcha, "~> 2.3"}
  64     ]

my config.exs:

  12 # Configures the endpoint
  13 config :fumigate, FumigateWeb.Endpoint,
  14   url: [host: "localhost"],
  15   secret_key_base: "supersecret",
  16   render_errors: [view: FumigateWeb.ErrorView, accepts: ~w(html json)],
  17   pubsub_server: Fumigate.PubSub

my application.ex:

   8   def start(_type, _args) do
   9     # List all child processes to be supervised
  10     children = [
  11       # Start the Ecto repository
  12       Fumigate.Repo,
  13       # Start the PubSub system
  14       {Phoenix.PubSub, Fumigate.PubSub},
  15       # Start the endpoint when the application starts
  16       FumigateWeb.Endpoint,
  17       # Starts a worker by calling: Fumigate.Worker.start_link(arg)
  18       # {Fumigate.Worker, arg},
  19     ]
  20

One thing I notice is that it didn’t add telemetry, phoenix live, etc… The phoenix live salt isn’t added in the config either during the upgrade process.

When I create a new project the mix file doesn’t include {:phoenix_pubsub, "~> 2.0"} where as all the upgrade tutorials (chris’s git and this one ) instruct to add it in your mix file.

Do note that I’m using {:plug_cowboy, "~> 2.2"}, for some compatibility reasons…

Marked As Solved

chrismccord

chrismccord

Creator of Phoenix

You have:

{Phoenix.PubSub, Fumigate.PubSub}

You need:

{Phoenix.PubSub, name: Fumigate.PubSub}

Then you should be all set!

Where Next?

Popular in Questions Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
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
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
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
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127536 1222
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement