Actions
Issue #7236
closedSync fails if packages do not have a 'section' field
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - Debian:
Platform Release:
Target Release - Debian:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:
Description
The following remote can be used to reproduce this:
http post :/pulp/api/v3/remotes/deb/apt/ name=mongo_debian_remote distributions="buster/mongodb-org/4.4" url="http://repo.mongodb.org/apt/debian/"
The traceback:
Traceback (most recent call last):
File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rq/worker.py", line 934, in perform_job
rv = job.perform()
File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rq/job.py", line 686, in perform
self._result = self._execute()
File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rq/job.py", line 692, in _execute
return self.func(*self.args, **self.kwargs)
File "/home/vagrant/devel/pulp_deb/pulp_deb/app/tasks/synchronizing.py", line 106, in synchronize
DebDeclarativeVersion(first_stage, repository, mirror=mirror).create()
File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/declarative_version.py", line 148, in create
loop.run_until_complete(pipeline)
File "/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/api.py", line 225, in create_pipeline
await asyncio.gather(*futures)
File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/api.py", line 43, in __call__
await self.run()
File "/home/vagrant/devel/pulp_deb/pulp_deb/app/tasks/synchronizing.py", line 388, in run
await asyncio.gather(
File "/home/vagrant/devel/pulp_deb/pulp_deb/app/tasks/synchronizing.py", line 442, in _handle_distribution
await asyncio.gather(
File "/home/vagrant/devel/pulp_deb/pulp_deb/app/tasks/synchronizing.py", line 496, in _handle_component
await asyncio.gather(*pending_tasks)
File "/home/vagrant/devel/pulp_deb/pulp_deb/app/tasks/synchronizing.py", line 542, in _handle_package_index
serializer.is_valid(raise_exception=True)
File "/usr/local/lib/pulp/lib64/python3.8/site-packages/rest_framework/serializers.py", line 243, in is_valid
raise ValidationError(self.errors)
rest_framework.exceptions.ValidationError: {'section': [ErrorDetail(string='This field is required.', code='required')], 'priority': [ErrorDetail(string='This field is required.', code='required')]}
It looks like there are packages without a section field which is declared as "required" by pulp_deb.
Debian only recommends (but does not require) this field (for both source and binary packages): https://www.debian.org/doc/debian-policy/ch-controlfields.html
If follows the plugin should not require it either.
We may want to take this opportunity to check for other falsely required fields.
Related issues
Actions
Change required status of package fields.
fixes #7236 https://pulp.plan.io/issues/7236