Skip to content

Commit 56df6f7

Browse files
committed
cmd-buildfetch: treat 504 as if the object doesn't exist
The RHCOS builds browser seems to be throwing 504 when the object doesn't exist: ``` Fetching: <snip>/storage/prod/streams/rhel-10.2/builds/builds.json Updated builds/builds.json Traceback (most recent call last): File "/usr/lib/coreos-assembler/cmd-buildfetch", line 329, in <module> sys.exit(main()) ~~~~^^ File "/usr/lib/coreos-assembler/cmd-buildfetch", line 156, in main if fetcher.exists(f'{builddir}/{f}'): ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/usr/lib/coreos-assembler/cmd-buildfetch", line 251, in exists return self.exists_impl(url) ~~~~~~~~~~~~~~~~^^^^^ File "/usr/lib/python3.14/site-packages/tenacity/__init__.py", line 334, in wrapped_f return copy(f, *args, **kw) File "/usr/lib/python3.14/site-packages/tenacity/__init__.py", line 473, in __call__ do = self.iter(retry_state=retry_state) File "/usr/lib/python3.14/site-packages/tenacity/__init__.py", line 374, in iter result = action(retry_state) File "/usr/lib/python3.14/site-packages/tenacity/__init__.py", line 396, in <lambda> self._add_action_func(lambda rs: rs.outcome.result()) ~~~~~~~~~~~~~~~~~^^ File "/usr/lib64/python3.14/concurrent/futures/_base.py", line 443, in result return self.__get_result() ~~~~~~~~~~~~~~~~~^^ File "/usr/lib64/python3.14/concurrent/futures/_base.py", line 395, in __get_result raise self._exception File "/usr/lib/python3.14/site-packages/tenacity/__init__.py", line 476, in __call__ result = fn(*args, **kwargs) File "/usr/lib/coreos-assembler/cmd-buildfetch", line 291, in exists_impl raise Exception(f"Received rc {r.status_code} for {url}") Exception: Received rc 504 for <snip>/storage/prod/streams/rhel-10.2/builds/10.2.20260307-0/x86_64/ostree-commit-object failed to execute cmd-buildfetch: exit status 1 + rc=1 + set +x ```
1 parent 89d331c commit 56df6f7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/cmd-buildfetch

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,11 @@ class HTTPFetcher(Fetcher):
284284
with requests.head(url) as r:
285285
if r.status_code == 200:
286286
return True
287-
# just treat 403 as ENOENT too; this is common for APIs to do (like
287+
# Just treat 403 as ENOENT too; this is common for APIs to do (like
288288
# AWS) and we don't support HTTP basic auth here anyway
289-
if r.status_code in [404, 403]:
289+
# Lump 504 in here because the RHCOS builds browser/proxy returns a
290+
# 504 if the object doesn't exist.
291+
if r.status_code in [404, 403, 504]:
290292
return False
291293
raise Exception(f"Received rc {r.status_code} for {url}")
292294

0 commit comments

Comments
 (0)