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

500 error when the listing all domains and filtering by name 'default' #5364

Open
dkliban opened this issue May 13, 2024 · 3 comments
Open
Labels

Comments

@dkliban
Copy link
Member

dkliban commented May 13, 2024

pulpcore 3.52.0 is producing a 500 error when the listing all domains and filtering by name 'default'.

The default domain has S3 configured.

pulp [da4add42-2e9c-4c30-8349-37c4ddeb945a]: django.request:ERROR: Internal Server Error: /api/pulp/default/api/v3/domains/
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/rest_framework/fields.py", line 439, in get_attribute
    return get_attribute(instance, self.source_attrs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/fields.py", line 104, in get_attribute
    instance = instance[attr]
KeyError: 'location'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/viewsets.py", line 124, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/mixins.py", line 43, in list
    return self.get_paginated_response(serializer.data)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 795, in data
    ret = super().data
  File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 249, in data
    self._data = self.to_representation(self.instance)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 713, in to_representation
    return [
  File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 714, in <listcomp>
    self.child.to_representation(item) for item in iterable
  File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 538, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "/usr/local/lib/python3.9/site-packages/pulpcore/app/serializers/domain.py", line 342, in to_representation
    return serializer.data
  File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 571, in data
    ret = super().data
  File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 249, in data
    self._data = self.to_representation(self.instance)
  File "/usr/local/lib/python3.9/site-packages/pulpcore/app/serializers/domain.py", line 46, in to_representation
    return super().to_representation(instance)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/serializers.py", line 525, in to_representation
    attribute = field.get_attribute(instance)
  File "/usr/local/lib/python3.9/site-packages/rest_framework/fields.py", line 472, in get_attribute
    raise type(exc)(msg)
KeyError: "Got KeyError when attempting to get a value for field `location` on serializer `FileSystemSettingsSerializer`.\nThe serializer field might be named incorrectly and not match any attribute or key on the `dict` instance.\nOriginal exception text was: 'location'."
('pulp [da4add42-2e9c-4c30-8349-37c4ddeb945a]: ::ffff:10.128.4.159 - contentsources [13/May/2024:08:05:19 +0000] "GET /api/pulp/default/api/v3/domains/?name=default HTTP/1.1" 500 145 "-" "OpenAPI-Generator/de24b382d968bd5ed3a4252b36e47596388ab51b7a98d596b8e3294aa65e495a/go"',)
@dkliban
Copy link
Member Author

dkliban commented May 13, 2024

The reason this worked before was because DEFAULT_FILE_STORAGE was being defined in setttings.py and now it is being specified as PULP_DEFAULT_FILE_STORAGE environment variable.

@dkliban
Copy link
Member Author

dkliban commented May 14, 2024

I filed a dynaconf issue dynaconf/dynaconf#1097

@decko
Copy link
Member

decko commented Jun 18, 2024

@dkliban weren't able to reproduce this in a dev environment. 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants