Skip to content

Permissions issue on Heroku Deploy. Attributes not passed via git. #511

@kayakyakr

Description

@kayakyakr

Which operating system and version is the project developed on?
Linux (general)

Which version of ruby is the project developed on?
2.2.3

Which version of npm is the project developed on?
3.10.8

Which version of ember-cli is the project developed on?
1.13.13

What is the rails version?
4.2

What is the ember-cli-rails version (from Gemfile)?
0.8.3

What is the ember-cli-rails-addon version (from package.json)?
"rondale-sc/ember-cli-rails-addon"

Is your application server multi-threaded
(such as puma and unicorn) or is it multi-process (such as thin and webrick)?

Puma

How is the application deployed?
Manual Heroku Deploy

Issue

Alright, now that I got through all of that. I'm trying to convert a capistrano deploy over to heroku. Updated ember-cli-rails, ran the heroku generator, set build packs, pushed to heroku.

I get this error:

remote:        > undefined postinstall /tmp/build_2fc013553dfb362c78bacfaf58530cdb
remote:        > ./bin/heroku_install
remote:        
remote:        sh: 1: ./bin/heroku_install: Permission denied
remote:        
remote:        npm ERR! Linux 3.13.0-105-generic
remote:        npm ERR! argv "/tmp/build_2fc013553dfb362c78bacfaf58530cdb/.heroku/node/bin/node" "/tmp/build_2fc013553dfb362c78bacfaf58530cdb/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_2fc013553dfb362c78bacfaf58530cdb/.npmrc"
remote:        npm ERR! node v6.9.1
remote:        npm ERR! npm  v3.10.8
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! undefined postinstall: `./bin/heroku_install`
remote:        npm ERR! Exit status 126

Or, in other words, it's getting a permission denied on ./bin/heroku_install

I thought, well maybe it's an issue with permissions, but an ls -l returns:

ls -l ./bin/
total 16
-rwxrwxr-x 1 kayakyakr kayakyakr 129 Oct 11 19:04 bundle
-rwxrwxr-x 1 kayakyakr kayakyakr 157 Jan 24 10:30 heroku_install
-rwxrwxr-x 1 kayakyakr kayakyakr 146 Oct 11 19:04 rails
-rwxrwxr-x 1 kayakyakr kayakyakr  90 Oct 11 19:04 rake

So I determined this is an issue with passing permissions through git. I modified package.json to look like:

{
  "scripts": {
    "postinstall": [
      "chmod a+x bin/heroku_install",
      "./bin/heroku_install"
    ]
  },
  "devDependencies": {
    "bower": "*"
  },
  "cacheDirectories": [
    "home/node_modules",
    "home/bower_components",
    "node_modules"
  ]
}

which forced the permission change on postdeploy itself and it worked. So that'd be my suggestion to deal with this issue hitting various people.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions