Project

Profile

Help

Issue #9559

closed

Unable to sync Fedora 35 repository

Added by hyu about 1 year ago. Updated about 1 year ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.21.1
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Katello, Pulp 2
Sprint:
Quarter:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2020473

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" /usr/lib/.build-id /usr/lib/.build-id/42 /usr/lib/.build-id/42/5049f5a9e0d1ac25c21de795f28fe886bfa0ca /usr/lib64/R/library/rlang /usr/lib64/R/library/rlang/DESCRIPTION /usr/lib64/R/library/rlang/INDEX /usr/lib64/R/library/rlang/LICENSE /usr/lib64/R/library/rlang/Meta snip... /usr/lib64/R/library/rlang/help/wref_key.html /usr/lib64/R/library/rlang/help/wref_value.html /usr/lib64/R/library/rlang/help/zap.html /usr/lib64/R/library/rlang/help/zap_srcref.html /usr/lib64/R/library/rlang/help/{{.html <================= TemplateSyntaxError: Empty variable tag on line 548\n", /usr/lib64/R/library/rlang/help/{{}}.html <=================

$ 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

help]$ cat {{}}.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/

  1. 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.

Actions #1

Updated by pulpbot about 1 year ago

  • Status changed from NEW to POST
Actions #2

Updated by dkliban@redhat.com about 1 year ago

  • Project changed from Pulp to RPM Support

Added by hyu about 1 year ago

Revision 45388998

Escape django template syntax in xml when rendering filelist

Some filenames contain special characters that may cause Django template render error. They need to be escaped.

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

Actions #3

Updated by hyu about 1 year ago

  • Status changed from POST to MODIFIED

Also available in: Atom PDF