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

Error when creating container distribution during Katello repo sync #673

Closed
ianballou opened this issue Mar 30, 2022 · 5 comments · Fixed by #674
Closed

Error when creating container distribution during Katello repo sync #673

ianballou opened this issue Mar 30, 2022 · 5 comments · Fixed by #674

Comments

@ianballou
Copy link
Contributor

ianballou commented Mar 30, 2022

Version
pulpcore 3.17
pulp-container 2.10.0
Katello dev master

Describe the bug
The following traceback pops up when creating a distribution during Katello repo syncing:

---
pulp_tasks:
- pulp_href: "/pulp/api/v3/tasks/2d8f97f8-2e85-41d1-a1fd-430c9b93762c/"
  pulp_created: '2022-03-30T15:36:10.126+00:00'
  state: failed
  name: pulpcore.app.tasks.base.general_create
  logging_cid: 400f358d-f211-4530-b4e4-f2befc90f4fe
  started_at: '2022-03-30T15:36:10.177+00:00'
  finished_at: '2022-03-30T15:36:10.319+00:00'
  error:
    traceback: !ruby/string:Sequel::SQL::Blob |2
        File "/usr/lib/python3.8/site-packages/pulpcore/tasking/pulpcore_worker.py", line 362, in _perform_task
          result = func(*args, **kwargs)
        File "/usr/lib/python3.8/site-packages/pulpcore/app/tasks/base.py", line 38, in general_create
          serializer.save()
        File "/usr/lib/python3.8/site-packages/rest_framework/serializers.py", line 205, in save
          self.instance = self.create(validated_data)
        File "/usr/lib/python3.8/site-packages/pulpcore/app/serializers/base.py", line 161, in create
          instance = super().create(validated_data)
        File "/usr/lib/python3.8/site-packages/rest_framework/serializers.py", line 939, in create
          instance = ModelClass._default_manager.create(**validated_data)
        File "/usr/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method
          return getattr(self.get_queryset(), name)(*args, **kwargs)
        File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 453, in create
          obj.save(force_insert=True, using=self.db)
        File "/usr/lib/python3.8/site-packages/pulpcore/app/models/base.py", line 151, in save
          return super().save(*args, **kwargs)
        File "/usr/lib64/python3.8/contextlib.py", line 75, in inner
          return func(*args, **kwds)
        File "/usr/lib/python3.8/site-packages/django_lifecycle/mixins.py", line 138, in save
          self._run_hooked_methods(AFTER_CREATE)
        File "/usr/lib/python3.8/site-packages/django_lifecycle/mixins.py", line 221, in _run_hooked_methods
          method(self)
        File "/usr/lib/python3.8/site-packages/django_lifecycle/decorators.py", line 69, in func
          hooked_method(*args, **kwargs)
        File "/usr/lib/python3.8/site-packages/pulpcore/app/models/access_policy.py", line 88, in add_perms
          self._handle_creation_hooks(access_policy)
        File "/usr/lib/python3.8/site-packages/pulpcore/app/models/access_policy.py", line 105, in _handle_creation_hooks
          function(creation_hook.get("permissions"), creation_hook.get("parameters"))
        File "/usr/lib/python3.8/site-packages/pulp_container/app/models.py", line 526, in create_distribution_group
          current_user.groups.add(group)
    description: "'NoneType' object has no attribute 'groups'"
  worker: "/pulp/api/v3/workers/9e5d85ac-a196-4c30-8c27-42732f18521f/"
  child_tasks: []
  progress_reports: []
  created_resources: []
  reserved_resources_record:
  - "/api/v3/distributions/"
task_groups: []
poll_attempts:
  total: 1
  failed: 1

To Reproduce
Try to sync a container repository in Katello after switching to the Pulpcore 3.17 repo, upgrading Pulp plugins, and migrating. Mine was prometheus/busybox on quay.io. I used the 'content only' mirroring policy and 'on demand' for a download policy.

Expected behavior
Create the distribution successfully.

This issue is currently blocking Katello's upgrade to Pulpcore 3.17.

@ianballou
Copy link
Contributor Author

pulp status version output:

{
  "versions": [
    {
      "component": "core",
      "version": "3.17.3"
    },
    {
      "component": "rpm",
      "version": "3.17.3"
    },
    {
      "component": "python",
      "version": "3.6.0"
    },
    {
      "component": "ostree",
      "version": "2.0.0a4"
    },
    {
      "component": "file",
      "version": "1.10.1"
    },
    {
      "component": "deb",
      "version": "2.17.0"
    },
    {
      "component": "container",
      "version": "2.10.0"
    },
    {
      "component": "certguard",
      "version": "1.5.2"
    },
    {
      "component": "ansible",
      "version": "0.12.0"
    }
  ],

@dkliban
Copy link
Member

dkliban commented Mar 30, 2022

Please try upgrading to pulpcore 3.17.6 and pulp-container 2.10.2. Does the problem persist after the upgrade?

@ianballou
Copy link
Contributor Author

The problem is the same after upgrading pulpcore and pulp-container.

@ianballou
Copy link
Contributor Author

Here's an example of the data that we pass in to create the distribution:

#<PulpContainerClient::ContainerContainerDistribution:0x00007f38a4a3bce8 @base_path="default_organization-buttermilk_pancakes-library_hello-world", @name="library_hello-world-53555", @repository_version="/pulp/api/v3/repositories/container/container/1fe26685-e1ce-4998-ac34-3b1507052a43/versions/1/">

mdellweg added a commit to mdellweg/pulp_container that referenced this issue Mar 31, 2022
@mdellweg
Copy link
Member

Can you trace the api POST request in the pulp api logs and verify that it is made as the admin user?

mdellweg added a commit that referenced this issue Mar 31, 2022
patchback bot pushed a commit that referenced this issue Mar 31, 2022
patchback bot pushed a commit that referenced this issue Mar 31, 2022
mdellweg added a commit that referenced this issue Mar 31, 2022
fixes #673

(cherry picked from commit b1725ad)
mdellweg added a commit that referenced this issue Mar 31, 2022
fixes #673

(cherry picked from commit b1725ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants