Project

Profile

Help

Issue #3057

Pulp is not compatible with DRF 3.7.0

Added by bmbouter about 2 years ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
High
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Dev Environment
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

When I vagrant up now with the fully up to date checkouts and vagrant file I get the following error:

TASK [dev : makemigrations] **************************************************** fatal: [pulp3_dev]: FAILED! => {"changed": true, "cmd": ["/home/vagrant/.virtualenvs/pulp/bin/pulp-manager", "makemigrations", "pulp_app"], "delta": "0:00:01.046183", "end": "2017-10-06 16:00:14.387132", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2017-10-06 16:00:13.340949", "stderr": "Traceback (most recent call last):\n File \"/home/vagrant/.virtualenvs/pulp/bin/pulp-manager\", line 9, in <module>\n load_entry_point('pulpcore', 'console_scripts', 'pulp-manager')()\n File \"/home/vagrant/devel/pulp/platform/pulpcore/app/entry_points.py\", line 9, in pulp_manager_entry_point\n execute_from_command_line(sys.argv)\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/core/management/__init__.py\", line 354, in execute_from_command_line\n utility.execute()\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/core/management/__init__.py\", line 328, in execute\n django.setup()\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/__init__.py\", line 18, in setup\n apps.populate(settings.INSTALLED_APPS)\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/apps/registry.py\", line 115, in populate\n app_config.ready()\n File \"/home/vagrant/devel/pulp/platform/pulpcore/app/apps.py\", line 74, in ready\n self.import_viewsets()\n File \"/home/vagrant/devel/pulp/platform/pulpcore/app/apps.py\", line 100, in import_viewsets\n from pulpcore.app.viewsets import (GenericNamedModelViewSet, NamedModelViewSet,\n File \"/home/vagrant/devel/pulp/platform/pulpcore/app/viewsets/__init__.py\", line 1, in <module>\n from pulpcore.app.viewsets.base import (GenericNamedModelViewSet, NamedModelViewSet, # noqa\n File \"/home/vagrant/devel/pulp/platform/pulpcore/app/viewsets/base.py\", line 4, in <module>\n from rest_framework import viewsets, mixins\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/viewsets.py\", line 26, in <module>\n from rest_framework import generics, mixins, views\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/generics.py\", line 11, in <module>\n from rest_framework import mixins, views\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/mixins.py\", line 10, in <module>\n from rest_framework.response import Response\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/response.py\", line 13, in <module>\n from rest_framework.serializers import Serializer\n File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/serializers.py\", line 1534, in <module>\n ModelSerializer.serializer_field_mapping[postgres_fields.JSONField] = JSONField\nAttributeError: module 'django.contrib.postgres.fields' has no attribute 'JSONField'", "stderr_lines": ["Traceback (most recent call last):", " File \"/home/vagrant/.virtualenvs/pulp/bin/pulp-manager\", line 9, in <module>", " load_entry_point('pulpcore', 'console_scripts', 'pulp-manager')()", " File \"/home/vagrant/devel/pulp/platform/pulpcore/app/entry_points.py\", line 9, in pulp_manager_entry_point", " execute_from_command_line(sys.argv)", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/core/management/__init__.py\", line 354, in execute_from_command_line", " utility.execute()", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/core/management/__init__.py\", line 328, in execute", " django.setup()", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/__init__.py\", line 18, in setup", " apps.populate(settings.INSTALLED_APPS)", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/apps/registry.py\", line 115, in populate", " app_config.ready()", " File \"/home/vagrant/devel/pulp/platform/pulpcore/app/apps.py\", line 74, in ready", " self.import_viewsets()", " File \"/home/vagrant/devel/pulp/platform/pulpcore/app/apps.py\", line 100, in import_viewsets", " from pulpcore.app.viewsets import (GenericNamedModelViewSet, NamedModelViewSet,", " File \"/home/vagrant/devel/pulp/platform/pulpcore/app/viewsets/__init__.py\", line 1, in <module>", " from pulpcore.app.viewsets.base import (GenericNamedModelViewSet, NamedModelViewSet, # noqa", " File \"/home/vagrant/devel/pulp/platform/pulpcore/app/viewsets/base.py\", line 4, in <module>", " from rest_framework import viewsets, mixins", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/viewsets.py\", line 26, in <module>", " from rest_framework import generics, mixins, views", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/generics.py\", line 11, in <module>", " from rest_framework import mixins, views", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/mixins.py\", line 10, in <module>", " from rest_framework.response import Response", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/response.py\", line 13, in <module>", " from rest_framework.serializers import Serializer", " File \"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/serializers.py\", line 1534, in <module>", " ModelSerializer.serializer_field_mapping[postgres_fields.JSONField] = JSONField", "AttributeError: module 'django.contrib.postgres.fields' has no attribute 'JSONField'"], "stdout": "", "stdout_lines": []}

This started happening today which is also when DRF came out on PyPI. This is showing in Ansible, but I think we need to update Pulp to be compatible with 3.7.0.

Associated revisions

Revision 8ecb2c2b View on GitHub
Added by dkliban@redhat.com about 2 years ago

Problem: not compatible with DRF 3.7.0

Solution: stop using features that had been deprecated in 3.5

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

Revision 8ecb2c2b View on GitHub
Added by dkliban@redhat.com about 2 years ago

Problem: not compatible with DRF 3.7.0

Solution: stop using features that had been deprecated in 3.5

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

Revision 8ecb2c2b View on GitHub
Added by dkliban@redhat.com about 2 years ago

Problem: not compatible with DRF 3.7.0

Solution: stop using features that had been deprecated in 3.5

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

History

#1 Updated by bmbouter about 2 years ago

  • Description updated (diff)

#2 Updated by bmbouter about 2 years ago

I applied this diff, but I still got a 3.7.0 when I vagrant up which caused it to fail again. Something earlier in the ansible playbook must be installing drf.

diff --git a/platform/setup.py b/platform/setup.py
index feb55bf..0fe12d5 100755
--- a/platform/setup.py
+++ b/platform/setup.py
@@ -8,7 +8,7 @@ requirements = [
     'coreapi',
     'Django>=1.8,<2',
     'django-filter',
-    'djangorestframework',
+    'djangorestframework==3.6.4',
     'drf-nested-routers',
     'psycopg2',
     'PyYAML',

#3 Updated by bmbouter about 2 years ago

After experiencing the Vagrant error I ssh into the machine and downgrade drf using: workon pulp;pip install djangorestframework==3.6.4. Then I go back and run a vagrant provision and it completes successfully. This means two things:

1. This issue is root caused in DRF 3.7.0 compatability
2. Something in the ansible playbook djangorestframework other than the dependency specified in setup.py. Maybe it's one of these ?

Thanks to @dkliban for the vagrant provision idea.

#4 Updated by dkliban@redhat.com about 2 years ago

  • Status changed from NEW to POST
  • Assignee set to dkliban@redhat.com

#5 Updated by dkliban@redhat.com about 2 years ago

  • Status changed from POST to MODIFIED

#6 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#7 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF