Phoenix 1.4, Distillery 2.0, Umbrella - Phoenix.HTML.Engine error

phoenix
distillery

#1

My umbrella app with multiple Phoenix apps (2x web, 1x api, 1x services) generare this error when I try to access a page.

** (UndefinedFunctionError) function Phoenix.HTML.Engine.fetch_assign/2 is undefined (module Phoenix.HTML.Engine is not available)

Do you know how to fix? (All apps in a single release)

I’m following Distillery documentation.

rel/config

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: : mycookie
  set vm_args: "rel/vm.args"
end

release :myapp do
  set version: "0.1.0"
  set applications: [
    :runtime_tools,
    myapp_admin: :permanent,
    myapp_api: :permanent,
    myapp_portal: :permanent,
    myapp_services: :permanent
  ]
end

config.exs

config :myapp_admin, MyAppWeb.Endpoint,
  load_from_system_env: true,
  url: [host: "localhost"],
  cache_static_manifest: "priv/static/cache_manifest.json",
  secret_key_base: mysecret,
  render_errors: [view: MyAppAdminWeb.ErrorView, accepts: ~w(html json)],
  pubsub: [name: MyAppAdmin.PubSub,
           adapter: Phoenix.PubSub.PG2]

prod.exs

config :myapp_admin, MyAppAdminWeb.Endpoint,
  server: true,
  root: ".",
  version: Application.spec(:myapp_admin, :vsn)

#2

Did you solve this?


#3

Yes, but I’m not remember what did the trick, if it was a force rebuild.
I had a really tight deadline to move to another provider, and this Guide helped a lot.

Now I’m already on Docker / Kubernetes on GCP.

Here are my currrent files:

rel/config

~w(rel plugins *.exs)
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
    default_release: :default,
    default_environment: Mix.env()

environment :dev do
  set dev_mode: true
  set include_erts: false
  set cookie: :"..."
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :"..."
  set vm_args: "rel/vm.args"
end

release :myapp_frontend do
  set version: "0.1.0"
  set applications: [
    :runtime_tools,
    myapp_admin: :permanent,
    myapp_api: :permanent,
    myapp_portal: :permanent,
    myapp_services: :permanent
  ]
end

release :myapp_backend do
  set version: "0.1.0"
  set applications: [
    :runtime_tools,
    myapp_services: :permanent
  ]
end

config/config.exs

config :myapp_admin, MyappAdminWeb.Endpoint,\
  http: [port: System.get_env("PORT_ADMIN")],
  url: [host: "localhost", port:  System.get_env("PORT_ADMIN")],
  secret_key_base: "...",
  render_errors: [view: MyappAdminWeb.ErrorView, accepts: ~w(html json)],
  pubsub: [name: MyappAdmin.PubSub,
           adapter: Phoenix.PubSub.PG2]

config/prod.exs

config :myapp_admin, MyappAdminWeb.Endpoint,
  cache_static_manifest: "priv/static/cache_manifest.json",
  server: true,
  root: ".",
  version: Application.spec(:myapp_admin, :vsn)