Open abhinavsingh opened 1 month ago
Do you have a traceback? What is the redis server version?
KeyError: 'status'
File "django/db/models/options.py", line 681, in get_field
return self.fields_map[field_name]
FieldDoesNotExist: RedisServer has no field named 'status'
File "django/contrib/admin/utils.py", line 272, in lookup_field
f = _get_non_gfk_field(opts, name)
File "django/contrib/admin/utils.py", line 303, in _get_non_gfk_field
field = opts.get_field(name)
File "django/db/models/options.py", line 683, in get_field
raise FieldDoesNotExist(
TypeError: sequence item 0: expected str instance, int found
File "django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "django/core/handlers/base.py", line 220, in _get_response
response = response.render()
File "django/template/response.py", line 114, in render
self.content = self.rendered_content
File "django/template/response.py", line 92, in rendered_content
return template.render(context, self._request)
File "django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "elasticapm/instrumentation/packages/base.py", line 213, in call_if_sampling
return self.call(module, method, wrapped, instance, args, kwargs)
File "elasticapm/instrumentation/packages/django/template.py", line 46, in call
return wrapped(*args, **kwargs)
File "django/template/base.py", line 175, in render
return self._render(context)
File "django/template/base.py", line 167, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 966, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 157, in render
return compiled_parent._render(context)
File "django/template/base.py", line 167, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 966, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 157, in render
return compiled_parent._render(context)
File "django/template/base.py", line 167, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 966, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 157, in render
return compiled_parent._render(context)
File "django/template/base.py", line 167, in _render
return self.nodelist.render(context)
File "django/template/base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 966, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 63, in render
result = block.nodelist.render(context)
File "django/template/base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 966, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 63, in render
result = block.nodelist.render(context)
File "django/template/base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 966, in render_annotated
return self.render(context)
File "django/template/loader_tags.py", line 63, in render
result = block.nodelist.render(context)
File "django/template/base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
File "django/template/base.py", line 966, in render_annotated
return self.render(context)
File "django/contrib/admin/templatetags/base.py", line 45, in render
return super().render(context)
File "django/template/library.py", line 258, in render
_dict = self.func(*resolved_args, **resolved_kwargs)
File "django/contrib/admin/templatetags/admin_list.py", line 336, in result_list
"results": list(results(cl)),
File "django/contrib/admin/templatetags/admin_list.py", line 312, in results
yield ResultList(None, items_for_result(cl, res, None))
File "django/contrib/admin/templatetags/admin_list.py", line 303, in __init__
super().__init__(*items)
File "django/contrib/admin/templatetags/admin_list.py", line 213, in items_for_result
f, attr, value = lookup_field(field_name, result, cl.model_admin)
File "django/contrib/admin/utils.py", line 281, in lookup_field
value = attr(obj)
File "redisboard/admin.py", line 76, in status
return obj.stats.status
File "functools.py", line 1001, in __get__
val = self.func(instance)
File "redisboard/models.py", line 173, in stats
slowlog = conn.slowlog_get(num=REDISBOARD_SLOWLOG_NUM)
File "redis/commands/core.py", line 1320, in slowlog_get
return self.execute_command(*args, **kwargs)
File "elasticapm/instrumentation/packages/base.py", line 213, in call_if_sampling
return self.call(module, method, wrapped, instance, args, kwargs)
File "elasticapm/instrumentation/packages/redis.py", line 66, in call
return wrapped(*args, **kwargs)
Hi, our integration with django-redisboard went well in DEV. But as we pushed this to our non-DEV environments, we are observing weird
KeyError: 'status'
issues. Here is what I tried:1) Added a redis server with url as
redis://cloud-redis-gcp-memstore
.cloud-redis-gcp-memstore
is the same entry that we use for Django'sREDIS_HOST
variable. But this failed. Looks likeredisboard
wasn't able to reach this host, while Django could.2) Next, we added FQDN for
cloud-redis-gcp-memstore.namespace.svc.cluster.local
and it started working, but this time running intoKeyError: 'status'
. We also tried changing url to10.244.20.116
, internal IP over which redis is accessible, but we continue to getKeyError: 'status'
.It specifically errors out during
I am not sure if this issue is specific to Kubernetes environment in any ways. This worked out of box in DEV environment where redis url was simply
redis://127.0.0.1