[solved] 1.4.1 on Vagrant 1.9.3: error An unexpected error occurred: "EACCES: permission denied, unlink ..."

Hi,

I just tried to run a fresh VM with vagrant in dev mode, checkouted on 1.4.1 tag, but I can’t start the server. Here are the output of the vagrant ssh -c "cd /vagrant && foreman start" command (done after a vagrant destroy, followed by a vagrant up) :

06:27:01 web.1     | started with pid 30412
06:27:01 sidekiq.1 | started with pid 30413
06:27:01 stream.1  | started with pid 30415
06:27:01 webpack.1 | started with pid 30418
06:27:02 webpack.1 | sh: 1: /vagrant/node_modules/.bin/webpack-dev-server: not found
06:27:02 stream.1  | yarn run v0.24.6
06:27:02 stream.1  | $ rimraf ./tmp/streaming && babel ./streaming/index.js --out-dir ./tmp && node ./tmp/streaming/index.js
06:27:02 stream.1  | sh: 1: rimraf: not found
06:27:02 stream.1  | error Command failed with exit code 127.
06:27:02 stream.1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
06:27:02 web.1     | [30414] Puma starting in cluster mode...
06:27:02 web.1     | [30414] * Version 3.8.2 (ruby 2.4.1-p111), codename: Sassy Salamander
06:27:02 web.1     | [30414] * Min threads: 5, max threads: 5
06:27:02 web.1     | [30414] * Environment: development
06:27:02 web.1     | [30414] * Process workers: 2
06:27:02 web.1     | [30414] * Preloading application
06:27:02 stream.1  | exited with code 1
06:27:02 system    | sending SIGTERM to all processes
06:27:02 webpack.1 | exited with code 127
06:27:03 web.1     | terminated by SIGTERM
06:27:03 sidekiq.1 | terminated by SIGTERM
Connection to 127.0.0.1 closed.

Have you any idea of what is going wrong?

It looks like you don’t have rimraf installed:

sh: 1: rimraf: not found

Try running

npm install rimraf

and then launch Mastodon again?

I wonder why it is not installed with all the rest on vagrant up (when provisionning).

I thought that using Vagrant will avoid such kind of problems, using a standard server configuration; it seems that it’s not so simple…

Got an error:

mastodon@ /vagrant
├── UNMET PEER DEPENDENCY @kadira/storybook@2.35.3
├── UNMET PEER DEPENDENCY react-addons-test-utils@^0.14.0 || ^15.0.0-0
├── UNMET PEER DEPENDENCY react-redux@5.0.4
└── rimraf@2.6.1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN chai-enzyme@0.6.1 requires a peer of react-addons-test-utils@^0.14.0 || ^15.0.0-0 but none was installed.
npm WARN react-redux-loading-bar@2.4.1 requires a peer of react-redux@^3.0.0 || ^4.0.0 but none was installed.
npm WARN react-storybook-addon-intl@0.1.0 requires a peer of @kadira/storybook@^1.35.1 but none was installed.

And I also note an error during vagrant up (provisionning after a vagrant destroy -f) :

==> default: yarn install v0.24.6
==> default: [1/4] Resolving packages...
==> default: [2/4] Fetching packages...
==> default: warning fsevents@1.0.14: The platform "linux" is incompatible with this module.
==> default: info "fsevents@1.0.14" is an optional dependency and failed compatibility check. Excluding it from installation.
==> default: warning store@1.3.20: The engine "browser" appears to be invalid.
==> default: [3/4] Linking dependencies...
==> default: warning "react-redux-loading-bar@2.4.1" has incorrect peer dependency "react-redux@^3.0.0 || ^4.0.0".
==> default: warning "chai-enzyme@0.6.1" has unmet peer dependency "react-addons-test-utils@^0.14.0 || ^15.0.0-0".
==> default: warning "react-storybook-addon-intl@0.1.0" has incorrect peer dependency "@kadira/storybook@^1.35.1".
==> default: error An unexpected error occurred: "EACCES: permission denied, unlink '/vagrant/node_modules/object.values/test/.eslintrc'".
==> default: info If you think this is a bug, please open a bug report with the information provided in "/vagrant/yarn-error.log".
==> default: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Running this vagrant VM on MacOS X is not possible?

I don’t know Vagrant at all, so I can’t speak to whether using it with Mastodon is possible. But I do notice this line in your first set of warnings:

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: 
Unsupported platform for fsevents@1.1.2: 
wanted {"os":"darwin","arch":"any"} 
(current: {"os":"linux","arch":"x64"})

(Broke it up for readability.)

fsevents is looking for Darwin (the internal name of OS X) and seeing Linux instead. This might be linked to the trouble you’re having; are you/is Vagrant doing anything to spoof a different operating system?

just wanted to jump in and say this is a normal warning on linux, i see it in prod on my instances on ubuntu 16.04

1 Like

Awesome, thank you. (adding characters so discourse doesn’t complain :wink: )

1 Like

Vagrant is a VM manager (based on VirtualBox app), so in the VM it’s Ubuntu which is running, not MacOS X Darwin.

Anyway, the advantage of Vagrant is that you should not to be aware of such env problem as the VM should be the same for everybody. It’s why I’m a little bit confused about these errors :slight_smile:

Okay, that’s what I figured was going on but I thought I’d make sure.

Are you using the Vagrant guide in the docs?

Yes I follow this (official) guide to run a vagrant dev of mastodon.

I just did it again, after a vagrant destroy -f to be sure, and same errors occur

Question - what filesystem are your files on? Do you share that filesystem with MacOS X? Does it happen also if you do it on a Ubuntu filesystem that is not shared with the host?

No sharing at all on my laptop, and I use the standard HFS+ filesystem from Mac OS X, but I wonder if it has an impact as the vagrant VM worked before with the 1.3.3 version of Mastodon

I did the same test with the 1.4.3 release and no difference, nothing is running.

Am I the only one running the dev Vagrant VM on Max OS X ?

And then erasing everything (VM, files, local repository, …), fresh clone from repository, checkout on the 1.4.3 tag, vagrant up --provider virtualbox and voila:

…
==> default: could not change directory to "/vagrant": Stale file handle
==> default: could not change directory to "/vagrant": Stale file handle
==> default: ERROR:  While executing gem ... (Errno::ESTALE)
==> default:     Stale file handle @ dir_chdir - /vagrant
…
==> default: error Could not write file "/vagrant/yarn-error.log": "Unknown system error -116: Unknown system error -116, open '/vagrant/yarn-error.log'"
==> default: error An unexpected error occurred: "Unknown system error -116: Unknown system error -116, mkdir '/vagrant/node_modules'".
…
==> default: Running provisioner: shell...
/opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/subprocess.rb:63:in `pwd': No such file or directory - getcwd (Errno::ENOENT)
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/subprocess.rb:63:in `execute'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/subprocess.rb:22:in `execute'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/providers/virtualbox/driver/base.rb:430:in `block in raw'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/providers/virtualbox/driver/base.rb:429:in `raw'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/providers/virtualbox/driver/base.rb:367:in `block in execute'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/retryable.rb:17:in `retryable'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/providers/virtualbox/driver/base.rb:362:in `execute'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/providers/virtualbox/driver/version_5_0.rb:551:in `read_state'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/providers/virtualbox/provider.rb:97:in `state'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/machine.rb:506:in `state'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/plugins/providers/virtualbox/action/import.rb:78:in `recover'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/warden.rb:67:in `block in recover'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/warden.rb:64:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/warden.rb:64:in `recover'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/builtin/call.rb:61:in `recover'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/warden.rb:67:in `block in recover'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/warden.rb:64:in `each'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/warden.rb:64:in `recover'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/warden.rb:53:in `rescue in call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/warden.rb:28:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/machine.rb:225:in `action_raw'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/machine.rb:200:in `block in action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:567:in `lock'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/machine.rb:186:in `call'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/machine.rb:186:in `action'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Running again the same cmd give me:

/opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:85:in `pwd': No such file or directory - getcwd (Errno::ENOENT)
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/lib/vagrant/environment.rb:85:in `initialize'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/bin/vagrant:118:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.9.3/bin/vagrant:118:in `<main>'
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Finally found the pb: updating vagrant 1.9.3 to last 1.9.5 and everything is running as expected \o/

That was probably not a fix. Keep in mind that /vagrant is shared by default and the errors you were getting were NFS-related. So it seems like a 100% filesystem-related problem to me.

Anyway, I tried again with the next releases, up to the last 1.4.6 and everything is ok now.

1 Like