Project

Profile

Help

Issue #3057

closed

Pulp is not compatible with DRF 3.7.0

Added by bmbouter over 6 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Dev Environment
Sprint:
Quarter:

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 \\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 \\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 \\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 \\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 \\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 \\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 \\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 \\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 ", " 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 ", " from pulpcore.app.viewsets.base import (GenericNamedModelViewSet, NamedModelViewSet, \# noqa", " File \\"/home/vagrant/devel/pulp/platform/pulpcore/app/viewsets/base.py\\", line 4, in ", " from rest_framework import viewsets, mixins", " File \\"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/viewsets.py\\", line 26, in ", " from rest_framework import generics, mixins, views", " File \\"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/generics.py\\", line 11, in ", " from rest_framework import mixins, views", " File \\"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/mixins.py\\", line 10, in ", " from rest_framework.response import Response", " File \\"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/response.py\\", line 13, in ", " from rest_framework.serializers import Serializer", " File \\"/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/rest_framework/serializers.py\\", line 1534, in ", " 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.

Actions #1

Updated by bmbouter over 6 years ago

  • Description updated (diff)
Actions #2

Updated by bmbouter over 6 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',
Actions #3

Updated by bmbouter over 6 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.

Added by dkliban@redhat.com over 6 years ago

Revision 8ecb2c2b | View on GitHub

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

Added by dkliban@redhat.com over 6 years ago

Revision 8ecb2c2b | View on GitHub

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

Actions #4

Updated by dkliban@redhat.com over 6 years ago

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

Updated by dkliban@redhat.com over 6 years ago

  • Status changed from POST to MODIFIED
Actions #6

Updated by daviddavis almost 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #7

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #8

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF