GetValkyrie / valkyrie

Valkyrie is an opinionated local dev stack that makes features/git based Drupal development easy.
http://www.getvalkyrie.com
GNU General Public License v3.0
45 stars 11 forks source link

Could not install vnew #91

Closed zanami closed 8 years ago

zanami commented 8 years ago

el capitan virtualbox 5 drush 8 vanilla valkyrie I don't even understand what it's trying to do and where (inside the VM or not).

bash-3.2$ drush vnew valkyrie [notice] Valkyrie project initialized at: valkyrie Bringing machine 'valkyrie' up with 'virtualbox' provider... ==> valkyrie: Importing base box 'ubuntu/trusty64'... ==> valkyrie: Matching MAC address for NAT networking... ==> valkyrie: Checking if box 'ubuntu/trusty64' is up to date... ==> valkyrie: Setting the name of the VM: valkyrie_valkyrie_1464064637272_76732 ==> valkyrie: Clearing any previously set forwarded ports... ==> valkyrie: Clearing any previously set network interfaces... ==> valkyrie: Preparing network interfaces based on configuration... valkyrie: Adapter 1: nat valkyrie: Adapter 2: hostonly ==> valkyrie: Forwarding ports... valkyrie: 22 (guest) => 2222 (host) (adapter 1) ==> valkyrie: Running 'pre-boot' VM customizations... ==> valkyrie: Booting VM... ==> valkyrie: Waiting for machine to boot. This may take a few minutes... valkyrie: SSH address: 127.0.0.1:2222 valkyrie: SSH username: vagrant valkyrie: SSH auth method: private key valkyrie: Warning: Remote connection disconnect. Retrying... valkyrie: Warning: Remote connection disconnect. Retrying... valkyrie: valkyrie: Vagrant insecure key detected. Vagrant will automatically replace valkyrie: this with a newly generated keypair for better security. valkyrie: valkyrie: Inserting generated public key within guest... valkyrie: Removing insecure key from the guest if it's present... valkyrie: Key inserted! Disconnecting and reconnecting using new SSH key... ==> valkyrie: Machine booted and ready! ==> valkyrie: Checking for guest additions in VM... valkyrie: The guest additions on this VM do not match the installed version of valkyrie: VirtualBox! In most cases this is fine, but in rare cases it can valkyrie: prevent things such as shared folders from working properly. If you see valkyrie: shared folder errors, please make sure the guest additions within the valkyrie: virtual machine match the version of VirtualBox you have installed on valkyrie: your host and reload your VM. valkyrie: valkyrie: Guest Additions Version: 4.3.36 valkyrie: VirtualBox Version: 5.0 ==> valkyrie: Checking NFS user/group mapping. ==> valkyrie: Fixing NFS user/group mapping. valkyrie: Setting up SSH access for the 'ubuntu' user. valkyrie: Refreshing SSH connection, to login as 'ubuntu'. valkyrie: Installing Ansible from sources. ==> valkyrie: Installing Ansible build dependencies. ==> valkyrie: Using default stable branch: stable-1.9. ==> valkyrie: Cloning Ansible. ==> valkyrie: Running setups tasks for Ansible. The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

curl -s https://raw.githubusercontent.com/GetValkyrie/ansible-bootstrap/master/install-ansible.sh | /bin/sh

Stdout from the command:

Installing Ansible build dependencies. Using default stable branch: stable-1.9. Cloning Ansible. Running setups tasks for Ansible.

Stderr from the command:

[error] The external command could not be executed due to an application error. [error] The command could not be executed successfully (returned: ssh: Could not resolve hostname valkyrie.val: nodename nor servname provided, or not known , code: 255)

zanami commented 8 years ago

Had to do

vagrant ssh sudo apt-get install libffi-dev sudo apt-get install libssl-dev sudo pip install pyopenssl

which installed cryptography 1.3

Looks like the underlying problem is this:

The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ansible-playbook /tmp/mount.yml -i /tmp/inventory --connection=local --sudo --extra-vars "host_os=universal.x86_64-darwin12.0 host_gid=20 host_uid=501 "

Stdout from the command:

Stderr from the command:

Traceback (most recent call last): File "/usr/local/bin/ansible-playbook", line 4, in import pkg_resources File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2927, in @_call_aside File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2913, in _call_aside f(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2940, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 635, in _build_master ws.require(requires) File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 943, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 829, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'cryptography>=1.1' distribution was not found and is required by paramiko

kienanstewart commented 8 years ago

I haven't looked deeply at any of the playbooks, or the structure of valkyrie in general, but I suspect what has happened is

  1. valkyire downloads it's remote playbooks when installed, so the dependencies of remote sources can change more or less without warning (I installed valkyrie some time ago, and never encoutered this issue)
  2. the base box for valkyrie is ubuntu trusty right now, and python-cryptography is not available there (or not shown here) http://packages.ubuntu.com/search?keywords=python-cryptography

To resolve this I suspect a newer base box + install python-cryptography earlier in the provisioning process would work.

Another option could be to specifically download an older copy of whichever playbook/package uses paramiko; or possibly even just an older version of paramiko itself which doesn't require such a new version of python-cryptography

kienanstewart commented 8 years ago

After a little digging, the part that is going wrong is in a script called from ~/.drush/valkyrie/vagrant/lib/mount/mount.rb (https://github.com/GetValkyrie/ansible-bootstrap/blob/master/install-ansible.sh)

Basically, that file installs the build dependencies with apt-get at some point, and calls --force-yes, but this doesn't actually make "yes" be selected, so apt-get aborts then the git clone fails. The rest breaks from then on.

from a debug ansible install

...
Reading package lists...
Building dependency tree...
Reading state information...
python-httplib2 is already the newest version.
python-httplib2 set to manually installed.
python-six is already the newest version.
python-yaml is already the newest version.
The following extra packages will be installed:
  git-man liberror-perl libexpat1-dev libpython-dev libpython2.7-dev
  python-markupsafe python2.7-dev
Suggested packages:
  git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk
  gitweb git-arch git-bzr git-cvs git-mediawiki git-svn python-jinja2-doc
The following NEW packages will be installed:
  git git-man liberror-perl libexpat1-dev libpython-dev libpython2.7-dev
  python-dev python-ecdsa python-jinja2 python-markupsafe python-paramiko
  python-passlib python-setuptools python2.7-dev
0 upgraded, 14 newly installed, 0 to remove and 14 not upgraded.
Need to get 26.4 MB of archives.
After this operation, 60.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
Using default stable branch: stable-1.9.
Cloning Ansible.
Running setups tasks for Ansible.
...

Workaround that I used (I haven't tested a minimal patch, but this seems to work)

  1. Copy https://raw.githubusercontent.com/GetValkyrie/ansible-bootstrap/master/install-ansible.sh and place it in a web-accesible location
  2. Edit the file, and add --assume-yes to the apt-get calls when install git python-dev, etc.
  3. Edit ~/.drush/valkyrie/vagrant/lib/mount/mount.rb and change the location where it gets the isntall-ansible.sh script and runs it.
  4. drush vnew (works!)
RealLukeMartin commented 8 years ago

Hey @jcord04 I tested your fork and it fixes this issue.

If you can put a PR of your fork on the https://github.com/GetValkyrie/ansible-bootstrap project I will get that merged.

Thanks!