Bug 1040739

Summary: Grinder is not handling the source of a relative symlink correctly.
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: John Matthews <jmatthew>
Component: RHUAAssignee: John Matthews <jmatthew>
Status: CLOSED ERRATA QA Contact: mkovacik
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.1.2CC: ipanova, jboutaud, tsanders
Target Milestone: ---   
Target Release: 2.1.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-17 20:11:30 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:
Bug Depends On:    
Bug Blocks: 1040584    
Attachments:
Description Flags
grinder patch test log
none
rhui udpdate log none

Description John Matthews 2013-12-12 03:13:28 UTC
Description of problem:

When grinder re-syncs a repository it will look at existing symlinks in the repo directory and ensure the symlinks are pointing to the correct md5sum version of the RPM.

This logic is running into a problem because when running under pulp the 'CWD' current working directory is set to "/var/www".

Grinder is looking at symlinks that contain relative values such as:  
'../../../../../../../../../../../packages/zlib/1.2.3/27.el6/i686/29ce6c8df7f045e8c953137ba360fcf784feb8a0/zlib-1.2.3-27.el6.i686.rpm'

Which results in Grinder looking at:
"/var/www/../../../../../../../../../../../packages/zlib/1.2.3/27.el6/i686/29ce6c8df7f045e8c953137ba360fcf784feb8a0/zlib-1.2.3-27.el6.i686.rpm"

When we want grinder to be looking at:
/var/lib/pulp/repos/content/dist/rhel/rhui/server/6/6Server/x86_64/os/Packages/../../../../../../../../../../../packages/zlib/1.2.3/27.el6/i686/29ce6c8df7f045e8c953137ba360fcf784feb8a0/zlib-1.2.3-27.el6.i686.rpm

Issue is when dereferencing a relative symbolic link, the current working directory becomes critical.  

This causing a large number of failures in resyncs which can create a task history that exceeds 4MB and causes mongodb to throw an exception.

Comment 3 mkovacik 2013-12-12 09:13:36 UTC
Created attachment 835680 [details]
grinder patch test log

the grinder patch solves the issue; no more errors during resync...

# grinder package details
[root@rhua ~]# rpm -qi grinder
Name        : grinder                      Relocations: (not relocatable)
Version     : 0.0.138.5                         Vendor: Red Hat, Inc.
Release     : 1.el6_5.rhui                  Build Date: Thu 12 Dec 2013 01:05:15 AM EST
Install Date: Thu 12 Dec 2013 03:09:31 AM EST      Build Host: x86-028.build.eng.bos.redhat.com
Group       : Development/Tools             Source RPM: grinder-0.0.138.5-1.el6_5.rhui.src.rpm
Size        : 489019                           License: GPLv2
Signature   : (none)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://git.fedorahosted.org/git/?p=grinder.git
Summary     : A tool for synchronizing content from yum repositories
Description :
A tool for synchronizing content such as packages, distributions, and
errata from yum repositories.
[root@rhua ~]#

Comment 4 mkovacik 2013-12-12 09:37:48 UTC
I'm not sure what in particular is happening during the sync, but it seems it occupies the system quite a lot for the 8 minutes it takes; might all the package records being updated?

# from top:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 7277 apache    20   0 2085m 697m 8704 S 104.5  9.5  13:22.16 httpd                                                                                                                                                                          
 7224 mongodb   20   0 1549m 161m 159m S 49.1  2.2  10:11.53 mongod

Comment 5 John Matthews 2013-12-12 17:40:57 UTC
The ~8 minutes or more of processing during import is expected for this version of Pulp.  We intend to leave this as-is for RHUI 2.1.3.

Comment 7 mkovacik 2013-12-13 13:32:57 UTC
Created attachment 836325 [details]
rhui udpdate log

verified in build RHEL-6.4-RHUI-2.1.3-20131212.0; grinder  0.0.138.5; no more sync issues seen during/after an update (attached)

[root@rhua ~]# grep -i oserror /var/log/pulp/grinder.log*
[root@rhua ~]#

Comment 8 mkovacik 2013-12-13 13:34:43 UTC
setting to verified based on Comment #7

Comment 10 errata-xmlrpc 2013-12-17 20:11:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1854.html