Bug 177330

Summary: up2date --dbpath=... no longer works
Product: Red Hat Enterprise Linux 4 Reporter: Daniel Larsson <daniel.larsson>
Component: up2dateAssignee: Bret McMillan <bretm>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: cperry
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: up2date-4.4.69-25 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-03 20:19:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 191074, 191079    

Description Daniel Larsson 2006-01-09 19:01:58 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051219 Firefox/1.5

Description of problem:
up2date provides the option --dbpath=<path> to run against a different RPM database, but (I believe) with the change to support $RELEASE in URLs in /etc/sysconfig/rhn/sources, it is no longer working.

/usr/sbin/up2date tries to determine if RHN is used. Part of this involves parsing the sources file, which queries the RPM database to determine the value of $RELEASE. This initializes a singleton "ReadOnlyTransaction" (/usr/share/rhn/up2date_client/transaction.py) which is then used subsequently. Problem is initialization of this is done prior to parsing command line options, so --dbpath=<path> seems to not have any effect.

Version-Release number of selected component (if applicable):
up2date-4.4.50-4

How reproducible:
Always

Steps to Reproduce:
1. mkdir /tmp/myrpmdb
2. up2date -v -v -v --dbpath=/tmp/myrpmdb --dry-run redhat-release


Actual Results:  Output from up2date above (elided):
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
...
The following packages you requested are already updated:
redhat-release
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages


Expected Results:  Running the same thing with up2date-4.4.5-1:
D: opening  db environment /tmp/myrpmdb/Packages joinenv
D: opening  db index       /tmp/myrpmdb/Packages rdonly mode=0x0
D: locked   db index       /tmp/myrpmdb/Packages
D: opening  db index       /tmp/myrpmdb/Name rdonly mode=0x0
....
(bunch of packages that would have been installed)

Additional info:

Comment 4 Fanny Augustin 2006-04-11 00:26:20 UTC
Blocking rhnupr4u4 and rhnupr3u8 to track the progress of the release

Comment 5 Fanny Augustin 2006-04-13 19:28:17 UTC
Moving bugs to the CanFix List

Comment 6 Fanny Augustin 2006-05-08 19:05:11 UTC
This bug did not make the code freeze and it will not be fiixed during this
release cycle.  Re-aligning bug to the next release

Comment 7 Fanny Augustin 2006-05-08 20:04:12 UTC
This bug did not make the code freeze.  It will not be fixed in this releasee 
Reea ligning to the next one.

Comment 8 Clifford Perry 2006-08-03 20:19:06 UTC
Hi there, 
Performing a quick test it seems that the newest version of up2date for Red Hat
Enterprise Linux 4 does indeed work as you expect (and reported as broken). 

[root@dhcp59-213 ~]# rpm -q up2date
up2date-4.4.69-25
[root@dhcp59-213 ~]#
[root@dhcp59-213 ~]# mkdir /tmp/myrpmdb
[root@dhcp59-213 ~]# up2date -v -v -v --dbpath=/tmp/myrpmdb --dry-run redhat-release
D: opening  db environment /tmp/myrpmdb/Packages create:cdb:mpool
D: opening  db index       /tmp/myrpmdb/Packages create mode=0x0
D: locked   db index       /tmp/myrpmdb/Packages
D: opening  db index       /tmp/myrpmdb/Name create mode=0x0
D: opening  db index       /tmp/myrpmdb/Providename create mode=0x0
RPM error.  The message was:
Could not determine what version of Red Hat Linux you are running.
If you get this error, try running

                rpm --rebuilddb


D: closed   db index       /tmp/myrpmdb/Providename
D: closed   db index       /tmp/myrpmdb/Name
D: closed   db index       /tmp/myrpmdb/Packages
D: closed   db environment /tmp/myrpmdb/Packages
[root@dhcp59-213 ~]# 

Please see Errata - https://rhn.redhat.com/errata/RHBA-2006-0494.html

Regards,
Clifford.