Project

Profile

Help

Issue #8769

Missing left parenthesis error when creating content package

Added by ciokan 5 months ago. Updated 4 months ago.

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

Description

I get this error when trying to upload a file to the rpm package:

pulp_worker_1            | pulp [f0af99ab768d4acfadf171acf9efb553]: rq.worker:ERROR: Traceback (most recent call last):
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
pulp_worker_1            |     return self.cursor.execute(sql, params)
pulp_worker_1            | psycopg2.errors.InvalidTextRepresentation: malformed record literal: ""
pulp_worker_1            | LINE 1: ...uuid, 'test', '0', '0.2.59', '1', 'x86_64', '', 'efc6c...
pulp_worker_1            |                                                              ^
pulp_worker_1            | DETAIL:  Missing left parenthesis.
pulp_worker_1            |
pulp_worker_1            |
pulp_worker_1            | The above exception was the direct cause of the following exception:
pulp_worker_1            |
pulp_worker_1            | Traceback (most recent call last):
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/rq/worker.py", line 1013, in perform_job
pulp_worker_1            |     rv = job.perform()
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/rq/job.py", line 709, in perform
pulp_worker_1            |     self._result = self._execute()
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/rq/job.py", line 732, in _execute
pulp_worker_1            |     result = self.func(*self.args, **self.kwargs)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/tasks/base.py", line 35, in general_create
pulp_worker_1            |     serializer.save()
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 205, in save
pulp_worker_1            |     self.instance = self.create(validated_data)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/pulpcore/plugin/serializers/content.py", line 45, in create
pulp_worker_1            |     content = super().create(validated_data)
pulp_worker_1            |   File "/usr/lib64/python3.9/contextlib.py", line 79, in inner
pulp_worker_1            |     return func(*args, **kwds)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/serializers/content.py", line 60, in create
pulp_worker_1            |     content = self.Meta.model.objects.create(**validated_data)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/manager.py", line 82, in manager_method
pulp_worker_1            |     return getattr(self.get_queryset(), name)(*args, **kwargs)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 422, in create
pulp_worker_1            |     obj.save(force_insert=True, using=self.db)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/pulpcore/app/models/base.py", line 149, in save
pulp_worker_1            |     return super().save(*args, **kwargs)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django_lifecycle/mixins.py", line 134, in save
pulp_worker_1            |     save(*args, **kwargs)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 743, in save
pulp_worker_1            |     self.save_base(using=using, force_insert=force_insert,
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 780, in save_base
pulp_worker_1            |     updated = self._save_table(
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 873, in _save_table
pulp_worker_1            |     result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 910, in _do_insert
pulp_worker_1            |     return manager._insert([self], fields=fields, return_id=update_pk,
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/manager.py", line 82, in manager_method
pulp_worker_1            |     return getattr(self.get_queryset(), name)(*args, **kwargs)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1186, in _insert
pulp_worker_1            |     return query.get_compiler(using=using).execute_sql(return_id)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1377, in execute_sql
pulp_worker_1            |     cursor.execute(sql, params)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 67, in execute
pulp_worker_1            |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
pulp_worker_1            |     return executor(sql, params, many, context)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
pulp_worker_1            |     return self.cursor.execute(sql, params)
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 89, in __exit__
pulp_worker_1            |     raise dj_exc_value.with_traceback(traceback) from exc_value
pulp_worker_1            |   File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
pulp_worker_1            |     return self.cursor.execute(sql, params)
pulp_worker_1            | django.db.utils.DataError: malformed record literal: ""
pulp_worker_1            | LINE 1: ...uuid, 'test', '0', '0.2.59', '1', 'x86_64', '', 'efc6c...
pulp_worker_1            |                                                              ^
pulp_worker_1            | DETAIL:  Missing left parenthesis.
pulp_worker_1            |

The error propagates from this db query:

INSERT INTO "rpm_package"
            ("content_ptr_id",
             "name",
             "epoch",
             "version",
             "release",
             "arch",
             "evr",
             "pkgId",
             "checksum_type",
             "summary",
             "description",
             "url",
             "changelogs",
             "files",
             "requires",
             "provides",
             "conflicts",
             "obsoletes",
             "suggests",
             "enhances",
             "recommends",
             "supplements",
             "location_base",
             "location_href",
             "rpm_buildhost",
             "rpm_group",
             "rpm_license",
             "rpm_packager",
             "rpm_sourcerpm",
             "rpm_vendor",
             "rpm_header_start",
             "rpm_header_end",
             "size_archive",
             "size_installed",
             "size_package",
             "time_build",
             "time_file",
             "is_modular")
VALUES      ('340746f2-bcd3-4140-9510-c7b23a8ec124' :: uuid,
             'test',
             '0',
             '0.2.59',
             '1',
             'x86_64',
             '',
             'efc6c3ce265e4b46fcb0d0176f731ed3f3b39d5bf5acef095888189a93a78c0d',
             'sha256',
             'test DNS Proxy',
             'test DNS Proxy',
             'https://test.com',
             '[]',
             '[["", "/usr/bin/", "test"]]',
             '[]',
             '[["test", "EQ", "0", "0.2.59", "1", false]]',
             '[]',
             '[]',
             '[]',
             '[]',
             '[]',
             '[]',
             '',
             'dnsadblock_0.2.59_linux_amd64.rpm',
             'ciokan',
             'Development/Tools',
             '',
             'test <office@test.com>',
             'test-0.2.59-1.src.rpm',
             'test Inc',
             272,
             1804,
             9003008,
             9003008,
             3572127,
             1591340775,
             1621291690,
             FALSE)

...and it complaints about a missing left parenthesis on the 7th param which is empty (evr column).

The file was uploaded using a bash script:

task_url=$(http --form POST "$BASE_ADDR/pulp/api/v3/content/rpm/packages/" "$CREDS" file@"$file" relative_path="$pkg" | jq -r '.task')

Postgres 11.1 pulpcore==3.12.2 pulp-rpm==3.10.0 pulp-deb==2.12.0

History

#1 Updated by ggainey 5 months ago

@ciokan - would it be possible for you to attach the file for the specific failing RPM to this issue? Looks like test-0.2.59-1.x86_64. I'm really curious to see if there's something specific about that RPM. Thanks so much!

#2 Updated by dalley 5 months ago

@ciokan, please let us know, we'd love to help reproduce and fix this.

#3 Updated by dalley 4 months ago

  • Status changed from NEW to CLOSED - WORKSFORME

If you're still experiencing the issue, comment and we can re-open it. Otherwise we don't have enough information to act on this.

Please register to edit this issue

Also available in: Atom PDF