How to Fix EACCESS Error During Ember CLI Deployment

Jakub Niechciał

Jun 6, 2016 • 2 min read

Problem

Ember CLI deploy fails on running:

/usr/bin/env ./node_modules/ember-cli/bin/ember build --environment smoke --output-path dist/

Example log:

DEBUG [c38ba40d] Command: cd /home/fltctrl-front-smoke/app/releases/20150908110333 && /usr/bin/env ./node_modules/ember-cli/bin/ember build --environment smoke --output-path dist/

DEBUG [c38ba40d] version: 1.13.8

DEBUG [c38ba40d] Could not find watchman, falling back to NodeWatcher for file system events.

DEBUG [c38ba40d] Visit http://www.ember-cli.com/user-guide/#watchman for more info.

DEBUG [c38ba40d] Building

DEBUG [c38ba40d] bootstrap-sassy config: all JS enabled, glphicons enabled

DEBUG [c38ba40d] Building.

DEBUG [c38ba40d] Build failed.

DEBUG [c38ba40d] File: modules/ember-cli-app-version/components/app-version.js

DEBUG [c38ba40d] EACCES, mkdir '/tmp/async-disk-cache/2d1fa0700ad69dcddfe7f081bbf11052'

DEBUG [c38ba40d] Error: EACCES, mkdir '/tmp/async-disk-cache/2d1fa0700ad69dcddfe7f081bbf11052'

DEBUG [c38ba40d] at Error (native)

DEBUG [c38ba40d]

(Backtrace restricted to imported tasks)

cap aborted!

SSHKit::Runner::ExecuteError: Exception while executing as fltctrl-front-smoke@fltctrl.smoke.devguru.co: ./node_modules/ember-cli/bin/ember exit status: 1

./node_modules/ember-cli/bin/ember stdout: Nothing written

./node_modules/ember-cli/bin/ember stderr: Nothing written


SSHKit::Command::Failed: ./node_modules/ember-cli/bin/ember exit status: 1

./node_modules/ember-cli/bin/ember stdout: Nothing written

./node_modules/ember-cli/bin/ember stderr: Nothing written

Solution

Ember and/or npm use the same global /tmp directory. When two apps have the same lib, there may be a situation where the current user will not have rights to overwrite a new folder or file.

You have to set TEMP env variable for the user. In your deploy.rb file, add:

set :default_env, {
  'TEMP' => '/tmp/{app_name}_tmp'
}

More posts by this author

Jakub Niechciał

Codestories Newsletter