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

Profiler page is always empty

Open manojsitapara opened this issue 4 years ago • 11 comments

Hi, I'm trying to use django-silk but unable to view any information on any page except summary page I followed all your instructions from "installation" docs section.

in my setting page SILKY_PYTHON_PROFILER = True SILKY_PYTHON_PROFILER_BINARY = True SILKY_ANALYZE_QUERIES = True

Added silk in app section 'silk'

Added middleware 'silk.middleware.SilkyMiddleware',

I am able to view data on summary page but when I click on any items on summary page it always give me blank page like below

image

following all urls page are empty

http://127.0.0.1:8000/silk/profiling/ http://127.0.0.1:8000/silk/requests/ http://127.0.0.1:8000/silk/cleardb/

In database I can see data is available for request id

f47428b3-cda2-4fc3-aedb-7d4c886d46cd

Can someone please help me if I am missing any step or doing something wrong?

manojsitapara avatar Aug 09 '21 10:08 manojsitapara

That is a known bug with Django 3.2 with the latest version of Django-Silk in Pypi

You can temporarily work around this by installing directly from github.

pip install git+https://github.com/jazzband/django-silk.git#egg=django-silk

Archmonger avatar Aug 26 '21 11:08 Archmonger

Closing due to a fix being in the master branch. Note: We are waiting for Jazzband project leads or roadies to create a pypi release for django-silk, until then you must install it through git.

Archmonger avatar Aug 27 '21 01:08 Archmonger

Thanks @Archmonger, I did install directly from from Github

pip install git+https://github.com/jazzband/django-silk.git#egg=django-silk

but having same issue

manojsitapara avatar Aug 27 '21 02:08 manojsitapara

What database are you using?

Have you verified your middleware placement is good?

Archmonger avatar Aug 27 '21 02:08 Archmonger

I am using postgresql databse.

Yes I did place middleware at correct place.

Let me post screenshot in sometime.

manojsitapara avatar Aug 27 '21 02:08 manojsitapara

Here is my middleware section, I tried to place at different places as well, but no luck

image

manojsitapara avatar Aug 27 '21 03:08 manojsitapara

Is your SILKY_PYTHON_PROFILER_RESULT_PATH getting populated with .prof files?

Archmonger avatar Aug 27 '21 04:08 Archmonger

Yes it is populated

image

Silk home page is display like this

image

but when I click any of the tab it always display like this

image

manojsitapara avatar Aug 27 '21 06:08 manojsitapara

I am also having the same problem. And it's still not solved with the django-slik update version. Can anyone help with this issue. I am using sqlite3 database, middleware, settings everythings as like documentation says but still stuck with this. @Archmonger

AyemunHossain avatar Feb 23 '22 08:02 AyemunHossain

Not sure what the cause of this is. I haven't been able to replicate it on my end.

Archmonger avatar Feb 23 '22 09:02 Archmonger

This is happening for me because no silk.models.Profile objects are being created AFAICT. However, the request .prof is created and available and this piece of code:

# silk/middleware.py
    def process_response(self, request, response):
        if getattr(request, 'silk_is_intercepted', False):
            while True:
                try:
                    self._process_response(request, response)
                except (AttributeError, DatabaseError):
                    Logger.debug('Retrying _process_response')
                    self._process_response(request, response)
                finally:
                    break
        return response

Does execute and call _process_response.

MrCocoDev avatar Mar 29 '22 18:03 MrCocoDev