Cannot run vagrant.local after "vagrant up" and "vagrant provision" - wordpress

I have a WordPress VIP multisite theme setup which I need to run using vagrant at my local environment.
I ran vagrant up and then vagrant provision but that does not give me the url (vagrant.local) any more. A few months back when I last worked on this site I got this.
Do I need to make any changes in /etc/hosts file?
Output of vagrant up command:
/opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/util/platform.rb:25: warning: Insecure world writable dir /home/subrara/.phpbrew/php in PATH, mode 040777
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: A newer version of the box 'bento/ubuntu-16.04' is available! You currently
==> default: have version '2.3.5'. The latest is version '201801.02.0'. Run
==> default: `vagrant box update` to update.
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /var/www/wp-projects/yrc
default: /var/log/php => /var/www/wp-projects/yrc/logs/php
==> default: Detected mount owner ID within mount options. (uid: 1000 guestpath: /var/log/php)
==> default: Detected mount group ID within mount options. (gid: 1000 guestpath: /var/log/php)
default: /var/log/nginx => /var/www/wp-projects/yrc/logs/nginx
==> default: Detected mount owner ID within mount options. (uid: 1000 guestpath: /var/log/nginx)
==> default: Detected mount group ID within mount options. (gid: 1000 guestpath: /var/log/nginx)
default: /tmp/vagrant-puppet/manifests-846018e2aa141a5eb79a64b4015fc5f3 => /var/www/wp-projects/yrc/puppet/manifests
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
Output of vagrant provision command:
/opt/vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/util/platform.rb:25: warning: Insecure world writable dir /home/subrara/.phpbrew/php in PATH, mode 040777
==> default: Running provisioner: shell...
default: Running: /tmp/vagrant-shell20180118-22825-89veip.sh
==> default: Running provisioner: puppet...
==> default: Running Puppet with development.pp...
==> default: Notice: Compiled catalog for vagrant.local in environment production in 3.86 seconds
==> default: Notice: Finished catalog run in 5.38 seconds
==> default: Running provisioner: shell...
default: Running: /tmp/vagrant-shell20180118-22825-uoa51f.sh
When I ran http://vagrant.local, I got the following message:
Unable to load wpcom-legacy-redirector-1.3.0 (plugins) using
wpcom_vip_load_plugin()!
My Vagrantfile is inside /var/www/wp-projects/wpms folder and I am running vagrant commands from this directory. However, the path of my theme is /var/www/wp-projects/wpms/wp/wp-contnet/themes/vip/tourism-theme
Am I missing something? I am not a regular user of vagrant environment. I am on Ubuntu 140.04.
EDIT:
Screenshot

I got it sorted out with the help of my senior! Here is what I did.
The plugin is actually a part of WordPress VIP plugin and it resides under wp-content/themes/vip/plugins directory. The latest to be pulled into this directory. Once I did that, everything started working just fine!

Related

Vagrant - default: SSH auth method: private key Timeout

Having real hard time solving this one:
I'm trying to 'vagrant up' and everything seems ok until I reach a point:
==> default: The cookbook path 'C:/home/webs/cookbooks' doesn't exist. Ignoring...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 (guest) => 8081 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Configurations:
Vagrant 1.8.7
plugins:
vagrant-berkshelf (5.1.1)
vagrant-hostmanager (1.8.5)
vagrant-share (1.1.6, system)
vagrant-triggers (0.5.3)
vagrant-vsphere (1.12.0)
using:
Oracle Virtual Box v5.1.8
Chef v1.1.16
Windows-7
What I tried so far:
check if Virtualization is enabled.
remove the following folders: [.vagrant.d, .VirtualBox] [enter image description here]1 and install all plugins again.
run with gui set to true, and I dont see any .ssh folder inside.
Turned off the firewall.
I Have other computers that have the same versions and run just fine. So I can compare. but I have no more clues how to continue from here...
Found a solution: a program named: Web Companion Lavasoft was blocking the creation of ssh communication, I removed it and it worked.

Vagrant: boot2docker: Unable to find image 'drupal' locally

