Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulp3Error: value too long for type character varying(20) when syncing SLES enterprise repo #2501

Closed
quba42 opened this issue Apr 26, 2022 · 4 comments · Fixed by #2510
Closed

Comments

@quba42
Copy link
Contributor

quba42 commented Apr 26, 2022

Version
pulp_rpm 3.14.14
pulpcore 3.14.16
Katello 4.1

From looking at the current pulp_rpm main branch, I think it is still affected.

Describe the bug
Trying to sync the SLES enterprise repo "NVIDIA Compute Module 15 x86_64 (id: 2131)" to Katello results in the following Error:

     {"traceback"=>
       "  File \"/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py\", line 339, in _perform_task\n" +
       "    result = func(*args, **kwargs)\n" +
       "  File \"/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py\", line 494, in synchronize\n" +
       "    version = dv.create()\n" +
       "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/declarative_version.py\", line 151, in create\n" +
       "    loop.run_until_complete(pipeline)\n" +
       "  File \"/usr/lib64/python3.6/asyncio/base_events.py\", line 484, in run_until_complete\n" +
       "    return future.result()\n" +
       "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py\", line 225, in create_pipeline\n" +
       "    await asyncio.gather(*futures)\n" +
       "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py\", line 43, in __call__\n" +
       "    await self.run()\n" +
       "  File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/content_stages.py\", line 117, in run\n" +
       "    d_content.content.save()\n" +
       "  File \"/usr/lib/python3.6/site-packages/pulpcore/app/models/base.py\", line 149, in save\n" +
       "    return super().save(*args, **kwargs)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django_lifecycle/mixins.py\", line 134, in save\n" +
       "    save(*args, **kwargs)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 744, in save\n" +
       "    force_update=force_update, update_fields=update_fields)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 782, in save_base\n" +
       "    force_update, using, update_fields,\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 873, in _save_table\n" +
       "    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/models/base.py\", line 911, in _do_insert\n" +
       "    using=using, raw=raw)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/models/manager.py\", line 82, in manager_method\n" +
       "    return getattr(self.get_queryset(), name)(*args, **kwargs)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/models/query.py\", line 1186, in _insert\n" +
       "    return query.get_compiler(using=using).execute_sql(return_id)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1377, in execute_sql\n" +
       "    cursor.execute(sql, params)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 67, in execute\n" +
       "    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 76, in _execute_with_wrappers\n" +
       "    return executor(sql, params, many, context)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n" +
       "    return self.cursor.execute(sql, params)\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/utils.py\", line 89, in __exit__\n" +
       "    raise dj_exc_value.with_traceback(traceback) from exc_value\n" +
       "  File \"/usr/lib/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n" +
       "    return self.cursor.execute(sql, params)\n",
      "description"=>"value too long for type character varying(20)\n"},

To Reproduce

Unfortunately requires access to a SUSE Customer Center account.

With such an account try to sync the relevant repo using the Katello SCC manager (or else directly into Pulp) and get the Error.

Expected behavior
Successful sync.

Additional context

From my testing around this problem, it looks like the affected repo is trying to write the string "license-sle-module-NVIDIA-compute" into the following DB field: https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/models/custom_metadata.py#L26

This results in the error because the string is too long for this RepoMetadataFile.

@quba42
Copy link
Contributor Author

quba42 commented Apr 26, 2022

Also happens during 2to3 migrations if the repo was successfully synced into Pulp 2.

@quba42
Copy link
Contributor Author

quba42 commented Apr 26, 2022

Here is the corresponding Pulp 2 field (not limited to 20 chars): https://github.com/pulp/pulp_rpm/blob/2-master/plugins/pulp_rpm/plugins/db/models.py#L1499

@quba42
Copy link
Contributor Author

quba42 commented Apr 26, 2022

If it helps, I can provide the repomd.xml of the affected repo.

The relevant reference appears to be:

  <data type="license-sle-module-NVIDIA-compute">
    <checksum type="sha256">1e4ee5542231148c5ca39533ff19d93848ec1829cbf7d269f7ebabef856e184b</checksum>
    <open-checksum type="sha256">19f8b210cd2ebc344f510de59049c78d935f4703045d69f23a17c152b1171ebb</open-checksum>
    <location href="repodata/1e4ee5542231148c5ca39533ff19d93848ec1829cbf7d269f7ebabef856e184b-license-sle-module-NVIDIA-compute.tar.gz"/>
    <timestamp>1595928326</timestamp>
    <size>627</size>
    <open-size>10240</open-size>
  </data>

@quba42
Copy link
Contributor Author

quba42 commented Apr 28, 2022

See also the discourse discussion on this issue: https://discourse.pulpproject.org/t/fixing-a-pulp-rpm-20-char-db-field-limit-with-backports/439

quba42 added a commit to ATIX-AG/pulp_rpm that referenced this issue Apr 28, 2022
quba42 added a commit to ATIX-AG/pulp_rpm that referenced this issue May 2, 2022
quba42 added a commit to ATIX-AG/pulp_rpm that referenced this issue May 2, 2022
quba42 added a commit to ATIX-AG/pulp_rpm that referenced this issue May 2, 2022
dralley pushed a commit that referenced this issue May 3, 2022
quba42 added a commit to ATIX-AG/pulp_rpm that referenced this issue May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant