简体   繁体   中英

mix release fails on missing elixir appup file

I have a simple website written in elixir/phoenix. I did some changes today and wanted to deploy it to production.

I pushed my repo, pulled it on the production server and built a release with:

MIX_ENV=prod mix release

and it failed... So I ran it again with --verbosity=verbose and it fails with:

silent])===> Provider (relup) failed with: {error,
   {rlx_prv_relup,
   {relup_script_generation_error,
   systools_relup,
   {file_problem,
   {"/home/herman/alive/rel/alive/lib/elixir-1.1.1/ebin/elixir.appup",
     {error,
       {open,
        "/home/herman/alive/rel/alive/lib/elixir-1.1.1/ebin/elixir.appup",
    enoent}}}}}}}

Anyone know how to solve this?

The current version 0.0.6 runs under elixir 1.1.0, the new version 0.0.7, with 1.1.1.

my mix.exs:

defmodule Alive.Mixfile do
  use Mix.Project

  def project do
    [app: :alive,
     version: "0.0.7",
     elixir: "~> 1.0",
     elixirc_paths: elixirc_paths(Mix.env),
     compilers: [:phoenix] ++ Mix.compilers,
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps]
  end

  # Configuration for the OTP application
  #
  # Type `mix help compile.app` for more information
  def application do
    [mod: {Alive, []},
   applications: [
     :phoenix,
     :phoenix_html,
     :cowboy,
     :logger,
     :phoenix_ecto,
     :timex,
     :mariaex]
   ]
  end

  # Specifies which paths to compile per environment
  defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
  defp elixirc_paths(_),     do: ["lib", "web"]

  # Specifies your project dependencies
  #
  # Type `mix help deps` for examples and options
  defp deps do
    [{:phoenix, "~> 1.0.1"},
     {:phoenix_ecto, "~> 1.1"},
     {:mariaex, ">= 0.0.0"},
     {:phoenix_html, "~> 2.1"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:cowboy, "~> 1.0"},
     {:timex, ">= 0.0.0"},
     {:exrm, "~> 0.19.9"},
     {:rebar3_hex, ">= 0.0.0"},
     {:plug_forwarded_peer, "~> 0.0.2" }
   ]
  end
end

It looks like you're trying to use hot code loading in releases. It's a great feature, but it's very complex if you want to update things like the version of Elixir you're running against.

For simple cases the generated appups are fine, but for more complex ones it may be seriously lacking. The main problem is updating running processes, changing state, upgrading ets tables, etc. You need to consider your application, as well as all of your dependencies. It can be seriously time consuming to write and test correct upgrade (and downgrade) instructions. Sometimes it's worth it, but I'd say that in majority of cases a traditional rolling release (to guarantee uptime) may be a much simpler and straightforward solution - a good enough one.

Personally, I'm using releases in production, but not the hot code loading part, exactly for the reasons above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM