Bug 136733 - OSError exception (file already exists) during initial sync with /var/satellite mounted
OSError exception (file already exists) during initial sync with /var/satelli...
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Mihai Ibanescu
Fanny Augustin
Depends On:
Blocks: rhn360sat
  Show dependency treegraph
Reported: 2004-10-21 19:11 EDT by Max Spevack
Modified: 2007-07-31 11:11 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-22 12:36:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Max Spevack 2004-10-21 19:11:06 EDT
During the initial sync on a rhel3 satellite (with /var/satellite
mounted), satellite-sync dies with an unhandled OSError exception.

Log below:

- this did *not* happen on the rhel2 satellite
- after taw added a simple try/catch statement that just passes the
exception and prints out an error message, re-running the sync command
did not raise the exception again, though the file existing that
generated the exception in the first place is still there.


18:58:17 Downloading rpm packages
18:58:17    Fetching any missing RPMs: redhat-advanced-server-i386
18:58:17    Fetching any missing RPMs: rhel-i386-as-3 (14)
+++ sending log as an email +++
SYNC ERROR: unhandled exception occurred:
(Check logs/email for potentially more detail)
[Errno 17] File exists:

The full traceback:

Exception Handler Information
Traceback (most recent call last):
  File "/usr/bin/satellite-sync", line 128, in main
    return satsync.Runner().main()
  File "/usr/share/rhn/satellite_tools/satsync.py", line 153, in main
    ret = method()
  File "/usr/share/rhn/satellite_tools/satsync.py", line 241, in
    self._packages_report = self.syncer.download_rpms()
  File "/usr/share/rhn/satellite_tools/satsync.py", line 856, in
    self._fetch_packages(channel, missing_fs_packages)
  File "/usr/share/rhn/satellite_tools/satsync.py", line 1697, in
    s = rpmManip.write_file(stream)
  File "/usr/share/rhn/satellite_tools/syncLib.py", line 165, in
  File "/usr/share/rhn/satellite_tools/syncLib.py", line 380, in
    makedirs(path, mode=chmod, user=user, group=group)
  File "/usr/share/rhn/satellite_tools/syncLib.py", line 359, in makedirs
    os.mkdir(dirname, mode)
OSError: [Errno 17] File exists:
Comment 1 Mihai Ibanescu 2004-10-22 18:07:53 EDT
Not an easy way to reproduce this, since it's a race condition. I was
checking for missing directories and then creating them, but it's
possible for someone else to create the dirs in the meantime.

I've added the try/except statement to catch this.
Comment 2 Todd Warner 2004-10-28 15:10:35 EDT
ON_DEV/QA_READY --> ON_QA (webQA and RHN Sat ISO/package push complete)
Comment 3 Todd Warner 2004-10-28 15:57:11 EDT
ON_DEV/QA_READY --> ON_QA (webQA and RHN Sat ISO/package push complete) REALLY!
Comment 4 Todd Warner 2004-12-01 08:02:38 EST
FAILS_QAing this. Misa, is there *any* way to test this? If not...
closeit as NOTABUG. And we'll refile if it ever crops up again. It's
been a month+ now without it coming back. Probably just an oddball
race condition.
Comment 5 Mihai Ibanescu 2004-12-01 22:11:50 EST
Moving to PROD_READY, since I did add code to fix the potential race
condition, it's just difficult to test.
Comment 6 Todd Warner 2005-03-22 12:36:49 EST

Note You need to log in before you can comment on or make changes to this bug.