Skip to content

410 Gone is not being processed correctly for non-existing or banned users #3552

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

Open
skobkin opened this issue Apr 17, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@skobkin
Copy link
Contributor

skobkin commented Apr 17, 2025

Describe the bug
410 Gone is not being processed correctly for non-existing or banned users.

To Reproduce
Steps to reproduce the behavior:

  1. Go to container logs.
  2. See a lot of errors

Expected behavior
Correct processing and avoiding requests for those users in the future.

Examples

web-1             | requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://wehavecookies.social/users/<redacted>
web-1             | Forbidden (Permission denied): /inbox
web-1             | Traceback (most recent call last):
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
web-1             |     response = get_response(request)
web-1             |                ^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
web-1             |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
web-1             |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
web-1             |     return self.dispatch(request, *args, **kwargs)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/utils/decorators.py", line 46, in _wrapper
web-1             |     return bound_method(*args, **kwargs)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
web-1             |     return view_func(*args, **kwargs)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
web-1             |     return handler(request, *args, **kwargs)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/app/bookwyrm/views/inbox.py", line 44, in post
web-1             |     raise_is_blocked_activity(activity_json)
web-1             |   File "/app/bookwyrm/views/inbox.py", line 93, in raise_is_blocked_activity
web-1             |     raise PermissionDenied()
web-1             | django.core.exceptions.PermissionDenied
web-1             | HTTP error - remote_id: https://octodon.social/users/angespielt - error: 410 Client Error: Gone for url: https://octodon.social/users/angespielt
web-1             | Traceback (most recent call last):
web-1             |   File "/app/bookwyrm/activitypub/base_activity.py", line 378, in resolve_remote_id
web-1             |     data = get_activitypub_data(remote_id)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/app/bookwyrm/activitypub/base_activity.py", line 437, in get_activitypub_data
web-1             |     resp.raise_for_status()
web-1             |   File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
web-1             |     raise HTTPError(http_error_msg, response=self)
web-1             | requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://octodon.social/users/<redacted>
web-1             | Forbidden (Permission denied): /inbox
web-1             | Traceback (most recent call last):
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
web-1             |     response = get_response(request)
web-1             |                ^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
web-1             |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
web-1             |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
web-1             |     return self.dispatch(request, *args, **kwargs)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/utils/decorators.py", line 46, in _wrapper
web-1             |     return bound_method(*args, **kwargs)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
web-1             |     return view_func(*args, **kwargs)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
web-1             |     return handler(request, *args, **kwargs)
web-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1             |   File "/app/bookwyrm/views/inbox.py", line 44, in post
web-1             |     raise_is_blocked_activity(activity_json)
web-1             |   File "/app/bookwyrm/views/inbox.py", line 93, in raise_is_blocked_activity
web-1             |     raise PermissionDenied()

Instance
b.skobk.in.

Additional context
Bookwyrm 0.7.5

@skobkin skobkin added the bug Something isn't working label Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant