dib fails when using custom apt-sources

Bug #1768354 reported by Oded Le'Sage
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Released
Undecided
Oded Le'Sage

Bug Description

When trying to use an internal/custom debian package repo by using apt-sources element, DIB fails if a package is installed right after the repo key is added.

disk-image-create --version
2.14.2

========
To reproduce (assumes tripleo-image-elements has been cloned in the same root dir as DIB):
.
|-- diskimage-builder
`-- tripleo-image-elements

========
export DIB_APT_SOURCES=/etc/apt/sources.list
export DIB_ADD_APT_KEYS=/etc/apt/trusted.gpg.d
export ELEMENTS_PATH=tripleo-image-elements/elements

disk-image-create ubuntu vm apt-sources os-collect-config

========
Relevant log entries
========
2018-05-01 20:58:33.347 | dib-run-parts Running /tmp/in_target.d/pre-install.d/02-add-apt-keys
2018-05-01 20:58:33.442 | OK
2018-05-01 20:58:33.443 | dib-run-parts 02-add-apt-keys completed
2018-05-01 20:58:33.443 | dib-run-parts Running /tmp/in_target.d/pre-install.d/02-package-installs
2018-05-01 20:58:33.561 | Map install for svc-map: PyYAML
2018-05-01 20:58:33.561 | Map install for epel: wget, yum-utils
2018-05-01 20:58:33.561 | Running command: ['install-packages', 'python-yaml']
2018-05-01 20:58:33.561 | > Reading package lists...
2018-05-01 20:58:33.561 | > Building dependency tree...
2018-05-01 20:58:33.561 | > Reading state information...
2018-05-01 20:58:33.562 | > E: Unable to locate package python-yaml
2018-05-01 20:58:33.562 | returncode: 100
2018-05-01 20:58:33.562 | install-packages failed with returncode 100
2018-05-01 20:58:33.804 | INFO diskimage_builder.block_device.blockdevice [-] State already cleaned - no way to do anything here

========
Summary
========
os-collect config tries to install the deb package for PyYAML, but since an apt-get update hasn't been performed after adding the apt key, it cannot locate the package. While I came across this with os-collect-config it could be any package. The dpkg element doesn't apt update until 99-apt-get-update

Oded Le'Sage (ol7435)
Changed in diskimage-builder:
assignee: nobody → Oded Le'Sage (ol7435)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/565599

Changed in diskimage-builder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (master)

Reviewed: https://review.openstack.org/565599
Committed: https://git.openstack.org/cgit/openstack/diskimage-builder/commit/?id=10b2a5a4ee1c5c6c16f61277b7795500f0a72886
Submitter: Zuul
Branch: master

commit 10b2a5a4ee1c5c6c16f61277b7795500f0a72886
Author: Oded Le'Sage <email address hidden>
Date: Tue May 1 16:39:01 2018 -0500

    Fixes add-apt-keys in dpkg element

    This commit addresses the issue described in bug 1768354 when using the
    apt-sources element and adding a key to a custom repo, subsequent deb
    package installs fail due no update of the repo before package install

    Change-Id: I968b3422fab2fb2305426d49215391d8ba7499df
    Closes-Bug: 1768354

Changed in diskimage-builder:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.