Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed during create_start_clean: :eacces #142

Closed
andreasguther opened this issue Nov 27, 2016 · 15 comments
Closed

Failed during create_start_clean: :eacces #142

andreasguther opened this issue Nov 27, 2016 · 15 comments

Comments

@andreasguther
Copy link

Steps to reproduce

  1. Create a new phoenix project following Up and Running on the Phoenix project site: mix phoenix.new hello_phoenix
  2. change directory into the new project folder
  3. Add distillery to the dependencies in mix.exs: {:distillery, "~> 0.10"}
  4. Run mix deps.get
  5. Run mix release init
  6. Run mix release - You should see the following error
$ mix release
==> Assembling release..
==> Building release hello_phoenix:0.0.1 using environment dev
==> Failed to build release:
    Failed during create_start_clean: :eacces

Verbose Logs

Paste the output of the release command you ran with the --verbose flag.

$ mix release --verbose
==> Loading configuration..
==> Assembling release..
==> Building release hello_phoenix:0.0.1 using environment dev
==> Discovered applications:
  connection-1.0.4
    from: _build/dev/lib/connection
    applications:
      :kernel
      :stdlib
      :elixir
    includes: none

  db_connection-1.1.0
    from: _build/dev/lib/db_connection
    applications:
      :kernel
      :stdlib
      :elixir
      :logger
      :connection
    includes: none

  postgrex-0.12.1
    from: _build/dev/lib/postgrex
    applications:
      :kernel
      :stdlib
      :elixir
      :logger
      :db_connection
      :decimal
    includes: none

  poolboy-1.5.1
    from: _build/dev/lib/poolboy
    applications:
      :kernel
      :stdlib
    includes: none

  decimal-1.3.1
    from: _build/dev/lib/decimal
    applications:
      :kernel
      :stdlib
      :elixir
    includes: none

  ecto-2.0.6
    from: _build/dev/lib/ecto
    applications:
      :kernel
      :stdlib
      :elixir
      :logger
      :decimal
      :poolboy
    includes: none

  phoenix_ecto-3.0.1
    from: _build/dev/lib/phoenix_ecto
    applications:
      :kernel
      :stdlib
      :elixir
      :logger
      :ecto
      :plug
    includes: none

  gettext-0.12.1
    from: _build/dev/lib/gettext
    applications:
      :kernel
      :stdlib
      :elixir
      :logger
    includes: none

  cowlib-1.0.2
    from: _build/dev/lib/cowlib
    applications:
      :kernel
      :stdlib
      :crypto
    includes: none

  ranch-1.2.1
    from: _build/dev/lib/ranch
    applications:
      :kernel
      :stdlib
    includes: none

  cowboy-1.0.4
    from: _build/dev/lib/cowboy
    applications:
      :kernel
      :stdlib
      :ranch
      :cowlib
      :crypto
    includes: none

  phoenix_html-2.8.0
    from: _build/dev/lib/phoenix_html
    applications:
      :kernel
      :stdlib
      :elixir
      :logger
      :plug
    includes: none

  phoenix_pubsub-1.0.1
    from: _build/dev/lib/phoenix_pubsub
    applications:
      :kernel
      :stdlib
      :elixir
      :logger
      :crypto
    includes: none

  eex-1.3.4
    from: /usr/local/Cellar/elixir/1.3.4/bin/../lib/eex
    applications:
      :kernel
      :stdlib
      :elixir
    includes: none

  poison-2.2.0
    from: _build/dev/lib/poison
    applications:
      :kernel
      :stdlib
      :elixir
    includes: none

  mime-1.0.1
    from: _build/dev/lib/mime
    applications:
      :kernel
      :stdlib
      :elixir
    includes: none

  logger-1.3.4
    from: /usr/local/Cellar/elixir/1.3.4/bin/../lib/logger
    applications:
      :kernel
      :stdlib
      :elixir
    includes: none

  crypto-3.7.1
    from: /usr/local/Cellar/erlang/19.1/lib/erlang/lib/crypto-3.7.1
    applications:
      :kernel
      :stdlib
    includes: none

  plug-1.3.0
    from: _build/dev/lib/plug
    applications:
      :kernel
      :stdlib
      :elixir
      :crypto
      :logger
      :mime
    includes: none

  phoenix-1.2.1
    from: _build/dev/lib/phoenix
    applications:
      :kernel
      :stdlib
      :elixir
      :plug
      :poison
      :logger
      :eex
    includes: none

  compiler-7.0.2
    from: /usr/local/Cellar/erlang/19.1/lib/erlang/lib/compiler-7.0.2
    applications:
      :kernel
      :stdlib
    includes: none

  elixir-1.3.4
    from: /usr/local/Cellar/elixir/1.3.4/bin/../lib/elixir
    applications:
      :kernel
      :stdlib
      :compiler
    includes: none

  stdlib-3.1
    from: /usr/local/Cellar/erlang/19.1/lib/erlang/lib/stdlib-3.1
    applications:
      :kernel
    includes: none

  kernel-5.1
    from: /usr/local/Cellar/erlang/19.1/lib/erlang/lib/kernel-5.1
    applications: none
    includes: none

  hello_phoenix-0.0.1
    from: _build/dev/lib/hello_phoenix
    applications:
      :kernel
      :stdlib
      :elixir
      :phoenix
      :phoenix_pubsub
      :phoenix_html
      :cowboy
      :logger
      :gettext
      :phoenix_ecto
      :postgrex
    includes: none

  iex-1.3.4
    from: /usr/local/Cellar/elixir/1.3.4/bin/../lib/iex
    applications:
      :kernel
      :stdlib
      :elixir
    includes: none

  sasl-3.0.1
    from: /usr/local/Cellar/erlang/19.1/lib/erlang/lib/sasl-3.0.1
    applications:
      :kernel
      :stdlib
    includes: none

