verk_web icon indicating copy to clipboard operation
verk_web copied to clipboard

Can't start verk web as a server

Open wizardone opened this issue 2 years ago • 0 comments

Error occurs on application startup

Error log:

02:15:10.347 [info] Application verk_web exited: VerkWeb.start(:normal, []) returned an error: shutdown: failed to start child: VerkWeb.Endpoint
--
  |  | ** (EXIT) an exception was raised:
  |  | ** (UndefinedFunctionError) function Plug.Cowboy.child_spec/1 is undefined (module Plug.Cowboy is not available)
  |  | Plug.Cowboy.child_spec([scheme: :http, plug: {VerkWeb.Endpoint, []}, options: [dispatch: [_: [{:_, Phoenix.Endpoint.Cowboy2Handler, {VerkWeb.Endpoint, []}}]], port: 4000, otp_app: :verk_web]])
  |  | (phoenix 1.4.17) lib/phoenix/endpoint/cowboy2_adapter.ex:44: Phoenix.Endpoint.Cowboy2Adapter.child_spec/3
  |  | (phoenix 1.4.17) lib/phoenix/endpoint/supervisor.ex:108: anonymous fn/6 in Phoenix.Endpoint.Supervisor.server_children/4
  |  | (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
  |  | (phoenix 1.4.17) lib/phoenix/endpoint/supervisor.ex:99: Phoenix.Endpoint.Supervisor.server_children/4
  |  | (phoenix 1.4.17) lib/phoenix/endpoint/supervisor.ex:59: Phoenix.Endpoint.Supervisor.init/1

Elixir 1.10.4

relevant mix.exs:

def application do
    [
      applications: [
        :verk,
        :verk_web,
      ]
    ]
  end

def deps do
 {:verk, "~> 1.7.1"},
 {:verk_web, "~> 1.5.0"}
end

relevant releases.exs:

config :verk_web, VerkWeb.Endpoint,
  http: [port: System.get_env("PORT", "4000") |> String.to_integer()],
  url: [host: System.get_env("URL_HOST", "localhost")],
  server: true,
  pubsub: [name: VerkWeb.PubSub, adapter: Phoenix.PubSub.PG2]

I've tried several things, but nothing really works. It does seem like some sort of a dependency problem, but I really can't figure it out. Seems like this error is related to phoenix 1.4, but since I don't have it as an explicit dependency I'm not sure what to do. Any help will be greatly appreciated. Thanks in advance :)

wizardone avatar Jan 28 '22 02:01 wizardone