Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

File system permission errors with vmware fusion 8.0 pro #1817

Closed
jmartin84 opened this issue Sep 7, 2015 · 8 comments
Closed

File system permission errors with vmware fusion 8.0 pro #1817

jmartin84 opened this issue Sep 7, 2015 · 8 comments

Comments

@jmartin84
Copy link

I recently switch from virtualbox vmware fusion and updated it to 8.0 pro, now when in a interactive shell for a given container I'm getting permission errors when trying to run npm install. Any direction here would be great, thanks!

docker 1.8.1
docker-machine version 0.4.1 (HEAD)
vmware fusion 8.0 pro
HGFS share

[root@16a81cee8692 src]# rm -rf node_modules/
[root@16a81cee8692 src]# npm install
npm ERR! tar.unpack untar error /root/.npm/glob/5.0.14/package.tgz
npm ERR! tar.unpack untar error /root/.npm/dateformat/1.0.11/package.tgz
npm ERR! tar.unpack untar error /root/.npm/gulp-util/3.0.6/package.tgz
npm ERR! tar.unpack untar error /root/.npm/gulp/3.9.0/package.tgz
npm ERR! tar.unpack untar error /root/.npm/bulk-require/0.2.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/pg-hstore/2.3.2/package.tgz
npm ERR! tar.unpack untar error /root/.npm/lodash/3.10.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/gulp-lintspaces/0.2.3/package.tgz
npm ERR! tar.unpack untar error /root/.npm/gulp-load-plugins/0.10.0/package.tgz
npm ERR! tar.unpack untar error /root/.npm/gulp-mocha/2.1.3/package.tgz
npm ERR! tar.unpack untar error /root/.npm/replace-ext/0.0.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/vinyl/0.5.3/package.tgz
npm ERR! tar.unpack untar error /root/.npm/pg/4.4.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/chai-as-promised/5.1.0/package.tgz
npm ERR! tar.unpack untar error /root/.npm/chokidar/1.0.5/package.tgz
npm ERR! tar.unpack untar error /root/.npm/gulp-istanbul/0.8.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/fs-extra/0.20.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/chai/3.2.0/package.tgz
npm ERR! tar.unpack untar error /root/.npm/sinon/1.16.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/gulp-eslint/0.11.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/bluebird/2.9.34/package.tgz
npm ERR! tar.unpack untar error /root/.npm/sequelize/3.7.1/package.tgz
npm ERR! tar.unpack untar error /root/.npm/moment/2.10.6/package.tgz
npm ERR! Linux 4.0.9-boot2docker
npm ERR! argv "node" "/usr/bin/npm" "install"
npm ERR! node v0.10.38
npm ERR! npm  v2.7.5
npm ERR! path /src/node_modules/glob/package.json
npm ERR! code EPERM
npm ERR! errno 50

npm ERR! Error: EPERM, chown '/src/node_modules/glob/package.json'
npm ERR!  { [Error: EPERM, chown '/src/node_modules/glob/package.json']
npm ERR!   errno: 50,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/src/node_modules/glob/package.json',
npm ERR!   fstream_finish_call: 'chown',
npm ERR!   fstream_type: 'File',
npm ERR!   fstream_path: '/src/node_modules/glob/package.json',
npm ERR!   fstream_class: 'FileWriter',
npm ERR!   fstream_stack:
npm ERR!    [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:308:19',
npm ERR!      '/usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:143:7',
npm ERR!      'Object.oncomplete (evalmachine.<anonymous>:108:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /src/npm-debug.log
@ehazlett
Copy link
Contributor

ehazlett commented Sep 8, 2015

/cc @frapposelli

@frapposelli
Copy link
Contributor

This is due to how the VMware shared folder implementation works, the error you see is because npm fails if a file UID/GID change does not complete.

Our Shared Folders implementation currently do not permit this (nor it would make any sense to support, given there is no UID/GID matching between host and guest) and any chown operation will result in an error.

We're evaluating to move any chown operation done on a HGFS filesystem to a simple noop which will make chown return a successful operation, but this has some secondary implications and it's not conceptually correct.

I'd rather advocate for a flag in npm to avoid any chown commands when installing.

@ehazlett ehazlett closed this as completed Sep 9, 2015
@ehazlett
Copy link
Contributor

ehazlett commented Sep 9, 2015

Thanks @frapposelli

@canadaduane
Copy link

Has either direction been pursued further? We're running in to this issue as well (specifically with npm package image-webpack-loader) and we haven't been able to find a work-around. If the npm folks have been notified of this problem, is there a github ticket for it? If not, does implementing chown as noop pass muster?

@canadaduane
Copy link

FYI this relates to codekitchen/dinghy#17

@wchrisjohnson
Copy link

I'm hitting this right now, and would LOVE an answer to this. I really don't want to have to use virtualbox...

@rapha-opensource
Copy link

We are running into this problem as well.
Our workaround is to 'npm install' into a '/deps' dir
and copy ('cp -r') '/deps/node_modules' into
the mounted source code dir. Then run 'npm start'.
Symlinking node_modules does not work because some pkgs have relative paths that do not resolve well.
This is for a development container where the source code dir is mounted.
We use hot-reloading.
(Our production container does not have the problem since the source gets copied entirely
inside the container.)
It's not perfect but it works for us.

Doing a copy operation as part of the CMD is definitely slow,
so if someone can find a better workaround, please comment.

FROM alpine:3.3
RUN apk add --update build-base python nodejs && \
    rm -rf /var/cache/apk/*
COPY package.json /deps/package.json
WORKDIR /deps
RUN npm install
WORKDIR /code
CMD if [ ! -e "node_modules" ]; then cp -r /deps/node_modules /code/. ; fi && npm start

@softinio
Copy link

softinio commented Apr 5, 2016

I have a much simpler workaround for this without having to build your modules somewhere else :-)

I got around this issue by:

Hope this helps.

Thanks.

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

No branches or pull requests

7 participants