Bug 1889525

Summary: [RFE] microdnf should support minrate and timeout options
Product: Red Hat Enterprise Linux 8 Reporter: Papa-K <paddy>
Component: microdnfAssignee: Jaroslav Rohel <jrohel>
Status: CLOSED CURRENTRELEASE QA Contact: Tomáš Bajer <tbajer>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.0CC: aos-bugs, jokerman, jrohel, packaging-team-maint, pamoedom, pkratoch, wzheng
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libdnf-0.63.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-24 08:58:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Papa-K 2020-10-19 20:51:33 UTC
Description of problem:  microdnf is giving me trouble with the following error:

error: Cannot download Packages/j/java-1.8.0-openjdk-headless-1.8.0.265.b01-0.el8_2.x86_64.rpm: All mirrors were tried; Last error: Curl error (28): Timeout was reached for https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/appstream/os/Packages/j/java-1.8.0-openjdk-headless-1.8.0.265.b01-0.el8_2.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]

It seems that the transfer for certain packages is either slow or stalling when using cdn-ubi.redhat.com. I can manually curl the URL and download the rpm. it can take up to 7 minutes to complete the transfer into our environment. So I am trying to get microdnf not to timeout so quickly using e.g.:
echo '[main]' >> /etc/dnf/dnf.conf && \
echo 'minrate=1' >> /etc/dnf/dnf.conf && \
echo 'timeout=600' >> /etc/dnf/dnf.conf && \
microdnf update && microdnf clean all

However, microdnf doesn't seem to honor these timeout settings


Version-Release number of selected component (if applicable):
OPC 4.5

How reproducible:
Start with red hat’s ubi8-minimal image or derivative that has only microdnf and attempt to add openjdk8, e.g.:

Steps to Reproduce:
1.Start with red hat’s ubi8-minimal image or derivative that has only microdnf and attempt to add openjdk8, e.g.:

echo '[main]' >> /etc/dnf/dnf.conf && \
echo 'minrate=1' >> /etc/dnf/dnf.conf && \
echo 'timeout=600' >> /etc/dnf/dnf.conf && \
microdnf install java-1.8.0-openjdk --nodocs && microdnf clean all
2.Expecting microdnf honor 600 sec timeout with slow transfers.

However, it doesn’t seem to consider timeout setting at all:

 

[root@my-shell anchors]#  microdnf install java-1.8.0-openjdk --nodocs && microdnf clean all

 

(microdnf:163): librhsm-WARNING **: 20:42:46.452: Found 0 entitlement certificates

 

(microdnf:163): librhsm-WARNING **: 20:42:46.454: Found 0 entitlement certificates

Downloading metadata...

Downloading metadata...

Downloading metadata...

Package                                                                                                                                                                                                                        Repository                                                                                 Size

Installing:                                                                                                                                                                                                                                                                                                                   

 alsa-lib-1.2.1.2-3.el8.x86_64

…

…

xorg-x11-fonts-Type1-7.5-19.el8.noarch                                                                                                                                                                                        ubi-8-appstream                                                                        534.4 kB

Transaction Summary:

Installing:       60 packages

Reinstalling:      0 packages

Upgrading:         0 packages

Removing:          0 packages

Downgrading:       0 packages

Downloading packages...

error: Cannot download Packages/j/java-1.8.0-openjdk-headless-1.8.0.265.b01-0.el8_2.x86_64.rpm: All mirrors were tried; Last error: Curl error (28): Timeout was reached for https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/appstream/os/Packages/j/java-1.8.0-openjdk-headless-1.8.0.265.b01-0.el8_2.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]

[root@my-shell anchors]#


Actual results:
Expecting microdnf honor 600 sec timeout with slow transfers. [root@my-shell anchors]#  microdnf install java-1.8.0-openjdk --nodocs && microdnf clean all

 

(microdnf:163): librhsm-WARNING **: 20:42:46.452: Found 0 entitlement certificates

 

(microdnf:163): librhsm-WARNING **: 20:42:46.454: Found 0 entitlement certificates

Downloading metadata...

Downloading metadata...

Downloading metadata...

Package                                                                                                                                                                                                                        Repository                                                                                 Size

Installing:                                                                                                                                                                                                                                                                                                                   

 alsa-lib-1.2.1.2-3.el8.x86_64

…

…

xorg-x11-fonts-Type1-7.5-19.el8.noarch                                                                                                                                                                                        ubi-8-appstream                                                                        534.4 kB

Transaction Summary:

Installing:       60 packages

Reinstalling:      0 packages

Upgrading:         0 packages

Removing:          0 packages

Downgrading:       0 packages

Downloading packages...

error: Cannot download Packages/j/java-1.8.0-openjdk-headless-1.8.0.265.b01-0.el8_2.x86_64.rpm: All mirrors were tried; Last error: Curl error (28): Timeout was reached for https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/appstream/os/Packages/j/java-1.8.0-openjdk-headless-1.8.0.265.b01-0.el8_2.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]

Expected results:


Additional info:

Comment 1 Oleg Bulatov 2020-10-20 07:09:29 UTC
It doesn't seem to be related to OpenShift.

Comment 3 Jaroslav Rohel 2020-12-08 10:32:16 UTC
Microdnf uses the "context" part of libdnf.
I extended the "context" part of libdnf to support additional options in configuration files. These options will also work in other libdnf clients, e.g. PackageKit.

PR: https://github.com/rpm-software-management/libdnf/pull/1103

Added support for options (same meaning as in DNF):
minrate
timeout
throttle
bandwidth