diff -Nur plague-0.4.4.1-orig/builder/builder.py plague-0.4.4.1/builder/builder.py --- plague-0.4.4.1-orig/builder/builder.py 2006-03-13 16:09:23.000000000 +0100 +++ plague-0.4.4.1/builder/builder.py 2008-01-04 15:09:21.000000000 +0100 @@ -169,7 +169,7 @@ sys.stdout.write(s + string) sys.stdout.flush() - def dl_callback(self, dl_status, cb_data): + def dl_callback(self, dl_status, cb_data, err_msg): url = cb_data if dl_status == 'done': self._status = 'downloaded' @@ -187,7 +187,7 @@ else: # retry the download self._status = 'init' - self._log("ERROR: Failed to retrieve %s on attempt %d. Trying again...\n" % (url, self._srpm_tries)) + self._log("ERROR: Failed to retrieve %s on attempt %d (%s). Trying again...\n" % (url, self._srpm_tries, err_msg)) def _copy_mock_output_to_log(self): if self._mock_log and os.path.exists(self._mock_log): diff -Nur plague-0.4.4.1-orig/common/FileDownloader.py plague-0.4.4.1/common/FileDownloader.py --- plague-0.4.4.1-orig/common/FileDownloader.py 2005-11-18 16:12:03.000000000 +0100 +++ plague-0.4.4.1/common/FileDownloader.py 2008-01-04 15:06:19.000000000 +0100 @@ -94,6 +94,7 @@ def run(self): result = None + err_msg = None if self._url and self._target_dir and self._filename: if not os.path.exists(self._target_dir): os.makedirs(self._target_dir) @@ -105,16 +106,21 @@ # if CommonErrors.canIgnoreSSLError(e): # pass except socket.error, e: - if CommonErrors.canIgnoreSocketError(e): - pass + if not CommonErrors.canIgnoreSocketError(e): + err_msg = "Socket Error: %s" % e except IOError, e: - if CommonErrors.canIgnoreSocketError(e): - pass + if not CommonErrors.canIgnoreSocketError(e): + err_msg = "IOError Error: %s" % e + if result: # extra check to examine mysterious add_to_repo errors + if not os.path.exists(target_file) or not os.access(target_file, os. +R_OK): + err_msg = "Downloaded file is inaccessible!" + result = False if result: - self._callback('done', self._cb_data) + self._callback('done', self._cb_data, err_msg) else: - self._callback('failed', self._cb_data) + self._callback('failed', self._cb_data, err_msg) diff -Nur plague-0.4.4.1-orig/server/ArchJob.py plague-0.4.4.1/server/ArchJob.py --- plague-0.4.4.1-orig/server/ArchJob.py 2006-02-23 20:10:30.000000000 +0100 +++ plague-0.4.4.1/server/ArchJob.py 2008-01-04 15:08:14.000000000 +0100 @@ -196,7 +196,7 @@ dl_dict[DL_WAIT_TIME] = 0 self._downloads[uf] = dl_dict - def dl_callback(self, status, cb_data): + def dl_callback(self, status, cb_data, err_msg): url = cb_data self._download_lock.acquire() dl_dict = self._downloads[url] @@ -207,8 +207,8 @@ if dl_dict[DL_RETRIES] >= 10: dl_dict[DL_STATUS] = STATUS_ERROR else: - print "%s (%s/%s): Failed to retrieve %s (attempt %d), trying again..." % (self.par_job.uid, - self.par_job.package, self._target_dict['arch'], url, dl_dict[DL_RETRIES]) + print "%s (%s/%s): Failed to retrieve %s (attempt %d) (Error %s), trying again..." % (self.par_job.uid, + self.par_job.package, self._target_dict['arch'], url, dl_dict[DL_RETRIES], err_msg) dl_dict[DL_STATUS] = STATUS_WAITING dl_dict[DL_WAIT_TIME] = 5 # Wait a bit before trying again dl_dict[DL_RETRIES] = dl_dict[DL_RETRIES] + 1