Hot Upgrade breaks when there are 2 past releases ditillery elixir phoenix

162 Views Asked by At

Distillery version 2.0

Elixir 1.7.1

OTP 21.0

First, do a normal release and deploy with mix release. It created a build in prod/rel/app_name/releases/1.0.1-08f6b0c

  • Application working

now change something and again create a release with mix release --upgrade

It created a new version in prod/rel/app_name/releases/1.0.1-a4011918

and do the upgrade as

/opt/app-name/bin/app-name upgrade 1.0.1-a4011918
  • Application got upgraded.

Now again make a new change create an upgrade release. version 1.0.1-a6cf7267.

now try to upgrade and it will give an error.

Verbose ansible Logs "Could not locate code path for release-evercam_media","1.0.1-08f6b0c!"

ansible + doing manual

"Could not locate code path for release-evercam_media\",\"1.0.1-08f6b0c!"
Description of issue

Expected: It should upgrade the new release version. but failed and finding the very first release code? is that an issue, that are 2 consecutive releases available and only should be the last one?

My config file is simple as

# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
~w(rel plugins *.exs)
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
    # This sets the default release built by `mix release`
    default_release: :default,
    # This sets the default environment used by `mix release`
    default_environment: Mix.env()

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/configuration.html


# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
  # If you are running Phoenix, you should make sure that
  # server: true is set and the code reloader is disabled,
  # even in dev mode.
  # It is recommended that you build with MIX_ENV=prod and pass
  # the --env flag to Distillery explicitly if you want to use
  # dev mode.
  set dev_mode: true
  set include_erts: false
  set cookie: :"Ht*Sd&uNNB]}}E;a~a/?&n~uogVhz>@|{,5`sX(>xK{A`@M,kj`0dF{s~`ry?XdJ"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :"Qf*;>$8`bG)vnRLU[AS(HLh9:]Qd:f)]%,`!Vfl^@Nek>OeeFRtl|&chJmdb{Ml("
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default

release :evercam_media do
  set version: current_version(:evercam_media)
  set applications: [
    :runtime_tools
  ]
end

Question is : why its looking for first release folder when its the 3rd release and it should upgrade from the 2nd one. I also tried to create appup first before upgrade release and do upgrade, both didnt work.

0

There are 0 best solutions below