Project

Profile

Help

Issue #8787

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

Added by sskracic@redhat.com 2 months ago. Updated 16 days 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

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Has duplicate RPM Support - Issue #9019: A variable referenced before assignment while reading repomd CLOSED - DUPLICATE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Has duplicate RPM Support - Issue #9022: errors fetching repomd.xml will fail with python error 'local variable 'result' referenced before assignment'CLOSED - DUPLICATE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Copied to RPM Support - Backport #9027: Backport 8787 to 3.13.3CLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 727b530b View on GitHub
Added by dalley 22 days ago

Fix unbound local error when Pulp receives a non-404 ClientResponseError

If Pulp receives a ClientResponseError when attempting to download a file, but the status code isn't 404, then we go down the wrong code path.

closes: #8787 https://pulp.plan.io/issues/8787

History

#1 Updated by ttereshc 2 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 97

#2 Updated by dalley 2 months ago

  • Status changed from NEW to POST
  • Assignee set to zhunting

#4 Updated by dalley about 2 months ago

  • Assignee changed from zhunting to dalley

whoops

#5 Updated by rchan about 2 months ago

  • Sprint changed from Sprint 97 to Sprint 98

#6 Updated by dalley about 1 month ago

  • Related to Story #8873: pulp 3 stops when encounters 403 error added

#7 Updated by rchan about 1 month ago

  • Sprint changed from Sprint 98 to Sprint 99

#8 Updated by rchan 27 days ago

  • Sprint changed from Sprint 99 to Sprint 100

#9 Updated by dalley 23 days ago

  • Related to Issue #9019: A variable referenced before assignment while reading repomd added

#10 Updated by dalley 23 days ago

  • Related to deleted (Issue #9019: A variable referenced before assignment while reading repomd )

#11 Updated by dalley 23 days ago

  • Has duplicate Issue #9019: A variable referenced before assignment while reading repomd added

#12 Updated by dalley 23 days ago

  • Has duplicate Issue #9022: errors fetching repomd.xml will fail with python error 'local variable 'result' referenced before assignment' added

#13 Updated by dalley 22 days ago

  • Status changed from POST to MODIFIED

#14 Updated by dalley 22 days ago

#15 Updated by dalley 22 days ago

  • Sprint/Milestone set to 3.13.3

#16 Updated by dalley 16 days ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF