pixelated / pixelated-user-agent

User facing components of Pixelated: a JavaScript single page app and a RESTful service.
GNU Affero General Public License v3.0
159 stars 72 forks source link

Vagrant doesn't allow symlinks on shared folders #1077

Closed tayanefernandes closed 7 years ago

tayanefernandes commented 7 years ago

It seems the VM is trying to point to a symlink created for a npm dependency, but Vagrant doesn't allow symlinks on shared folders for security reasons.

enoent ENOENT: no such file or directory, chmod '/vagrant/web-ui/node_modules/coffee-script/bin/coffee' npm/npm#7308 https://stackoverflow.com/questions/24200333/symbolic-links-and-synced-folders-in-vagrant

==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! Linux 3.16.0-4-amd64
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! node v7.10.0
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! npm  v4.2.0
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! path /vagrant/web-ui/node_modules/coffee-script/bin/coffee
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! code ENOENT
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! errno -2
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! syscall chmod
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns:
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! enoent ENOENT: no such file or directory, chmod '/vagrant/web-ui/node_modules/coffee-script/bin/coffee'
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! enoent ENOENT: no such file or directory, chmod '/vagrant/web-ui/node_modules/coffee-script/bin/coffee'
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! enoent This is most likely not a problem with npm itself
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! enoent and is related to npm not being able to find a file.
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! enoent
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns:
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR! Please include the following file with any support request:
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: npm ERR!     /home/vagrant/.npm/_logs/2017-06-01T16_45_38_093Z-debug.log
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: /bin/sh: 4: node_modules/.bin/bower: not found
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: Makefile:24: recipe for target 'requirements_js' failed
==> source: Notice: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: make: *** [requirements_js] Error 127
==> source: Error: /usr/bin/make install returned 2 instead of one of [0]
==> source: Error: /Stage[main]/Pixelated::Source::Install_useragent/Exec[install-pixelated]/returns: change from notrun to 0 failed: /usr/bin/make install returned 2 instead of one of [0]
==> source: Notice: Finished catalog run in 772.69 seconds
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
tayanefernandes commented 7 years ago

Just references from this comment: https://github.com/pixelated/pixelated-user-agent/issues/1073#issuecomment-305315206

The solution of using npm install --no-bin-linksprevents npm from creating symlinks for any binaries the package might contain. Since we don't have the symlinks, all the commands on the package.json fail because they are also using the symlinks.

I will try to revert the configuration that we have before. Maybe this file: provisioning/modules/pixelated/files/activate_custom_node_modules.sh