Page MenuHomePhabricator

npm install fails for changeprop service in MW-Vagrant jessie-migration
Open, HighPublic

Description

When provisioning a Jessie-migration branch MW-Vagrant instance after enabling the 'visualeditor' role, everything works except the npm install for the changeprop service:

...
==> default: Notice: /Stage[main]/Changeprop/Service::Node[changeprop]/Npm::Install[/vagrant/srv/changeprop]/Exec[/vagrant/srv/changeprop_npm_install]/returns:   COPY Release/rdkafka.a
==> default: Notice: /Stage[main]/Changeprop/Service::Node[changeprop]/Npm::Install[/vagrant/srv/changeprop]/Exec[/vagrant/srv/changeprop_npm_install]/returns: cp: preserving permissions for ‘Release/rdkafka.a’: Operation not permitted
==> default: Notice: /Stage[main]/Changeprop/Service::Node[changeprop]/Npm::Install[/vagrant/srv/changeprop]/Exec[/vagrant/srv/changeprop_npm_install]/returns: deps/librdkafka.target.mk:196: recipe for target 'Release/rdkafka.a' failed
==> default: Notice: /Stage[main]/Changeprop/Service::Node[changeprop]/Npm::Install[/vagrant/srv/changeprop]/Exec[/vagrant/srv/changeprop_npm_install]/returns: make: *** [Release/rdkafka.a] Error 1
...

Seems repeatable on macOS 10.12, Vagrant 1.9.1, using defaults (NFS enabled).

Output from npm install in /vagrant/srv/changeprop/

...
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/tinycthread.o
  CC(target) Release/obj.target/librdkafka/deps/librdkafka/src/rdkafka_sasl.o
  AR(target) Release/obj.target/deps/rdkafka.a
  COPY Release/rdkafka.a
cp: preserving permissions for ‘Release/rdkafka.a’: Operation not permitted
deps/librdkafka.target.mk:196: recipe for target 'Release/rdkafka.a' failed
make: *** [Release/rdkafka.a] Error 1
make: Leaving directory '/vagrant/srv/changeprop/node_modules/node-rdkafka/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 3.16.0-4-amd64
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /vagrant/srv/changeprop/node_modules/node-rdkafka
gyp ERR! node -v v4.7.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.7.3
npm ERR! npm  v2.15.11
npm ERR! code ELIFECYCLE

npm ERR! node-rdkafka@0.6.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-rdkafka@0.6.4 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-rdkafka package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-rdkafka
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls node-rdkafka
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /vagrant/srv/changeprop/npm-debug.log

I can confirm that copying with preserved permissions fails on the share:

vagrant@mediawiki-vagrant:/vagrant/srv/changeprop$ touch foo.a
vagrant@mediawiki-vagrant:/vagrant/srv/changeprop$ cp -p foo.a foo.b
cp: preserving permissions for ‘foo.b’: Operation not permitted

Event Timeline

brion created this task.Feb 21 2017, 4:33 AM

Blerg. I really hate NFS problems.

bd808 added a subscriber: Reedy.Mar 13 2017, 8:14 PM

The suggested quick fix here is to run vagrant settings nfs_shares off to disable NFS shares and reload your VM. @Reedy has been having problems with NFS permissions mappings on his OSX host system and tracked down an upstream bug report that makes this sound like some regression in the OSX NFS server.

Pchelolo added a subscriber: Pchelolo.

Change-Prop depends on a native kafka driver that in turn depends on librdkafka library. The binary build of the library is what's causing the problems there, but in production we depend on a shared librdkafka package installed on the host and skip building the library from sources. I will investigate if we could do the same in Vagrant.