download_mirror.sh failure when not run with -n

Bug #1980684 reported by Scott Little
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Critical
Scott Little

Bug Description

Brief Description
-----------------
download_mirror.sh fails when following the layered build instructions.
In those instructions, the '-n' flag is not specified. Successful download
should still be possible with without the '-n' flag.

Note: Build servers do use '-n', so the problem has been undetected until recently.

Severity
--------
Critical: StarlingX fails to build

Steps to Reproduce
------------------
Set up a layered build environment.
cd $MY_REPO_ROOT_DIR/stx-tools/centos-mirror-tools
./download_mirror.sh

Expected Behavior
------------------
All packages download

Actual Behavior
----------------
rpms that use the yumdownloader method fail to download

Reproducibility
---------------
100%

System Configuration
--------------------
N/A

Branch/Pull Time/Commit
-----------------------
July 1, 2022

Last Pass
---------
Unknown

Timestamp/Logs
--------------
[Errno 13] Permission denied: '/var/lib/rpm/.dbenv.lock'

Test Activity
-------------
Build

Workaround
----------
N/A

Scott Little (slittle1)
Changed in starlingx:
assignee: nobody → Scott Little (slittle1)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tools (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/tools/+/848655

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

Reviewed: https://review.opendev.org/c/starlingx/tools/+/848655
Committed: https://opendev.org/starlingx/tools/commit/5f8fc4e7b3e0fea7bc1e7918a2b914fd153e7baf
Submitter: "Zuul (22348)"
Branch: master

commit 5f8fc4e7b3e0fea7bc1e7918a2b914fd153e7baf
Author: Scott Little <email address hidden>
Date: Mon Jul 4 12:56:06 2022 -0400

    Fix download_mirror.sh without -n

    download_mirror.sh fails when run without '-n'.

    It seems that some functions were relocated to utils.sh that
    require the 'SUDO' variable to be defined. Those common utilities
    are called from both download_mirror.sh and dl_rpms.sh.

    download_mirror.sh sets it correctly, but dl_rpms.sh does not.
    Instead dl_rpms.sh is setting 'SUDOCMD', which the utils.sh ignores.
    The result is that some yum commands are runs under sudo, while others
    are not. Eventually yumdownloader failes with ...

       Permission denied: '/var/lib/rpm/.dbenv.lock'

    The fix is to convert dl_rpms.sh to use SUDO rather than SUDOCMD.

    Closes-Bug: 1980684
    Signed-off-by: Scott Little <email address hidden>
    Change-Id: Ib4afdba0260e67f06997c360272f40f28fb11834

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
tags: added: stx.7.0 stx.build
Changed in starlingx:
importance: Undecided → Critical
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.