Extra slash in /etc/apt/sources.list; prevents connecting to some servers

Bug #1340920 reported by Rod Smith on 2014-07-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When doing a curtin (fastpath) installation, the /etc/apt/sources.list file on the client ends up with an extra slash following the hostname, thus:

deb http://us.archive.ubuntu.com//ubuntu trusty main restricted universe multiverse
deb http://us.archive.ubuntu.com//ubuntu trusty-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com//ubuntu trusty-security main restricted universe multiverse

This works fine with the Canonical-managed servers, which use Apache; but some web servers are more fussy. If the user changes the "Main archive" field in http://{maas-server}/MAAS/settings/ to point to a server that runs server software that's fussier about this than Apache, then the result is 400 errors when running "apt-get update", so of course subsequent uses of APT also fail. I've run into this problem on my home network, which has an Ubuntu mirror archive on a thttpd server. Changing "//" to "/" between the hostname and "ubuntu" on each line in /etc/apt/sources.list works around the problem.

This problem does NOT occur on d-i installs; they generate /etc/apt/sources.list files that are OK.

My MAAS version information:

$ dpkg -l '*maas*'|cat
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
ii maas 1.5.2+bzr2282-0ubuntu0.2 all MAAS server all-in-one metapackage
ii maas-cli 1.5.2+bzr2282-0ubuntu0.2 all MAAS command line API tool
ii maas-cluster-controller 1.5.2+bzr2282-0ubuntu0.2 all MAAS server cluster controller
ii maas-common 1.5.2+bzr2282-0ubuntu0.2 all MAAS server common files
ii maas-dhcp 1.5.2+bzr2282-0ubuntu0.2 all MAAS DHCP server
ii maas-dns 1.5.2+bzr2282-0ubuntu0.2 all MAAS DNS server
ii maas-region-controller 1.5.2+bzr2282-0ubuntu0.2 all MAAS server complete region controller
ii maas-region-controller-min 1.5.2+bzr2282-0ubuntu0.2 all MAAS Server minimum region controller
ii python-django-maas 1.5.2+bzr2282-0ubuntu0.2 all MAAS server Django web framework
ii python-maas-client 1.5.2+bzr2282-0ubuntu0.2 all MAAS python API client
ii python-maas-provisioningserver 1.5.2+bzr2282-0ubuntu0.2 all MAAS server provisioning libraries

Rod Smith (rodsmith) wrote :
Julian Edwards (julian-edwards) wrote :

The file is generated from these lines in curtin_userdata, so I expect we need to strip a slash somewhere:

{{if node.split_arch()[0] in {'i386', 'amd64'} }}
  ubuntu_archive: http://{{main_archive_hostname}}/{{main_archive_directory}}
  ubuntu_security: http://{{main_archive_hostname}}/{{main_archive_directory}}
  ubuntu_archive: http://{{ports_archive_hostname}}/{{ports_archive_directory}}
  ubuntu_security: http://{{ports_archive_hostname}}/{{ports_archive_directory}}

Changed in maas:
status: New → Triaged
importance: Undecided → Medium
tags: added: papercut
tags: added: trivial
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers