Last modified: 2014-08-18 09:04:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T69976, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67976 - Archives directory /vagrant/apt-cache/partial is missing.
Archives directory /vagrant/apt-cache/partial is missing.
Status: RESOLVED FIXED
Product: MediaWiki-Vagrant
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Ori Livneh
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-14 09:14 UTC by Tisza Gergő
Modified: 2014-08-18 09:04 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tisza Gergő 2014-07-14 09:14:17 UTC
Steps to reproduce:

1. start with an old vagrant installation (haven't had time yet to try and reproduce on a new one)
2. update mediawiki-vagrant to current master
3. run setup.sh
4. run vagrant reload

vagrant reload will exit with this message:

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u www-data`,gid=`getent group www-data | cut -d: -f3` /vagrant/logs /vagrant/logs
mount -t vboxsf -o uid=`id -u www-data`,gid=`id -g www-data` /vagrant/logs /vagrant/logs

Running the command manually just yields "mount: Protocol error". Googling suggests that this is caused by virtualbox-guest-dkms not being present (it isn't). Running apt-get install virtualbox-guest-dkms will give this error:

E: Archives directory /vagrant/apt-cache/partial is missing. - Acquire (2: No such file or directory)

After creating the directory, the install and then the mount works, but running vagrant reload again resets to the bad state (virtualbox-guest-dkms not installed, /vagrant/apt-cache/partial missing).
Comment 1 Bryan Davis 2014-07-19 22:34:38 UTC
I can't recreate this in a clean checkout of MediaWiki-Vagrant. The cache/apt/partial directory exists in the git repository. Your problem may have been a bug in the cache migration code put in place when the directory structure was changed.
Comment 2 Tisza Gergő 2014-07-19 23:24:33 UTC
Yes, this doesn't happen in a new vagrant installation, but breaks an upgrade attempt of an old one in a really ugly way (in the end I had to migrate everything manually to a new box).
Comment 3 Bryan Davis 2014-07-20 03:50:03 UTC
Looking at this closer, the problem is caused by cleaning up the previous apt-cache/** directories before puppet runs on the VM.

We install a file at /etc/apt/apt.conf.d/20shared-cache to configure an alternate cache directory for apt in manifests/base.pp. This file will change to reference the new /vagrant/cache/apt directory as soon as puppet runs on the VM. The vagrant-vbguest plugin however is running before puppet has changed the file to point to the new location and attempting to use apt.

A possible fix would be to remove the code in Vagrantfile that deletes the old directories and instead add puppet code to remove the directories. This would leave the old directory structure intact until puppet has run and reconfigured apt to use the new cache location.
Comment 4 Gerrit Notification Bot 2014-07-20 04:14:21 UTC
Change 147878 had a related patch set uploaded by BryanDavis:
Defer deleting legacy cache directories

https://gerrit.wikimedia.org/r/147878
Comment 5 Tisza Gergő 2014-07-20 05:26:46 UTC
After applying the patch, running vagrant reload fails with the same message. However, virtualbox-guest-dkms is now installed on the VM, and the mount fails with a different error message:

/sbin/mount.vboxsf: mounting failed with the error: No such file or directory
Comment 6 Tisza Gergő 2014-07-20 07:21:31 UTC
Ignore me. I got lost while context switching and ran the commands on the host. The error is still the same as described in comment 0.

This might be only because this box is already in a messed-up state; I can try upgrading another box if you think it will work now.
Comment 7 Bryan Davis 2014-07-23 04:03:30 UTC
(In reply to Tisza Gergő from comment #6)
> This might be only because this box is already in a messed-up state; I can
> try upgrading another box if you think it will work now.

If you have the energy to try and recreate on a "clean" install I'd appreciate the data. If not, I'll try to find some time to setup a test starting from 3c6a6606b5217a2fb16cfde4db31d5a6c8e102c5 and then updating to the current HEAD of master plus the patch.
Comment 8 Tisza Gergő 2014-07-31 00:02:20 UTC
Not sure if this is really related to the change you mention. The most recent box I am experiencing this on is at I91d51f6deb0b12b795f705cf8895783a11fa8695. Looks like all the old boxes became unusable when I upgraded one of them. Any chance this is somehow related to one of the two vagrant plugins which the setup script installs globally?
Comment 9 Tisza Gergő 2014-07-31 00:08:26 UTC
The error message after running vagrant reload is slightly different though:

$ vagrant reload
[default] Attempting graceful shutdown of VM...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 3335 (adapter 1)
[default] -- 80 => 9095 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
GuestAdditions versions on your host (4.3.10) and guest (4.2.16) do not match.
Reading package lists...
Building dependency tree...
Reading state information...
linux-headers-3.2.0-56-generic is already the newest version.
The following packages will be upgraded:
  dkms
1 upgraded, 0 newly installed, 0 to remove and 112 not upgraded.
E: Archives directory /vagrant/apt-cache/partial is missing. - Acquire (2: No such file or directory)
E: Archives directory /vagrant/apt-cache/partial is missing. - Acquire (2: No such file or directory)
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
prevent things such as shared folders from working properly. If you see
shared folder errors, please make sure the guest additions within the
virtual machine match the version of VirtualBox you have installed on
your host and reload your VM.

Guest Additions Version: 4.2.16
VirtualBox Version: 4.3
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

apt-get update

Stdout from the command:



Stderr from the command:

E: Archives directory /vagrant/apt-cache/partial is missing. - Acquire (2: No such file or directory)
Comment 10 Bryan Davis 2014-07-31 00:21:03 UTC
(In reply to Tisza Gergő from comment #9)
> The error message after running vagrant reload is slightly different though:
> 
> $ vagrant reload
[...snip...]
> [default] Machine booted and ready!
> GuestAdditions versions on your host (4.3.10) and guest (4.2.16) do not
> match.
[...snip...]
> The following packages will be upgraded:
>   dkms
> 1 upgraded, 0 newly installed, 0 to remove and 112 not upgraded.
> E: Archives directory /vagrant/apt-cache/partial is missing. - Acquire (2:
> No such file or directory)

The output you give seems to show that the vagrant-vbguest plugin is attempting to update your guest's GuestAdditions. This would happen before the puppet run.

The change I mentioned (3c6a6606b5217a2fb16cfde4db31d5a6c8e102c5) was the last commit before Ori added logic to Vagrantfile to move any existing /vagrant/apt-cache directory to /vagrant/cache/apt. My patch is an attempt to give existing hosts that are expecting the cache to be in the old location to at least see empty directories before puppet tells them to use the new location.

I think what has happened (and continues to happen) for you is that the move from /vagrant/apt-cache to /vagrant/cache/apt has happened in the working directory for Vagrant on your local machine but puppet has not run inside the VM to tell it to look for cached apt packages in the new location.

I think if you `mkdir -p apt-cache/partial` in the MediaWiki-Vagrant checkout directory on your host computer with my patch applied before you `vagrant reload` or `vagrant up` then the VM will start. Then you can `vagrant provision` to fix the apt cache config via puppet.
Comment 11 Gerrit Notification Bot 2014-07-31 05:03:05 UTC
Change 147878 merged by jenkins-bot:
Defer deleting legacy cache directories

https://gerrit.wikimedia.org/r/147878
Comment 12 Bryan Davis 2014-08-09 21:16:09 UTC
I have seen this happen for some other user during the London hackathon (I don't remember who). The fix was to make the old git cache happy by `mkdir -p apt-cache/partial` and then `vagrant up`. This is not an ongoing issue for new installs but a horrible inconvenience we inflicted on users from before the consolidation of the guest hosted cache directories.
Comment 13 Tisza Gergő 2014-08-18 09:04:09 UTC
(In reply to Bryan Davis from comment #12)
> The fix was to make the old git cache happy by `mkdir -p apt-cache/partial`
> and then `vagrant up`.

This does not work for me, presumably because folder sharing is not set up yet at the point where this error happens, so anything done to the folder of the vagrantbox on the host machine does not affect /vagrant on the guest machine.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links