django-guardian icon indicating copy to clipboard operation
django-guardian copied to clipboard

content_object resolves to None (BaseObjectPermission)

Open ZuSe opened this issue 3 years ago • 2 comments

Hi guys,

we are seeing very weird behavior on our system that we can't explain.

If check the attached log you see that self.content_object is resolved as None. However the toString of the statement before clearly shows that it is None but probably set as part of the permission.

The bug is only occurring on our kubernetes cluster with multiple nodes. We have honestly no idea what could cause it. After debugging for several hours I open the ticket now in the hope that someone else ran into it. I will keep you updated as soon as find out sth.

Environment:

  • Python 3.9.5
  • gunicorn 20.1.0 with uvicorn 0.13.4 (asgi3)
  • Postgres 13.3
  • Django 3.2

image

ZuSe avatar May 21 '21 14:05 ZuSe

I have the same problem. Using pdb to debug, I found self.content_object was None at begining, after a moment, it's not None

wecom-temp-d36ce051133a8394d2860255e61b360c

misoomang avatar Mar 01 '22 15:03 misoomang

Can it be the case that the referred objects was deleted?

https://github.com/django/django/commit/1a82fc245eb8ac4b131ec02a6ac3e112deb8d5a6

kmmbvnr avatar May 08 '24 03:05 kmmbvnr