Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while linking: [Errno 71] Protocol error #8

Closed
starise opened this issue May 14, 2014 · 13 comments
Closed

Error while linking: [Errno 71] Protocol error #8

starise opened this issue May 14, 2014 · 13 comments

Comments

@starise
Copy link

starise commented May 14, 2014

Initially I received this dependency problem:

==> default: A package failed to install.  Trying to recover:
==> default:  * Stopping MariaDB database server mysqld
==> default:    ...done.
==> default:  * Starting MariaDB database server mysqld
==> default:    ...fail!
==> default: invoke-rc.d: initscript mysql, action "start" failed.
==> default: dpkg: error processing package mariadb-server-10.0 (--configure):
==> default:  subprocess installed post-installation script returned error exit status 1
==> default: dpkg: dependency problems prevent configuration of mariadb-server:
==> default:  mariadb-server depends on mariadb-server-10.0 (= 10.0.11+maria-1~trusty); however:
==> default:   Package mariadb-server-10.0 is not configured yet.
==> default:
==> default: dpkg: error processing package mariadb-server (--configure):
==> default:  dependency problems - leaving unconfigured
==> default: Errors were encountered while processing:
==> default:  mariadb-server-10.0
==> default:  mariadb-server

Solved doing this in the guest:

vagrant@example:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mariadb-server-10.0 (10.0.11+maria-1~trusty) ...
 * Stopping MariaDB database server mysqld                                                                                                                                                                                            [ OK ]
 * Starting MariaDB database server mysqld                                                                                                                                                                                            [ OK ]
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
Setting up mariadb-server (10.0.11+maria-1~trusty) ...

Now I get an error when running ansible (the "hosts" file is the default renamed).
How can I fix this?

==> default:
==> default: TASK: [wordpress-sites | Create .env file of sites] ***************************
==> default: changed: [192.168.50.5] => (item={'site_install': True, 'admin_user': 'admin', 'site_name': 'example.dev', 'system_cron': True, 'user': 'vagrant', 'run_composer': True, 'multisite': {'enabled': False}, 'group': 'www-data', 'site_title': 'Example Site', 'admin_password': 'admin', 'env': {'wp_env': 'development', 'db_user': 'example_dbuser', 'db_password': 'example_dbpassword', 'wp_siteurl': 'http://example.dev/wp', 'db_name': 'example_dev', 'wp_home': 'http://example.dev'}, 'site_hosts': ['192.168.50.5', 'example.dev'], 'admin_email': 'admin@example.dev'})
==> default:
==> default: TASK: [wordpress-sites | Link .env file] **************************************
==> default: failed: [192.168.50.5] => (item={'site_install': True, 'admin_user': 'admin', 'site_name': 'example.dev', 'system_cron': True, 'user': 'vagrant', 'run_composer': True, 'multisite': {'enabled': False}, 'group': 'www-data', 'site_title': 'Example Site', 'admin_password': 'admin', 'env': {'wp_env': 'development', 'db_user': 'example_dbuser', 'db_password': 'example_dbpassword', 'wp_siteurl': 'http://example.dev/wp', 'db_name': 'example_dev', 'wp_home': 'http://example.dev'}, 'site_hosts': ['192.168.50.5', 'example.dev'], 'admin_email': 'admin@example.dev'}) => {"failed": true, "item": {"admin_email":
==> default: "admin@example.dev", "admin_password": "admin", "admin_user": "admin", "env": {"db_name": "example_dev", "db_password": "example_dbpassword", "db_user": "example_dbuser", "wp_env": "development", "wp_home": "http://example.dev", "wp_siteurl": "http://example.dev/wp"}, "group": "www-data", "multisite": {"enabled": false}, "run_composer": true, "site_hosts": ["192.168.50.5", "example.dev"], "site_install": true, "site_name": "example.dev", "site_title": "Example Site", "system_cron": true, "user": "vagrant"}, "path": "/srv/www/example.dev/current/.env", "state": "absent"}
==> default: msg: Error while linking: [Errno 71] Protocol error
==> default:
==> default: FATAL: all hosts have already failed -- aborting
==> default:
==> default: PLAY RECAP ********************************************************************
==> default:            to retry, use: --limit @/root/site.retry
==> default:
==> default: 192.168.50.5               : ok=40   changed=15   unreachable=0    failed=1
@swalkinshaw
Copy link
Member

