Multiple mirroring issues in maniacs-setup

Bug #1778232 reported by Michael Reed on 2018-06-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
maas-cert-server
Critical
Jeff Lane

Bug Description

In trying to create a local apt-mirror I am seeing the following issue:

chown: cannot access '/srv/mirrors/archive/mirror/*': No such file or directory

This does differ from bug https://bugs.launchpad.net/bugs/1775735 as I am hitting this at a different point of the install.

I do have a workaround, after the script fails, I run the following command

cd /srv/mirrors/archive/mirror/
sudo chown -R apt-mirror:apt-mirror *

Then re-run the maniacs-setup script and the apt-mirror will complete downloading.

Related branches

Michael Reed (mreed8855) wrote :

Here is part of the output from the install:

* Is this correct (Y/n)?
* Should this this computer to use the local mirror (Y/n)? n
* Do you want to mirror trusty (Y/n)? n
* Do you want to mirror xenial (Y/n)?
* Do you want to mirror artful (Y/n)? n
* Do you want to mirror bionic (Y/n)? n
* Do you want to mirror cosmic (Y/n)? n
*
* Creating archive mirror in the background. Check /home/ubuntu/.maas-cert-server/apt-mirror.out
* for status information.
*
*
* Mirror operation begun.
*
* After the mirror operation completes, running
* /srv/mirrors/archive/var/clean.sh can free up some disk space.
chown: cannot access '/srv/mirrors/archive/mirror/*': No such file or directory

Michael Reed (mreed8855) on 2018-09-04
summary: - hown: cannot access '/srv/mirrors/archive/mirror/*': No such file or
+ Chown: cannot access '/srv/mirrors/archive/mirror/*': No such file or
directory

It seems that the root cause is that we kick off apt-mirror in the background but then nearly immediately run the chown line:

chown -R www-data:www-data $ARCHIVE_MIRROR/mirror/*

Which naturally fails because at this point, apt-mirror hasn't created anything yet. Basically a race condition. Also, it's pointless to run chown here until after apt-mirror completes anyway.

I've got a patch that addresses this, testing now to see how it fares, so far so good.

Changed in maas-cert-server:
assignee: nobody → Jeff Lane (bladernr)
importance: Undecided → Critical
status: New → In Progress
Jeff Lane (bladernr) wrote :

found another bug that causes a symlink that looks like this, which may be the reason PPAs are having issues when used locally:
lrwxrwxrwx 1 root root 47 Sep 5 14:11 '*' -> '/srv/mirrors/archive/mirror/ppa.launchpad.net/*'

Jeff Lane (bladernr) wrote :

found a third bug where when you run -M the behaviour is not the same as the original run.

When a re-run is done, the releases selections are all defaulted to Y rather than N.

When a re-run is done, the user is NOT prompted to choose the arches, instead apt-mirror is re-created with ALL arches for the chosen releases, leading to a massive change in the amount of data transferred.

summary: - Chown: cannot access '/srv/mirrors/archive/mirror/*': No such file or
- directory
+ Multiple mirroring issues in maniacs-setup
Michael Reed (mreed8855) wrote :

I did test the initial fix in https://people.canonical.com/~jlane/MCS/maniacs-setup and that script appears to run correctly, however my vm's are hanging during commissioning. I haven't looked into the other two issues found in comments #3 and #4 as of yet.

Jeff Lane (bladernr) wrote :

I've added a fix for the second issue as well.

Now working on a fix for the third issue... once I figure out why it's happening.

Rod Smith (rodsmith) wrote :

I've had problems with MAAS running in a VM (VirtualBox, in my case) being unable to commission for years, but I've never gotten around to tracking down the cause. In any event, that problem is most likely unrelated to this one.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers