bitwalker / bitwalker/distillery

Improve support for running in read-only environments

Open
#670 4 comments 0 reactions 0 assignees View on GitHub
deployment:scripts fixed:pre-release
Dominant language
Elixir
Stars
3k
Forks
398
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce

* Use Distillery 2.0.13 or 2.0.14
* Deploy to read-only filesystem (embedded linux box)

Try to start app with e.g. (note that `/data` is read-write)

```
HOME=/data/balrog/ RELEASE_MUTABLE_DIR=/data/balrog/ /balrog/bin/balrog foreground
```

### Verbose Logs (Logs from embedded box)

```
sh: /balrog/releases/0.2.3/libexec/erts.sh: line 306: /balrog/releases/start_erl.data: Read-only file system
```

### Description of issue

This works fine on Distillery 2.0.12, but fails with the `Read-only filesystem` message on 2.0.13 and 2.0.14.

The app is deployed to a read-only dir, but I point to a read-write dir for the `$RELEASE_MUTABLE_DIR`.

Downgrading to Distillery 2.0.12 made it work again.

Details:

- What OS, Erlang/Elixir versions are you seeing this issue on?
Linux (embedded, ARM), Erlang 21.1, Elixir 1.8.2

- If possible, also provide your `rel/config.exs`, as it is often
my first troubleshooting question, and you'll save us both time :)

```
# rel/config.exs

# 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/config/distillery.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
set cookie: :"SECRET"
end

environment :stag do
set cookie: :"SECRET"
end

environment :prod do
set cookie: :"SECRET"
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 :balrog do
set version: current_version(:balrog)
set include_erts: false
set include_src: false
end
```

I will try to dig deeper into this tomorrow.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.