Skip to content

oscarsiles/jotlet django app does not work with Dragonfly #182

@oscarsiles

Description

@oscarsiles

I'm trying to test dragonfly on a Django + Channels project, but am getting the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 4073, in __call__
    return client.evalsha(self.sha, len(keys), *args)
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 3143, in evalsha
    return self.execute_command('EVALSHA', sha, numkeys, *keys_and_args)
  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.NoScriptError: No matching script. Please use EVAL.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 472, in thread_handler
    raise exc_info[1]
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = await get_response(request)
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 253, in _get_response_async
    response = await wrapped_callback(
  File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 435, in __call__
    ret = await asyncio.wait_for(future, timeout=None)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 408, in wait_for
    return await fut
  File "/usr/local/lib/python3.10/site-packages/asgiref/current_thread_executor.py", line 22, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 476, in thread_handler
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 84, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 119, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/edit.py", line 144, in get
    return self.render_to_response(self.get_context_data())
  File "/workspace/./boards/views.py", line 105, in get_context_data
    self.request.session.create()
  File "/usr/local/lib/python3.10/site-packages/django/contrib/sessions/backends/db.py", line 54, in create
    self.save(must_create=True)
  File "/usr/local/lib/python3.10/site-packages/django/contrib/sessions/backends/cached_db.py", line 54, in save
    super().save(must_create)
  File "/usr/local/lib/python3.10/site-packages/django/contrib/sessions/backends/db.py", line 85, in save
    with transaction.atomic(using=using):
  File "/usr/local/lib/python3.10/site-packages/cacheops/transaction.py", line 77, in __exit__
    self._no_monkey.__exit__(self, exc_type, exc_value, traceback)
  File "/usr/local/lib/python3.10/site-packages/cachalot/monkey_patch.py", line 179, in inner
    original(self, exc_type, exc_value, traceback)
  File "/usr/local/lib/python3.10/site-packages/django/db/transaction.py", line 299, in __exit__
    connection.set_autocommit(True)
  File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 450, in set_autocommit
    self.run_and_clear_commit_hooks()
  File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 692, in run_and_clear_commit_hooks
    func()
  File "/usr/local/lib/python3.10/site-packages/cacheops/transaction.py", line 30, in commit
    func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/funcy/decorators.py", line 66, in __call__
    return self._func(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/site-packages/cacheops/invalidation.py", line 32, in invalidate_dict
    load_script('invalidate')(keys=[prefix], args=[
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 4079, in __call__
    return client.evalsha(self.sha, len(keys), *args)
  File "/usr/local/lib/python3.10/site-packages/redis/client.py", line 3143, in evalsha
    return self.execute_command('EVALSHA', sha, numkeys, *keys_and_args)
  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.ResponseError: Error running script (call to 7473b25dd38dbe903434e05cfa843a3f40233dfb): @enable_strict_lua:17: user_script:4: Script attempted to access nonexistent global variable 'cjson'

To Reproduce
Steps to reproduce the behavior:

  1. Create Django project with redis cache
  2. Load a page that uses cache

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions