Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2020473

Summary: Unable to sync Fedora 35 repository
Product: Red Hat Satellite Reporter: Hao Chang Yu <hyu>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Lai <ltran>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: bhoppus, dkliban, jalviso, ttereshc, wclark, zconnor
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-06 20:26:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hao Chang Yu 2021-11-05 01:41:24 UTC
Description of problem:
When publishing the Fedora 35 repository, Pulp failed with the following error:
----------------------------------
celery.app.trace:ERROR: [56fc62c9] (24505-91520) Task pulp.server.managers.repo.publish.publish[56fc62c9-29b0-41bf-a820-ba3625ef4a00] raised unexpected: TemplateSyntaxError(u'Empty variable tag on line 548',)
celery.app.trace:ERROR: [56fc62c9] (24505-91520) Traceback (most recent call last):
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     R = retval = fun(*args, **kwargs)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 688, in __call__
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     return super(Task, self).__call__(*args, **kwargs)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 110, in __call__
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     return super(PulpTask, self).__call__(*args, **kwargs)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     return self.run(*args, **kwargs)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 1142, in publish
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     result = check_publish(repo_obj, dist_id, dist_inst, transfer_repo, conduit, call_config)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 1251, in check_publish
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     result = _do_publish(repo_obj, dist_id, dist_inst, transfer_repo, conduit, call_config)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 1303, in _do_publish
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     publish_report = publish_repo(transfer_repo, conduit, call_config)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 901, in wrap_f
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     return f(*args, **kwargs)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/distributors/yum/distributor.py", line 185, in publish_repo
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     return self._publisher.process_lifecycle()
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/plugins/util/publish_step.py", line 573, in process_lifecycle
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     super(PluginStep, self).process_lifecycle()
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/plugins/util/publish_step.py", line 164, in process_lifecycle
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     step.process()
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/plugins/util/publish_step.py", line 240, in process
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     self._process_block(item=item)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp/plugins/util/publish_step.py", line 302, in _process_block
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     self.process_main(item=item)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/distributors/yum/publish.py", line 500, in process_main
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     context.add_unit_metadata(unit)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/distributors/yum/metadata/filelists.py", line 42, in add_unit_metadata
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     self.metadata_file_handle.write(unit.render_filelists(self.checksum_type))
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/db/models.py", line 869, in render_filelists
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     return self._render(metadata, context)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/db/models.py", line 884, in _render
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     t = Template(template)
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/django/template/base.py", line 191, in __init__
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     self.nodelist = self.compile_nodelist()
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/django/template/base.py", line 230, in compile_nodelist
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     return parser.parse()
celery.app.trace:ERROR: [56fc62c9] (24505-91520)   File "/usr/lib/python2.7/site-packages/django/template/base.py", line 482, in parse
celery.app.trace:ERROR: [56fc62c9] (24505-91520)     raise self.error(token, 'Empty variable tag on line %d' % token.lineno)
celery.app.trace:ERROR: [56fc62c9] (24505-91520) TemplateSyntaxError: Empty variable tag on line 548
----------------------------------

This is because one of the rpm in the repo has as "{{" filename causing the Django template syntax error.

In "6dc8dae1be904c2613d5aa3667dacd2554d05077eb1ce4296b6edfa3c4db3a46-filelists.xml.gz"
<package pkgid="f2056c2614a2e47efd63138cf9ad2fac9ea5ea193d736fc35069c1bf6723d549" name="R-rlang" arch="x86_64">
  <version epoch="0" ver="0.4.11" rel="3.fc35"/>
  <file type="dir">/usr/lib/.build-id</file>
  <file type="dir">/usr/lib/.build-id/42</file>
  <file>/usr/lib/.build-id/42/5049f5a9e0d1ac25c21de795f28fe886bfa0ca</file>
  <file type="dir">/usr/lib64/R/library/rlang</file>
  <file>/usr/lib64/R/library/rlang/DESCRIPTION</file>
  <file>/usr/lib64/R/library/rlang/INDEX</file>
  <file>/usr/lib64/R/library/rlang/LICENSE</file>
  <file type="dir">/usr/lib64/R/library/rlang/Meta</file>
  snip...
  <file>/usr/lib64/R/library/rlang/help/wref_key.html</file>
  <file>/usr/lib64/R/library/rlang/help/wref_value.html</file>
  <file>/usr/lib64/R/library/rlang/help/zap.html</file>
  <file>/usr/lib64/R/library/rlang/help/zap_srcref.html</file>
  <file>/usr/lib64/R/library/rlang/help/{{.html</file>   <================= TemplateSyntaxError: Empty variable tag on line 548\n",
  <file>/usr/lib64/R/library/rlang/help/{{}}.html</file> <=================


$ rpm -qlp R-rlang-0.4.11-3.fc35.x86_64.rpm | grep "{{"
/usr/lib64/R/library/rlang/help/{{.html
/usr/lib64/R/library/rlang/help/{{}}.html

help]$ cat \{\{.html 
<html><head><meta http-equiv='refresh' content='0; url=../html/nse-force.html'></head></html>

help]$ cat \{\{\}\}.html
<html><head><meta http-equiv='refresh' content='0; url=../html/nse-force.html'></head></html>


Steps to Reproduce:
1. Create a custom repository call fedora 35 and add the following feed url

https://dl.fedoraproject.org/pub/fedora/linux/releases/35/Everything/x86_64/os/

2. Sync the repo

Actual results:
Failed to publish repo


Expected results:
Repo can be published successfully


Additional info:
Tested on Satellite 6.10 and the repository can be synced successfully without issue.

Comment 4 Dennis Kliban 2021-11-08 21:47:44 UTC
This is going to be resolved in Satellite 6.10 which will be out very soon.

Comment 10 wclark 2022-01-10 18:48:39 UTC
Changing status to POST since the upstream issue has been resolved: https://github.com/pulp/pulp_rpm/pull/2171