Project

Profile

Help

Issue #8787

closed

"UnboundLocalError: local variable 'result' referenced before assignment" on attempt to sync some repos

Added by sskracic@redhat.com almost 3 years ago. Updated almost 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 100
Quarter:

Description

Today I was trying to sync some Red Hat repos with fresh pulp-rpm 3.12.0 release. Everything went well, except for couple of repos that generated this stack trace in the logs:

May 20 11:20:17 pulp3.skracic.net rq[1495551]: pulp [612c4427c121435c9fea0b933098c1cd]: pulp_rpm.app.tasks.synchronizing:INFO: Synchronizing: repository=rhel-8
-for-aarch64-appstream-beta-source-rhui-rpms remote=rhel-8-for-aarch64-appstream-beta-source-rhui-rpms
May 20 11:20:17 pulp3.skracic.net rq[1495559]: pulp [9e8d4c3e69de43b58bb023182fe0db84]: rq.worker:ERROR: Traceback (most recent call last):
May 20 11:20:17 pulp3.skracic.net rq[1495559]:   File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 1013, in perform_job
May 20 11:20:17 pulp3.skracic.net rq[1495559]:     rv = job.perform()
May 20 11:20:17 pulp3.skracic.net rq[1495559]:   File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 709, in perform
May 20 11:20:17 pulp3.skracic.net rq[1495559]:     self._result = self._execute()
May 20 11:20:17 pulp3.skracic.net rq[1495559]:   File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 732, in _execute
May 20 11:20:17 pulp3.skracic.net rq[1495559]:     result = self.func(*self.args, **self.kwargs)
May 20 11:20:17 pulp3.skracic.net rq[1495559]:   File "/usr/local/lib/pulp/src/pulp-rpm/pulp_rpm/app/tasks/synchronizing.py", line 227, in synchronize
May 20 11:20:17 pulp3.skracic.net rq[1495559]:     remote_url = fetch_remote_url(remote)
May 20 11:20:17 pulp3.skracic.net rq[1495559]:   File "/usr/local/lib/pulp/src/pulp-rpm/pulp_rpm/app/tasks/synchronizing.py", line 141, in fetch_remote_url
May 20 11:20:17 pulp3.skracic.net rq[1495559]:     if get_repomd_file(remote, remote_url):
May 20 11:20:17 pulp3.skracic.net rq[1495559]:   File "/usr/local/lib/pulp/src/pulp-rpm/pulp_rpm/app/tasks/synchronizing.py", line 110, in get_repomd_file
May 20 11:20:17 pulp3.skracic.net rq[1495559]:     return result
May 20 11:20:17 pulp3.skracic.net rq[1495559]: UnboundLocalError: local variable 'result' referenced before assignment

Upon further inspection, it looks like the repos themselves have been "turned off" following the RHEL 8.4 GA, and when tried to download using the command line utilities, 403 Forbidden error code is retrieved.

So it looks like the exception handling should deal with 403 returned from the remote URL.

My Pulp installation is running on RHEL 8, BTW.


Related issues

Related to Pulp - Story #8873: pulp 3 stops when encounters 403 errorCLOSED - DUPLICATE

Actions
Has duplicate RPM Support - Issue #9019: A variable referenced before assignment while reading repomd CLOSED - DUPLICATEActions
Has duplicate RPM Support - Issue #9022: errors fetching repomd.xml will fail with python error 'local variable 'result' referenced before assignment'CLOSED - DUPLICATEActions
Copied to RPM Support - Backport #9027: Backport 8787 to 3.13.3CLOSED - CURRENTRELEASEdalley

Actions

Also available in: Atom PDF