I try to run Drupal as a Docker container in the Vagrant box boot2docker (on Windows 8.1).
Vagrantfile (Drupal container)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.provider "docker" do |docker|
docker.vagrant_vagrantfile = "host/Vagrantfile"
docker.image = "drupal"
docker.ports = ['80:80']
docker.name = 'drupal-container'
end
config.vm.synced_folder ".", "/vagrant", type: "smb", disabled: true
end
host/Vagrantfile (boot2docker)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "mitchellh/boot2docker"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "docker"
config.vm.hostname = "docker-host"
end
Running vagrant up in the directory of my Drupal container results in an error, because 'drupal' image can not be found.
Output
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
default: Vagrant will now create or start a local VM to act as the Docker
default: host. You'll see the output of the `vagrant up` for this VM below.
default:
default: Importing base box 'mitchellh/boot2docker'...
default: Matching MAC address for NAT networking...
default: Checking if box 'mitchellh/boot2docker' is up to date...
default: Setting the name of the VM: boot2docker_default_1463038875167_93224
default: Clearing any previously set network interfaces...
default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Forwarding ports...
default: 2375 (guest) => 2375 (host) (adapter 1)
default: 80 (guest) => 8080 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
default: Running 'pre-boot' VM customizations...
default: Booting VM...
default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: docker
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
default: Machine booted and ready!
No installation found.
The guest's platform ("tinycore") is currently not supported, will try generic Linux method...
Copy iso file C:\Program Files/Oracle/VirtualBox/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Installing Virtualbox Guest Additions 5.0.20 - guest version is unknown
mkdir: can't create directory '/tmp/selfgz80627365': No such file or directory
Cannot create target directory /tmp/selfgz80627365
You should try option --target OtherDirectory
An error occurred during installation of VirtualBox Guest Additions 5.0.20. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
default: Setting hostname...
default: Running provisioner: docker...
==> default: Warning: When using a remote Docker host, forwarded ports will NOT be
==> default: immediately available on your machine. They will still be forwarded on
==> default: the remote machine, however, so if you have a way to access the remote
==> default: machine, then you should be able to access those ports there. This is
==> default: not an error, it is only an informational message.
==> default: Creating the container...
default: Name: drupal-container
default: Image: drupal
default: Port: 80:80
A Docker command executed by Vagrant didn't complete successfully!
The command run along with the output from the command is shown
below.
Command: "docker" "run" "--name" "drupal-container" "-d" "-p" "80:80" "drupal"
Stderr: Unable to find image 'drupal' locally
Pulling repository drupal
2016/05/12 07:42:05 Could not reach any registry endpoint
Stdout:
It works, if I change the box of the host to ubuntu/trusty64
host/Vagrantfile (ubuntu/trusty64)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "docker"
config.vm.hostname = "docker-host"
end
but I like to use boot2docker, because it is more lightweight.
What is wrong with my vagrant configuration? How can I get the boot2docker box to work as host?
I can't actually get your configuration to work but I have tested the mitchellh/boot2docker box and found the issue. The output of docker version inside that box is:
Client version: 1.2.0
Client API version: 1.14
Go version (client): go1.3.1
Git commit (client): fa7b24f
OS/Arch (client): linux/amd64
Server version: 1.2.0
Server API version: 1.14
Go version (server): go1.3.1
Git commit (server): fa7b24f
This version of docker is very outdated and now unable to pull images from docker hub at all. You can see where the docker team announced the deprecation here: https://blog.docker.com/2015/10/docker-hub-deprecation-1-5/
Currently you must have docker >= 1.6 to pull images from docker hub.

Laravel/Homestead up does not open the app with 502 nginx/1.9.7 error

Please, help!
After I updated vagrant and homestead, the homestead does not bring the page. I have tried to reinstall vagrant, vm, homestead but the same empty page with 502 Bad Gateway and nginx errors continues to come up. This is the code from 'homestead up' command:
pavelkrotov$ homestead up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 (guest) => 8000 (host) (adapter 1)
default: 443 (guest) => 44300 (host) (adapter 1)
default: 3306 (guest) => 33060 (host) (adapter 1)
default: 5432 (guest) => 54320 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => /Users/pavelkrotov/.composer/vendor/laravel/homestead
default: /home/vagrant/Sites => /Users/pavelkrotov/Sites
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
default: Running: inline script
==> default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCepZ6J7i8UruJj/Qvw7j7GFYgLYajrE4GqSUO1tK4o3KFZh1pttt8lHKMqSfR1Ltw4/qA0ZtX2iqTh8INe1zaI8kFooxC0vURyEdzu1OLRvast6AGFXIsY6QXI8/5ayWoRBVPfeaphoO/QlbwaN9hjG/V0ux0dC9gk4vsKKQsxcN+MkEMDLUICYb4X+3AN8G3ROvc6iGae+CDvrwUhbAQy04CLJSmEFYk8Dp4HCEjynuzSynXeQKL2yyAx9aBmjMualREkITxkJ5c9m4TGqEBU3r9yQcxWOJ5m4tEvvjhmW4uSzglxNapD1rt4BqZuuLkM/33A2nRvPixbJHh5VtRp you#homestead
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: /var/folders/0w/tk3pjfvx4jn5bnx1kjdv2hxw0000gn/T/vagrant-shell20160104-29643-12jcfdq.sh
==> default: Running provisioner: shell...
default: Running: /var/folders/0w/tk3pjfvx4jn5bnx1kjdv2hxw0000gn/T/vagrant-shell20160104-29643-5yn8ap.sh
==> default: nginx stop/waiting
==> default: nginx start/running, process 1831
==> default: php5-fpm: unrecognized service
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.
What is going on? How to fix the issue? Thanks

How to see Nginx default page using vagrant docker provider?

I try to run my Nginx server using vagrant docker provider like:
vagrant up
The Vagrantfile instructions are:
# Specify Vagrant version and Vagrant API version
Vagrant.require_version ">= 1.6.0"
VAGRANTFILE_API_VERSION = "2"
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
# Create and configure the Docker container(s)
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.network "private_network", ip: "192.168.66.66"
config.vm.provider "docker" do |docker|
docker.name = 'nginx-container'
docker.image = "nginx:latest"
docker.ports = ['80:80', '443:443']
end
end
If I check status of vagrant with vagrant status I get:
Current machine states:
default running (docker)
The container is created and running. You can stop it using
`vagrant halt`, see logs with `vagrant docker-logs`, and
kill/destroy it with `vagrant destroy`.
When I try to get http://192.168.66.66/ page, I get ERR_CONNECTION_TIMED_OUT and page not load. Why I don't see Nginx default web page?
The logs during vagrant up in console are:
==> default: Docker host is required. One will be created if necessary...
default: Docker host VM is already ready.
==> default: Syncing folders to the host VM...
default: Installing rsync to the VM...
default: Rsyncing folder: /Users/victor/www/symfony/ => /var/lib/docker/docker_1430638235_29519
==> default: Warning: When using a remote Docker host, forwarded ports will NOT be
==> default: immediately available on your machine. They will still be forwarded on
==> default: the remote machine, however, so if you have a way to access the remote
==> default: machine, then you should be able to access those ports there. This is
==> default: not an error, it is only an informational message.
==> default: Creating the container...
default: Name: nginx-container
default: Image: nginx:latest
default: Volume: /var/lib/docker/docker_1430638235_29519:/vagrant
default: Port: 80:80
default: Port: 443:443
default:
default: Container created: b798ea3309612fb2
==> default: Starting container...
==> default: Provisioners will not be run since container doesn't support SSH.
This is several months old, but I'll answer anyway for the sake of other people that might land here:
Use docker ps to see your image identifier, should be 'b798ea3309612fb2'
and then do:
docker inspect b798ea3309612fb2 | grep IPAddress
So you'll confirm the IP address.
Since you're exposing the ports, you should see them in your REAL (whatever container you're using for Vagrant) IP.
Make sure there is no firewall blocking them.

Vagrant up fails with stdin, start, ssh, stderr & stdout errors

I cannot for the life of me...after reinstalling all things VVV/VBox(4.3.10) & running vagrant up --provision figure out why this beauty(VVV) wont run. I'm unable to access any of the wordpress sites such as http://local.wordpress.dev/.
Specs:
Windows 8.1
Cygwin
Final lines after running the cmd ->
vagrant up --provision
==> default: http://gruntjs.com/getting-started
==> default: Downloading phpMyAdmin 4.1.14...
==> default: Restart Nginx...
==> default: * Restarting nginx nginx
==> default: ...done.
==> default: Cleaning the virtual machine's /etc/hosts file...
==> default: Adding domains to the virtual machine's /etc/hosts file...
==> default: * Added vvv.dev from /srv/www/vvv-hosts
==> default: * Added local.wordpress.dev from /srv/www/vvv-hosts
==> default: * Added local.wordpress-trunk.dev from /srv/www/vvv-hosts
==> default: * Added src.wordpress-develop.dev from /srv/www/vvv-hosts
==> default: * Added build.wordpress-develop.dev from /srv/www/vvv-hosts
==> default: -----------------------------
==> default: Provisioning complete in 1636 seconds
==> default: External network connection established, packages up to date.
==> default: For further setup instructions, visit http://vvv.dev
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: start: Job is already running: mysql
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell
Stdout from the command:
Stderr from the command:
stdin: is not a tty
start: Job is already running: mysql
Where am I going wrong?
Add the following line in your Vagrantfile
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
This starts bash as a non-login shell, but also tells it to source /etc/profile, which I hypothesised to be the only reason to use a login shell by default. Works for me with the stock precise64 Vagrant box.
Not anything you are doing. Apparently this is a known issue.
I fixed it by running vagrant ssh
and then
sudo service mysql restart || true
You can find a record of the issue here

Resources