SOLVED After server reboot, Sickrage fails to start with 'base-url' not defined

Status
Not open for further replies.

pclausen

Patron
Joined
Apr 19, 2015
Messages
267
So I took my FreeNAS box down to upgrade the CPU. It all went well and it came right back up and my Emby and transmission plugs started up and are running fine, but Sickrage did not. I tried using the button in the FreeNAS gui to start it, but it failed. Restarted the Sickrage jail, still nothing.

So I tried to start if from the command line and got this:

Code:
root@sickrage_1:/usr/pbi/sickrage-amd64/share/sickrage/SickRage/sickbeard/providers # service sickrage start
Starting sickrage.
Traceback (most recent call last):
  File "/usr/pbi/sickrage-amd64/share/sickrage/SickRage/SickBeard.py", line 58, in <module>
    import sickbeard
  File "/usr/pbi/sickrage-amd64/share/sickrage/SickRage/sickbeard/__init__.py", line 37, in <module>
    from sickbeard import providers
  File "/usr/pbi/sickrage-amd64/share/sickrage/SickRage/sickbeard/providers/__init__.py", line 19, in <module>
    from sickbeard.providers import btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, torrentz, \
  File "/usr/pbi/sickrage-amd64/share/sickrage/SickRage/sickbeard/providers/kat.py", line 184, in <module>
    provider = KATProvider()
  File "/usr/pbi/sickrage-amd64/share/sickrage/SickRage/sickbeard/providers/kat.py", line 52, in __init__
    'search': base_url + '%s/',
NameError: global name 'base_url' is not defined
/usr/local/etc/rc.d/sickrage: WARNING: failed to start sickrage
root@sickrage_1:/usr/pbi/sickrage-amd64/share/sickrage/SickRage/sickbeard/providers #


Here are the lines from the kat.py file:

Code:
# coding=utf-8
# Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SickRage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SickRage.  If not, see <http://www.gnu.org/licenses/>.


import traceback

from urllib import urlencode

import xmltodict
import HTMLParser

import sickbeard
from sickbeard import logger
from sickbeard import tvcache
from sickbeard.common import USER_AGENT
from sickbeard.providers import generic
from xml.parsers.expat import ExpatError

class KATProvider(generic.TorrentProvider):
    def __init__(self):

        generic.TorrentProvider.__init__(self, "KickAssTorrents")

        self.supportsBacklog = True
        self.public = True

        self.confirmed = True
        self.ratio = None
        self.minseed = None
        self.minleech = None

        self.cache = KATCache(self)

        self.urls = {
            'base_url': 'https://kickass.unblocked.la/',
            'search': base_url + '%s/',
        }

        self.url = self.urls['base_url']
        self.headers.update({'User-Agent': USER_AGENT})

        self.search_params = {
            'q': '',
            'field': 'seeders',
            'sorder': 'desc',
            'rss': 1,
            'category': 'tv'
        }


Any ideas?
 
Joined
Aug 25, 2011
Messages
8
Fixed it by editing kat.py line
'search': base_url + '%s/',
should look like
'search': 'base_url' + '%s/',
after that sick rage starts and successfully updates
 

pclausen

Patron
Joined
Apr 19, 2015
Messages
267
Awesome! That fixed me right up..
 
Joined
Nov 5, 2015
Messages
1
I also ran into this same issue and fixed by using the following to fetch what I'm assuming is the latest version and copying it into the correct directories.
I just SSH'd into freenas and used these commands:

jls #use this command to find the jail number for your sickrage jail
jexec <sickrage jail number> tcsh
#from inside the sickrage jail
service sickrage stop
rm -r /usr/pbi/sickrage-amd64/share/sickrage/SickRage
fetch --no-verify-peer "https://github.com/SiCKRAGETV/SickRage/archive/master.tar.gz"
tar xzf master.tar.gz
mv SickRage-master /usr/pbi/sickrage-amd64/share/sickrage/SickRage
chown -R media:media /usr/pbi/sickrage-amd64/share/sickrage/SickRage
rm master.tar.gz
service sickrage start​

This could be useful if there is an update that possibly broke the service and it needs to be updated within the jail from the command line manually.
 
  • Like
Reactions: Maq
Status
Not open for further replies.
Top