==> Generated overlay vars:
    release_name=:hello_phoenix
    release_version="0.0.1"
    is_upgrade=false
    upgrade_from=:latest
    dev_mode=true
    include_erts=false
    include_src=false
    include_system_libs=true
    erl_opts=""
    erts_vsn="8.1"
    output_dir="rel/hello_phoenix"
==> Copying applications to rel/hello_phoenix
==> Generating nodetool
==> Generating start_erl.data
==> Generating vm.args
==> Generating sys.config from config/config.exs
==> Generating boot script
==> Generating RELEASES
==> Generating start_clean.boot
==> Failed to build release:
    Failed during create_start_clean: :eacces

Description of issue

  • What are the expected results?
    I would like to find a completed release build.
    I have seen the same error using exrm and that was the reason I moved to distillery. In case it might give a hint, here is the stack trace when using exrm:
Generated hello_phoenix app
Building release with MIX_ENV=prod.
** (CaseClauseError) no case clause matching: :eacces
    lib/exrm/utils/utils.ex:110: ReleaseManager.Utils.relx/5
    lib/mix/tasks/release.ex:341: anonymous fn/4 in Mix.Tasks.Release.do_release/1
    lib/ex_unit/capture_io.ex:146: ExUnit.CaptureIO.do_capture_io/2
    lib/ex_unit/capture_io.ex:119: ExUnit.CaptureIO.do_capture_io/3
    lib/mix/tasks/release.ex:340: Mix.Tasks.Release.do_release/1
    lib/mix/tasks/release.ex:78: Mix.Tasks.Release.do_run/1
    (mix) lib/mix/task.ex:296: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
  • What OS, Erlang/Elixir versions are you seeing this issue on?
$ elixir -v
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.3.4

$ rebar3 -v
rebar 3.3.2 on Erlang/OTP 19 Erts 8.1

$ npm -v
3.10.8
  • Dependencies
defp deps do
    [{:phoenix, "~> 1.2.1"},
     {:phoenix_pubsub, "~> 1.0"},
     {:phoenix_ecto, "~> 3.0"},
     {:postgrex, ">= 0.0.0"},
     {:phoenix_html, "~> 2.6"},
     {:phoenix_live_reload, "~> 1.0", only: :dev},
     {:gettext, "~> 0.11"},
     {:cowboy, "~> 1.0"},
     {:distillery, "~> 0.10"}
    #  {:exrm, "~> 0.19.9"},
    #  {:exrm, git: "git://github.com/bitwalker/exrm.git"}
   ]
  end
  • If possible, also provide your rel/config.exs, as it is often
    my first troubleshooting question, and you'll save us both time :)
$ cat rel/config.exs 
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: :dev

# 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
  set dev_mode: true
  set include_erts: false
  set cookie: :"!6[VQ%4jc5Q*Q&tHEDnujHTG~b[T`tFUo7JTTBV)RmXk$o-RB7}*8b+De?$f&Fhq"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :"!6[VQ%4jc5Q*Q&tHEDnujHTG~b[T`tFUo7JTTBV)RmXk$o-RB7}*8b+De?$f&Fhq"
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 :hello_phoenix do
  set version: current_version(:hello_phoenix)
end

  • Is there documentation that says one thing, but Distillery does
    another? If so, please link the doc here so it can be updated if
    it's a documentation issue, or so that the fix can be based around
    what's documented.
