itscontained / automarkwatched

A web application for marking TV shows as watched/unwatched for Plex Media Server
7 stars 1 forks source link

Settings - 500 Error #1

Closed Animosity022 closed 6 years ago

Animosity022 commented 6 years ago

I got the homepage to start up and when I click on the settings I get:


Request Method: | GET
-- | --
http://192.168.1.30:8001/settings
2.0.4
IndexError
list index out of range
/usr/local/lib/python3.6/site-packages/django/db/models/query.py in __getitem__, line 307
/usr/bin/python3
3.6.4
['/data/AutoMarkWatched',  '/usr/lib64/python36.zip',  '/usr/lib64/python3.6',  '/usr/lib64/python3.6/lib-dynload',  '/usr/local/lib/python3.6/site-packages',  '/usr/lib64/python3.6/site-packages',  '/usr/lib/python3.6/site-packages']
Wed, 4 Apr 2018 23:16:35 +0000
dirtycajunrice commented 6 years ago

Can you turn debug on in settings.py and give me the output at the top of the page? i need to see what list it cant see

Animosity022 commented 6 years ago

Is this enough?

image

dirtycajunrice commented 6 years ago

Ah it isnt showing it at the top. Follow the traceback till you get to a bold row. (dropdown the arrow too)

Animosity022 commented 6 years ago

Ah.

image

Animosity022 commented 6 years ago

Here is the full paste:

Environment:

Request Method: GET
Request URL: http://192.168.1.30:8001/settings

Django Version: 2.0.4
Python Version: 3.6.4
Installed Applications:
['amw.apps.AmwConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  35.             response = get_response(request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  128.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  126.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py" in view
  69.             return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch
  89.         return handler(request, *args, **kwargs)

File "/data/AutoMarkWatched/amw/views.py" in get
  46.         print(ServerInfo.objects.all()[0])

File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py" in __getitem__
  307.         return qs._result_cache[0]

Exception Type: IndexError at /settings
Exception Value: list index out of range
dirtycajunrice commented 6 years ago

I think I fixed it. Was a print i had for testing output. git pull and try again for me

dirtycajunrice commented 6 years ago

side note. I added the management command examples to the README so you can have it run automatically

Animosity022 commented 6 years ago

Hmm. Did a git pull and restarted it and getting the same thing.

^C[felix@gemini AutoMarkWatched]$ git pull
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 20 (delta 12), reused 15 (delta 8), pack-reused 0
Unpacking objects: 100% (20/20), done.
From https://github.com/DirtyCajunRice/AutoMarkWatched
   32867c1..16d6630  master     -> origin/master
Updating 32867c1..16d6630
Fast-forward
 README.md                              | 11 +++++++++++
 amw/management/commands/filltable.py   | 15 +++++++++++++++
 amw/management/commands/markwatched.py | 15 +++++++++++++++
 amw/management/commands/synctvdb.py    | 15 +++++++++++++++
 amw/views.py                           |  1 -
 5 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 amw/management/commands/filltable.py
 create mode 100644 amw/management/commands/markwatched.py
 create mode 100644 amw/management/commands/synctvdb.py
[felix@gemini AutoMarkWatched]$ python3 manage.py runserver 0:8001

Same error I think:

Environment:

Request Method: GET
Request URL: http://192.168.1.30:8001/settings

Django Version: 2.0.4
Python Version: 3.6.4
Installed Applications:
['amw.apps.AmwConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  35.             response = get_response(request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  128.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  126.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py" in view
  69.             return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch
  89.         return handler(request, *args, **kwargs)

File "/data/AutoMarkWatched/amw/views.py" in get
  49.             'serverinfo': ServerInfo.objects.all()[0]

File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py" in __getitem__
  307.         return qs._result_cache[0]

Exception Type: IndexError at /settings
Exception Value: list index out of range
dirtycajunrice commented 6 years ago

Ok. pull and try again for me.

context = {
            'form': form,
            'tvshows': TVShow.objects.all(),
            'serverinfo': ServerInfo.objects.all()[0]
        }

the serverinfo context was expecting the list to be populated.

Animosity022 commented 6 years ago

Good. Working now. Thanks! No more Judge Judy in my feed.

dirtycajunrice commented 6 years ago

Hahahah. Nice. Thanks for helping make it better!