kattair0ta8
All of a sudden my app has started to crash:
$ mix phx.server
[................]
Generated my_app app
[info] Application my_app exited: MyApp.Application.start(:normal, []) returned an error: shutdown: failed to start child: MyAppWeb.Endpoint
** (EXIT) shutdown: failed to start child: Phoenix.Endpoint.Handler
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function Phoenix.Endpoint.Cowboy2Handler.child_spec/3 is undefined (module Phoenix.Endpoint.Cowboy2Handler is not available)
Phoenix.Endpoint.Cowboy2Handler.child_spec(:http, MyAppWeb.Endpoint, [port: 4000, otp_app: :my_app])
(phoenix) lib/phoenix/endpoint/handler.ex:33: anonymous fn/5 in Phoenix.Endpoint.Handler.init/1
(elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix) lib/phoenix/endpoint/handler.ex:31: Phoenix.Endpoint.Handler.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
** (Mix) Could not start application my_app: MyApp.Application.start(:normal, []) returned an error: shutdown: failed to start child: MyAppWeb.Endpoint
** (EXIT) shutdown: failed to start child: Phoenix.Endpoint.Handler
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function Phoenix.Endpoint.Cowboy2Handler.child_spec/3 is undefined (module Phoenix.Endpoint.Cowboy2Handler is not available)
Phoenix.Endpoint.Cowboy2Handler.child_spec(:http, MyAppWeb.Endpoint, [port: 4000, otp_app: :my_app])
(phoenix) lib/phoenix/endpoint/handler.ex:33: anonymous fn/5 in Phoenix.Endpoint.Handler.init/1
(elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix) lib/phoenix/endpoint/handler.ex:31: Phoenix.Endpoint.Handler.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
I’m using and have been using for a while the latest versions of everything: Cowboy - 2.5, Phoenix - 1.3. All has been working fine for over a half a year
Trending in Questions
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
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
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
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
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
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
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
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
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
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
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
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
OvermindDL1
Well this is definitely the issue. Cowboy2 handler means that something was updated very recently and not everything was updated entirely and properly and/or
_buildgot corrupted, in which case wipe and rebuild?kattair0ta8
removed _build and recompiled – didn’t help
cdfuller
Change your cowboy dependency to
{:plug_cowboy, "~> 1.0"}.OvermindDL1
They said they were already using cowboy2 successfully so that shouldn’t be needed.
Can you post your mix.exs file so I can drop it into a new project to give it a try?
kattair0ta8
cdfuller
The module Plug.Adapters.Cowboy2 was deprecated a few days ago and it’s now recommended to use
{:plug_cowboy, "~> 2.0"}for cowboy 2.0https://hexdocs.pm/plug/Plug.Adapters.Cowboy2.html
I ran into the same or similar problem yesterday and this is how I was able to solve it.
kattair0ta8
Why and how did it use to work without
plug_cowboyat all in my project?phoenix 1.3.4 of August 2018 - doesn’t work now either
Gazler
Cowboy 2 is only supported on Phoenix 1.4.0-rc.2 and above via
{:plug_cowboy, "~> 2.0"}It is likely that you have updated plug to
1.7in which case you will be prompted to replacecowboywith{:plug_cowboy, "~> 1.0"}in your mix.exs file.kattair0ta8
I know where it’s suppoted.
Look at my mix, it’s been working since a half a year ago.
kattair0ta8
…How?