Bug 34062 - Incomplete APT repositories
Incomplete APT repositories
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: UCS Installer
UCS 3.2
Other Linux
: P5 enhancement (vote)
: ---
Assigned To: Installer maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-05 20:21 CET by Philipp Hahn
Modified: 2017-08-08 07:10 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
best: Patch_Available+


Attachments
Use all previous releases in sources.list for APT (2.04 KB, patch)
2014-02-05 20:21 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2014-02-05 20:21:45 CET
Created attachment 5779 [details]
Use all previous releases in sources.list for APT

patchlevel-releases depend in their previous pl releases.
minor releases depend on their previous minor releases.

Otherwise with Bug #34060 applied debootstrap might install the newest version of "libbz2-1.0" from 3.1-1, while "apt" only uses 3.2-0, 3.1-0 and 3.0-0, where only an older version is found. This violates the "= ${binary:Version}" constraint and breaks the installation.

PS: this only happened because /var/lib/univention-repository/packages/ is missing, since the local repository war not setup using univention-repository-create using the initial DVD.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2014-02-06 09:41:54 CET
> PS: this only happened because /var/lib/univention-repository/packages/ is
> missing, since the local repository war not setup using
> univention-repository-create using the initial DVD.

So the local repository has not been set up correctly?
Comment 2 Philipp Hahn univentionstaff 2014-02-06 11:24:11 CET
(In reply to Sönke Schwardt-Krummrich from comment #1)
> > PS: this only happened because /var/lib/univention-repository/packages/ is
> > missing, since the local repository war not setup using
> > univention-repository-create using the initial DVD.
> 
> So the local repository has not been set up correctly?

Looks like it.
The strange things is that the local repository was cloned from a second local repository server, which was working fine in December. Something™ must have happened to the packages/-directory in between, but at the moment it is totally unclear what exactly.
Nevertheless it did cost me too much time to find the real cause, since the installer ignores errors and continues despite of errors, until the real cause was hidden by other log-spam.

If you use univention-repositry-update to create the repo instead of using univention-repository-create, you end up with such a incomplete local repository:

# univention-repository-update net
Error: The local repository is not activated. Set the Univention Configuration Registry variable local/repository to yes
# ucr set local/repository=yes
Create local/repository
File: /etc/apt/mirror.list
File: /etc/apt/sources.list.d/15_ucs-online-version.list
File: /etc/apt/sources.list.d/20_ucs-online-component.list
# univention-repository-update net
Error: Mirroring for the local repository is disabled. Set the Univention Configuration Registry variable repository/mirror to yes.
# ucr set repository/mirror=yes
Setting repository/mirror
File: /etc/apt/mirror.list
# univention-repository-update net
Error: Configuration error: host is unresolvable
root@repo:~# tail -n 2 /etc/apt/mirror.list
# Configuration error: host is unresolvable: 3.2-0-errata
# ls -l /var/lib/univention-repository/
insgesamt 12
drwxr-xr-x 5 root root 4096  6. Feb 10:25 mirror
drwxr-xr-x 5 root root 4096  6. Feb 10:25 skel
drwxr-xr-x 2 root root 4096  6. Feb 10:43 var

So a local repository was created by following the advises, but no packages exists, which makes it unsuitable for PXE installations:

# univention-repository-create 
Warning: The path /var/lib/univention-repository/mirror already exists.
Are you sure you want to create a local repository? [yN] y 
 Installing univention-debmirror
...
Please insert a UCS installation medium and press <Enter>
...
  copying packages ... done.
...
The local repository has been created.
...
# ls -l /var/lib/univention-repository/
insgesamt 20
dr-xr-xr-x 3 root root 4096 18. Nov 11:09 boot
drwxr-xr-x 5 root root 4096  6. Feb 10:25 mirror
dr-xr-xr-x 2 root root 4096 18. Nov 11:09 profiles
drwxr-xr-x 5 root root 4096  6. Feb 10:25 skel
drwxr-xr-x 2 root root 4096  6. Feb 10:43 var

So it created boot/, but where is the packages/ ?

# dpkg-query -W univention-updater univention-debmirror
univention-debmirror    5.0.5-6.67.201305141336
univention-updater      9.0.38-1.1235.201311180938
Comment 3 Philipp Hahn univentionstaff 2014-02-07 19:29:07 CET
2nd try: I used "univention-repository-create" directly with the UCS-3.2 DVD.
/var/lib/univention-repository/packages/ was not copied.

I installed "univention-net-installer"; the directory is still missing.

Manual copying is not mentioned on <http://docs.univention.de/installation-3.2.html#profile:netinstaller>, so it looks like it's expected that a local repository server does *not* contain such a directory.


Here's what happens:

1. When the repository is first created from the DVD, the packages/ directory is *not* copied to /v/l/u-r/packages/, but re-structured to /v/l/u-r/mirror/3.2/maintained/3.2-0/{amd64,all)/.
So the Net-Installer will always use the seconds layout layout in <file:univention-installer/scripts/14_sources_list.sh>.

2. Since the DVD is created in "merge mode" and contains *all* *required* packages from previous releases 3.x-y, the 3.2-0/ directories now contains packages *not* directly available from our Upstream repository server <http://updates.software-univention.de/3.2/maintained/3.2-0/>

3. When apt-mirror is called with repository/mirror/recreate_packages=no, the Packages from *our repository server* overwrites the Packages file from the DVD and thus makes is incomplete, since the packages from previous releases are no longer referenced. (the default is 'yes')

4. Something similar happens with repository/mirror/clean=yes, where the additional packages are purged from the local repository, since they're then no longer referenced by the upstream Packages file. On the next run the local Packages files are re-created and then are also missing the required packages. (the default is 'no') It's currently broken: Bug #28048

It did not show in <https://hutten.knut.univention.de/mediawiki/index.php/Produkttests_UCS_3.2_Installation_(UCS)#PXE_Installation>, as there no repository-update is performed and the defaults are recreate=yes and clean=no.

# univention-repository-create -i /var/lib/libvirt/images/UCS_3.2-0-amd64.iso
# cd /var/lib/univention-repository/mirror/3.2/maintained/3.2-0/amd64
# ls -1 coreutils_*
coreutils_8.5-1.32.201104221528_amd64.deb
# grep coreutils_ Packages
Filename: 3.2-0/amd64/coreutils_8.5-1.32.201104221528_amd64.deb
# ucr set repository/mirror/recreate_packages=no
# apt-mirror
...
# grep coreutils_ Packages
*GONE*

# univention-repository-create -i /var/lib/libvirt/images/UCS_3.2-0-amd64.iso
# ucr set repository/mirror/recreate_packages=yes repository/mirror/clean=yes
# apt-mirror
...
3.2 GiB in 3781 files and 5 directories can be freed.
Run /var/lib/univention-repository/var/clean.sh for this purpose.
...
# grep coreutils_ /var/lib/univention-repository/var/clean.sh
rm -f 'maintained/3.1-0/amd64/coreutils_8.5-1.32.201104221528_amd64.deb'
rm -f 'maintained/3.2-0/amd64/coreutils_8.5-1.32.201104221528_amd64.deb'
# bash /var/lib/univention-repository/var/clean.sh
# perl ~/apt-mirror # with Bug #28048 fixed
# grep coreutils_ Packages
*GONE*


PS:
# univention-repository-create -i /var/lib/libvirt/images/UCS_3.2-0-amd64.iso
Warning: The path /var/lib/univention-repository/mirror already exists.
Are you sure you want to create a local repository? [yN] y
...
Traceback (most recent call last):
  File "/usr/sbin/univention-repository-create", line 286, in <module>
    setup_pxe( options )
  File "/usr/sbin/univention-repository-create", line 234, in setup_pxe
    os.symlink(cdinitrd, pxeinitrd)
OSError: [Errno 17] File exists
Comment 4 Stefan Gohmann univentionstaff 2017-06-16 20:38:55 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 5 Florian Best univentionstaff 2017-06-28 14:52:24 CEST
There is a Customer ID set so I set the flag "Enterprise Customer affected".
Comment 6 Stefan Gohmann univentionstaff 2017-08-08 07:10:45 CEST
This issue has been filed against UCS 3.2.

UCS 3.2 is out of maintenance and many UCS components have vastly changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.