I'm trying to set up MediaWiki-Vagrant following https://wikitech.wikimedia.org/wiki/Help:MediaWiki-Vagrant_in_Cloud_VPS. I get an error on step 8:
$ vagrant up Bringing machine 'default' up with 'lxc' provider... ==> default: Box 'debian/stretch64' could not be found. Attempting to find and install... default: Box Provider: lxc default: Box Version: >= 0 ==> default: Loading metadata for box 'debian/stretch64' default: URL: https://vagrantcloud.com/debian/stretch64 ==> default: Adding box 'debian/stretch64' (v9.1.0) for provider: lxc default: Downloading: https://vagrantcloud.com/debian/boxes/stretch64/versions/9.1.0/providers/lxc... default: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com ==> default: Successfully added box 'debian/stretch64' (v9.1.0) for 'lxc'! ==> default: Importing base box 'debian/stretch64'... ==> default: Checking if box 'debian/stretch64' version '9.1.0' is up to date... ==> default: Starting container... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 192.168.122.19:22 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: Forwarding ports... ==> default: 8080 (guest) => 8080 (host) (adapter eth0) ==> default: 443 (guest) => 4430 (host) (adapter eth0) ==> default: Installing NFS client... ==> default: Exporting NFS shared folders... ==> default: Preparing to edit /etc/exports. Administrator privileges will be required... ==> default: Mounting NFS shared folders... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!
mount -o vers=3,udp,noatime,rsize=32767,wsize=32767,async 192.168.122.1:/srv/mediawiki-vagrant /vagrant
Stdout from the command:
Stderr from the command:
mount.nfs: mount to NFS server '192.168.122.1:/srv/mediawiki-vagrant' failed: RPC Error: Unable to receive
Running vagrant destroy -f && vagrant up doesn't help.
The instance is "wikispeech-wiki-buster" in project "wikispeech". It's using image debian-10.0-buster.
*Sebastian Berlin* Utvecklare/*Developer* Wikimedia Sverige (WMSE)
E-post/*E-Mail*: sebastian.berlin@wikimedia.se Telefon/*Phone*: (+46) 0707 - 92 03 84
On Mon, May 25, 2020 at 3:46 AM Sebastian Berlin sebastian.berlin@wikimedia.se wrote:
==> default: Exporting NFS shared folders... ==> default: Preparing to edit /etc/exports. Administrator privileges will be required... ==> default: Mounting NFS shared folders... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!
mount -o vers=3,udp,noatime,rsize=32767,wsize=32767,async 192.168.122.1:/srv/mediawiki-vagrant /vagrant
Stdout from the command:
Stderr from the command:
mount.nfs: mount to NFS server '192.168.122.1:/srv/mediawiki-vagrant' failed: RPC Error: Unable to receive
Running vagrant destroy -f && vagrant up doesn't help.
The instance is "wikispeech-wiki-buster" in project "wikispeech". It's using image debian-10.0-buster.
Looking around on wikispeech-wiki-buster.wikispeech.eqiad.wmflabs, I can see that Vagrant was able to setup the appropriate /etc/exports entry for the server side of this. We have seen some amount of instability with NFS & MediaWiki-Vagrant in the past. This time I have a hunch that the problem was the client (the LXC container that MediaWiki-Vagrant is managing) trying to mount the share before the NFS server on the hosting instance was ready. I did `vagrant ssh` to enter the container followed by `sudo mount -t nfs 192.168.122.1:/srv/mediawiki-vagrant /vagrant` and the share mounted correctly. I can't guarantee that things will work correctly following a restart of the LXC container or the hosting instance, but for now it is working.
Sorry I don't have a more satisfying answer for you. Vagrant + LXC + NFS can be a bit of a pain.
Bryan
Thanks for the help.
Now I get an error on the next step:
$ curl http://localhost:8080/wiki/Main_Page curl: (56) Recv failure: Connection reset by peer
Reloading, which is mentioned to fix a similar problem, doesn't work since mounting fails again.
*Sebastian Berlin* Utvecklare/*Developer* Wikimedia Sverige (WMSE)
E-post/*E-Mail*: sebastian.berlin@wikimedia.se Telefon/*Phone*: (+46) 0707 - 92 03 84
On Tue, 26 May 2020 at 00:23, Bryan Davis bd808@wikimedia.org wrote:
On Mon, May 25, 2020 at 3:46 AM Sebastian Berlin sebastian.berlin@wikimedia.se wrote:
==> default: Exporting NFS shared folders... ==> default: Preparing to edit /etc/exports. Administrator privileges
will be required...
==> default: Mounting NFS shared folders... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!
mount -o vers=3,udp,noatime,rsize=32767,wsize=32767,async 192.168.122.1:/srv/mediawiki-vagrant
/vagrant
Stdout from the command:
Stderr from the command:
mount.nfs: mount to NFS server '192.168.122.1:/srv/mediawiki-vagrant'
failed: RPC Error: Unable to receive
Running vagrant destroy -f && vagrant up doesn't help.
The instance is "wikispeech-wiki-buster" in project "wikispeech". It's
using image debian-10.0-buster.
Looking around on wikispeech-wiki-buster.wikispeech.eqiad.wmflabs, I can see that Vagrant was able to setup the appropriate /etc/exports entry for the server side of this. We have seen some amount of instability with NFS & MediaWiki-Vagrant in the past. This time I have a hunch that the problem was the client (the LXC container that MediaWiki-Vagrant is managing) trying to mount the share before the NFS server on the hosting instance was ready. I did `vagrant ssh` to enter the container followed by `sudo mount -t nfs 192.168.122.1:/srv/mediawiki-vagrant /vagrant` and the share mounted correctly. I can't guarantee that things will work correctly following a restart of the LXC container or the hosting instance, but for now it is working.
Sorry I don't have a more satisfying answer for you. Vagrant + LXC + NFS can be a bit of a pain.
Bryan
Bryan Davis Technical Engagement Wikimedia Foundation Principal Software Engineer Boise, ID USA [[m:User:BDavis_(WMF)]] irc: bd808
Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud
On Wed, Jun 3, 2020 at 7:27 AM Sebastian Berlin sebastian.berlin@wikimedia.se wrote:
Thanks for the help.
Now I get an error on the next step:
$ curl http://localhost:8080/wiki/Main_Page curl: (56) Recv failure: Connection reset by peer
Reloading, which is mentioned to fix a similar problem, doesn't work since mounting fails again.
I should have thought of mentioning `sudo service apache2 reload` along with the information in the first response about the manual mount. This is an ordering bug that has been seen before even when mounts are working as expected.
The document root for the apache2 vhost that serves your wiki lives inside the /vagrant mount. Apache would have started before the manual mount was made with an empty directory. The apache2 process will not be notified when the intended content is mounted over the top of the previously empty directory. Manually restarting the apache2 process after fixing the mounts should make things happy again.
Bryan