@michalmuskala
Copy link
Contributor

eaccess usually means some directory is not writable. Is the rel directory writable by the user running the release task?

@andreasguther
Copy link
Author

The rel directory is writeable by my account. I am running the build manually with my account.
drwxr-xr-x 5 aguther staff 170 Nov 27 13:36 rel

@OnorioCatenacci
Copy link

1.) Post up what you get when you run uname -a.

2.) Is the parent directory of rel writeable by your account as well? eaccess can also refer to the parent directory.

@melpon
Copy link

melpon commented Nov 29, 2016

I temporary resolved this issue.
My environment is MacOSX using Homebrew.

cp -r /usr/local/Cellar/elixir/1.3.2 /usr/local/Cellar/elixir/1.3.2.bak
chmod -R +w /usr/local/Cellar/elixir/1.3.2

cp -r /usr/local/Cellar/erlang/19.0.2 /usr/local/Cellar/erlang/19.0.2.bak
chmod -R +w /usr/local/Cellar/erlang/19.0.2

mix release

I think it is not proper method.
I hope this will help.

@andreasguther
Copy link
Author

andreasguther commented Nov 29, 2016

@OnorioCatenacci:

$ uname -a
Darwin Andreass-MBP.<domain removed> 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64

I am at least four levels deep in a development tree that is fully owned by my account, under my home folder.

@andreasguther
Copy link
Author

@melpon:
I also use brew and I tried what you suggested with the permissions but that did not help.

@OnorioCatenacci
Copy link

OnorioCatenacci commented Nov 29, 2016 via email

@OnorioCatenacci
Copy link

OnorioCatenacci commented Nov 29, 2016 via email

@OnorioCatenacci
Copy link

OnorioCatenacci commented Nov 29, 2016 via email

@piotrze
Copy link

piotrze commented Nov 29, 2016

@melpon It worked for me for now.

@bitwalker
Copy link
Owner

@andreasguther would you mind running this with strace attached and pastebin the log? The last file it attempts to open should tell us what it's trying to load from the filesystem and thus where it's failing.

Before you do that though, could you try with master and see if this issue is still present? There are a number of changes between 0.10 and master now.

@andreasguther
Copy link
Author

andreasguther commented Dec 3, 2016

@bitwalker
I will try to use master tomorrow. I do not have strace on Mac but did run sudo filebyproc.d to capture opened files. I grep'd for everything with beam and got over 6000 lines of code. Not sure if it makes sense to paste all that to pastebin.

The last few entries are the following.

CPU    ID                    FUNCTION:NAME
...
  6    187                       open:entry beam.smp rel/hello_phoenix/releases/0.0.1/start_clean.boot
  6    187                       open:entry beam.smp rel/hello_phoenix/releases/0.0.1/start_clean.boot
  0    187                       open:entry beam.smp rel/hello_phoenix/bin/start_clean.boot
  6    973              open_nocancel:entry beam.smp .
  2    973              open_nocancel:entry beam.smp .
  6    187                       open:entry beam.smp rel/hello_phoenix/releases/0.0.1/start_clean.boot
  0    187                       open:entry beam.smp rel/hello_phoenix/bin/start_clean.boot

Last night I forgot to check the start_clean.boot file. I am editing this post and ere is the content of the directory:

bin aguther$ ls -al
total 80
drwxr-xr-x  7 aguther  staff    238 Nov 27 13:37 .
drwxr-xr-x  7 aguther  staff    238 Nov 27 13:06 ..
-rwxrwxrwx  1 aguther  staff    757 Dec  2 20:38 hello_phoenix
-rw-r--r--  1 aguther  staff   4400 Nov 27 13:05 install_upgrade.escript
-rwxr-xr-x  1 aguther  staff   5901 Dec  2 20:38 nodetool
-rw-r--r--  1 aguther  staff  10832 Dec  2 20:38 release_utils.escript
-r--r--r--  1 aguther  admin   5479 Sep 20 00:36 start_clean.boot
bin aguther$ 

@andreasguther
Copy link
Author

@OnorioCatenacci: Thank you for taking your time and providing suggestions. I can run my application without problem with my current environment. I also run other applications from other projects with the same configuration. It is with distillery that I see the problem. I tried to collect all the information about reproducing including creating the minimal project in the initial description. I understand it is long but I tried to answer all the questions from the issue template.

@andreasguther
Copy link
Author

I just change my configuration to point to distillery master and could then build release for both the basic phoenix and my project.

@bitwalker
Copy link
Owner

@andreasguther A new release was published since your last message, so you can switch to that rather than pointing to master :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants