nusmodifications / nusmods

🏫 Official course planning platform for National University of Singapore.
https://nusmods.com
MIT License
578 stars 315 forks source link

provision fail #191

Closed kai101 closed 9 years ago

kai101 commented 9 years ago

vagrant provision fail.

failed: [default] => {"changed": true, "cmd": ["bower", "install", "--allow-root"], "delta": "0:00:54.397007", "end": "2015-04-05 03:37:45.454554", "rc": 1, "start": "2015-04-05 03:36:51.057547", "warnings": []}
stderr: bower backbone.picky#~0.2.0                                            invalid-meta backbone.picky is missing "main" entry in bower.json
bower backbone.picky#~0.2.0                                            invalid-meta backbone.picky is missing "ignore" entry in bower.json
bower bootstrap-sass-official#~3.3.0                                       mismatch Version declared in the json (3.3.3) is different than the resolved one (3.3.4)
bower jquery.fileDownload#fc5f120a952213987ea4567ce8a22e105a926dc1     invalid-meta jquery.fileDownload is missing "main" entry in bower.json
bower jquery.fileDownload#fc5f120a952213987ea4567ce8a22e105a926dc1     invalid-meta jquery.fileDownload is missing "ignore" entry in bower.json
bower jqueryui-touch-punch#8f7559b6e65cdc3ee3648d5fe76d38c653f87ff5    invalid-meta jqueryui-touch-punch is missing "main" entry in bower.json
bower jqueryui-touch-punch#8f7559b6e65cdc3ee3648d5fe76d38c653f87ff5    invalid-meta jqueryui-touch-punch is missing "ignore" entry in bower.json
bower mousetrap#~1.4.6                                                 invalid-meta mousetrap is missing "main" entry in bower.json
bower mousetrap#~1.4.6                                                 invalid-meta mousetrap is missing "ignore" entry in bower.json
bower select2#~3.5.1                                                   invalid-meta select2 is missing "ignore" entry in bower.json
bower jquery.ui#~1.11.1                                                invalid-meta jquery-ui is missing "main" entry in bower.json
bower imagesloaded#>=3.0.0                                                 mismatch Version declared in the json (3.1.7) is different than the resolved one (3.1.8)
bower                                                                         EPERM EPERM, chown '/home/vagrant/NUSMods/app/bower_components/localforage/.bower.json'

Stack trace:
/usr/lib/node_modules/bower/node_modules/fstream/lib/writer.js:308:19
/usr/lib/node_modules/bower/node_modules/graceful-fs/polyfills.js:143:7
Object.oncomplete (evalmachine.<anonymous>:108:15)
yangshun commented 9 years ago

Could you provide more details on how to reproduce the error?

kai101 commented 9 years ago

It is master branch, i added

--allow-root

for bower to stop complaining. Still struggle to have it initialize for the first time.

yangshun commented 9 years ago

What command were your running? bower install?

kai101 commented 9 years ago

Following is error without adding allow-root. Seems like adding allow-root causing more error.

TASK: [app_server | command bower install chdir={{ project_dir }}] ************ 
failed: [default] => {"changed": true, "cmd": ["bower", "install"], "delta": "0:00:01.065857", "end": "2015-04-05 05:06:35.729799", "rc": 1, "start": "2015-04-05 05:06:34.663942", "warnings": []}
stderr: bower ESUDO         Cannot be run with sudo

Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.

http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814

You can however run a command with sudo using --allow-root option

FATAL: all hosts have already failed -- aborting
yangshun commented 9 years ago

Could you please answer the question and precisely give the steps and environment to reproduce the problem? I'm having a lot of trouble understanding you and what the problem is in the first place.

kai101 commented 9 years ago

I run a normal 'vagrant up'. is there additional configuration? control server: ubuntu 14.04

vagrantFile unchanged.

yangshun commented 9 years ago

Ok thanks. I'm not too sure about setting up with vagrant but the instructions to set up without vagrant would work fine. Please try that instead for now. @ahbeng could you help him with the vagrant issues?

thebengeu commented 9 years ago

Thanks @kai101! Seems like due to ansible/ansible#10550, sudo: no is not working. That bug has been fixed and will be in Ansible 1.9.1 soon, in the meantime it's probably easiest to downgrade to Ansible 1.8.4:

$ pip uninstall ansible
$ pip install ansible==1.8.4
$ vagrant provision

I've tested and it installs fine after that, but as you may have noticed there's a thing or two that's currently broken with the Vagrant workflow, I'm fixing them now.