Git Product home page Git Product logo

Comments (4)

milesmcc avatar milesmcc commented on June 21, 2024

@kashalls thanks for the report. Are we good to close this issue now that #287 is merged in?

Btw, if you'd like to submit a PR documenting Sentinel cache support (following the change in #287) that would be quite helpful (as right now Shynet users may not know that support exists without finding this issue/reading the code).

from shynet.

kashalls avatar kashalls commented on June 21, 2024

Btw, if you'd like to submit a PR documenting Sentinel cache support (following the change in #287) that would be quite helpful (as right now Shynet users may not know that support exists without finding this issue/reading the code).

I'll work on it this weekend, thanks for reminding me.

from shynet.

kashalls avatar kashalls commented on June 21, 2024

Okay so it looks like the issue is a lot bigger than I initially thought it would be.

I didn't notice until today that this happened on the frontend side:

Performing startup checks...
Database is ready to go.
Startup checks complete!
Launching Shynet web server...
[2023-09-24 22:11:16 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2023-09-24 22:11:16 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2023-09-24 22:11:16 +0000] [1] [INFO] Using worker: sync
[2023-09-24 22:11:16 +0000] [9] [INFO] Booting worker with pid: 9
ERROR Internal Server Error: /accounts/login/
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.10/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.10/site-packages/django/views/generic/base.py", line 103, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/utils/decorators.py", line 46, in _wrapper
    return bound_method(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/decorators/debug.py", line 92, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/views.py", line 146, in dispatch
    return super(LoginView, self).dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/views.py", line 74, in dispatch
    response = super(RedirectAuthenticatedUserMixin, self).dispatch(
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 142, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/views.py", line 101, in post
    if form.is_valid():
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 205, in is_valid
    return self.is_bound and not self.errors
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 200, in errors
    self.full_clean()
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 438, in full_clean
    self._clean_form()
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 459, in _clean_form
    cleaned_data = self.clean()
  File "/usr/local/lib/python3.10/site-packages/allauth/account/forms.py", line 177, in clean
    user = get_adapter(self.request).authenticate(self.request, **credentials)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/adapter.py", line 511, in authenticate
    self._delete_login_attempts_cached_email(request, **credentials)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/adapter.py", line 483, in _delete_login_attempts_cached_email
    cache.delete(cache_key)
  File "/usr/local/lib/python3.10/site-packages/redis_cache/backends/base.py", line 30, in wrapped
    return method(self, client, key, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/redis_cache/backends/base.py", line 287, in delete
    return client.delete(key)
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 1567, in delete
    return self.execute_command('DEL', *names)
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 901, in execute_command
    return self.parse_response(conn, command_name, **options)
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 915, in parse_response
    response = connection.read_response()
  File "/usr/local/lib/python3.10/site-packages/redis/connection.py", line 756, in read_response
    raise response
redis.exceptions.ReadOnlyError: You can't write against a read only replica.
Internal Server Error: /accounts/login/
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.10/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.10/site-packages/django/views/generic/base.py", line 103, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/utils/decorators.py", line 46, in _wrapper
    return bound_method(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/decorators/debug.py", line 92, in sensitive_post_parameters_wrapper
    return view(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/views.py", line 146, in dispatch
    return super(LoginView, self).dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/views.py", line 74, in dispatch
    response = super(RedirectAuthenticatedUserMixin, self).dispatch(
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 142, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/views.py", line 101, in post
    if form.is_valid():
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 205, in is_valid
    return self.is_bound and not self.errors
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 200, in errors
    self.full_clean()
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 438, in full_clean
    self._clean_form()
  File "/usr/local/lib/python3.10/site-packages/django/forms/forms.py", line 459, in _clean_form
    cleaned_data = self.clean()
  File "/usr/local/lib/python3.10/site-packages/allauth/account/forms.py", line 177, in clean
    user = get_adapter(self.request).authenticate(self.request, **credentials)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/adapter.py", line 511, in authenticate
    self._delete_login_attempts_cached_email(request, **credentials)
  File "/usr/local/lib/python3.10/site-packages/allauth/account/adapter.py", line 483, in _delete_login_attempts_cached_email
    cache.delete(cache_key)
  File "/usr/local/lib/python3.10/site-packages/redis_cache/backends/base.py", line 30, in wrapped
    return method(self, client, key, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/redis_cache/backends/base.py", line 287, in delete
    return client.delete(key)
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 1567, in delete
    return self.execute_command('DEL', *names)
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 901, in execute_command
    return self.parse_response(conn, command_name, **options)
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 915, in parse_response
    response = connection.read_response()
  File "/usr/local/lib/python3.10/site-packages/redis/connection.py", line 756, in read_response
    raise response
redis.exceptions.ReadOnlyError: You can't write against a read only replica.

So it seems DJANGO needs to be fixed to allow support for it.

The pr #287 did not fix it at all because even though json.loads can import the json from the environment variable, I think it converts it into a dict class and even though you can have nested dict's it still complains about ValueError: dictionary update sequence element #0 has length 1; 2 is required in celery when combining the default options.

Basically the options in settings.py needs to be set like this:
CELERY_BROKER_TRANSPORT_OPTIONS = { 'master_name': 'redis-master' }
and not:
CELERY_BROKER_TRANSPORT_OPTIONS: "{'master_name': 'redis-master'}"

from shynet.

kashalls avatar kashalls commented on June 21, 2024

This is starting to become outside of my knowledge, and will likely require outside help to patch this.

from shynet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.