Never seen either of those errors unfortunately. Adding ansible.verbose = 'vvvv' to your Vagrantfile and re-provisioning might provide more debug information to help.

@starise
Copy link
Author

starise commented May 14, 2014

Ok, i should have to say that, 'cause i'm using a Windows host and Ansible doesnt works on Windows, i have modified your Vagrantfile to redirect the Ansible call on the guest using a little shell script. I'll hope you'll be so kind to take a look: https://gist.github.com/starise/e90d981b5f9e1e39f632

I tried to add the --verbose parameter in the ansible-playbook call but the output is almost the same. The problem seems to be related on the missed ".env" file, if you take a look at the output above, it says:

"path": "/srv/www/example.dev/current/.env", "state": "absent"

and actually there's no listed file in that directory.

@swalkinshaw
Copy link
Member

Could you ssh into the Vagrant box and see if /srv/www/example.dev/shared/.env exists? And if the other folders like current exist as well and the synced folder contents are there?

@swalkinshaw
Copy link
Member

Oh of course... pretty sure Windows has problems by default with symlinks in synced folders.

Some things to try here: https://coderwall.com/p/b5mu2w and http://stackoverflow.com/questions/13716012/vagrant-shared-folder-symlinks

If you Google that you'll find a lot of resources about it.

@starise
Copy link
Author

starise commented May 16, 2014

You were right! it was a symlink creation problem, but not on the vagrant side, because the problem is already solved: hashicorp/vagrant@387692f

Infact my .vbox config files had the Extravalue right setting inside. For some strange motivation, even if the Windows user is in the administrator's group and has right privileges to run mklink, remains impossible to create symlink using the normal user (even disabling UAC). The only way to have symlinks to work is to run vagrant up and vagrant provision in an elevated command prompt.

I tested your latest master build with my script for windows and seems to run perfectly without any kind of error ;) if someone is interested in this, here are my setup: http://git.io/WD7KYQ

Thanks for your help.

@swalkinshaw
Copy link
Member

@starise I'm going to look into integrating your script as a documented option at least. Or by checking if the host is Windows in the Vagrantfile.

I had just assumed Ansible could work on Windows until a few weeks ago.

@starise
Copy link
Author

starise commented May 16, 2014

No problem, thanks for your great work! ;)

@swalkinshaw
Copy link
Member

@starise I've updated the README and linked to your solution for now. Thanks!

@hojinni
Copy link

hojinni commented May 23, 2014

thank you for the great work!! I'm just new to this but how to install ansible in window or did you install in vm running vagrant? My system is window and running vm with vagrant. want to use ansible & vagrant combination.
Thank you!!

@Idealien
Copy link

Ansible within the vagrant.

Also - If you use the following format for rsync to sync folders you don't get the permissions issue for trying to use the hosts file (as executable)

config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/", rsync__args: [ "--verbose", "--archive", "--delete", "-z", "--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r" ]

@vladcosorg
Copy link

EDIT: I guess i haven't read the #8 (comment) comment attentively :) Thanks to @starise

If you're using windows and want to get symlinks working, make sure you run vagrant as administrator, because using

    vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
    vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/current", "1"]

was not enough in my case, symlinks still weren't working until i run vagrant as admin.

@hatelove85911
Copy link

@chetzof , how to run vagrant as administrator??

@Idealien
Copy link

@hatelove85911 Run your IDE (or whatever method you use to open terminal / command line) as admin and vagrant inherits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants