SickRage Service Does Not Start

Hello,

My Sickrage stopped working suddenly, approximately yesterday evening at about 18h30 Local Time (GMT +2)

When I try run it manually from a command line, I get this:
Traceback (most recent call last):

  • File “C:\Program Files (x86)\Python 3.7\lib\site-packages\requests_oauthlib\oauth2_session.py”, line 395, in request*
  • http_method=method, body=data, headers=headers)*
  • File “C:\Program Files (x86)\Python 3.7\lib\site-packages\oauthlib\oauth2\rfc6749\clients\base.py”, line 198, in add_token*
  • raise TokenExpiredError()*
    oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  • File “D:\SiCKRAGE\sickrage_init_.py”, line 356, in main*
  • app.start()*
  • File “D:\SiCKRAGE\sickrage\core_init_.py”, line 234, in start*
  • self.config.load()*
  • File “D:\SiCKRAGE\sickrage\core\config.py”, line 1857, in load*
  • sickrage.app.search_providers.load()*
  • File “D:\SiCKRAGE\sickrage\providers_init_.py”, line 1282, in load*
  • self[TorrentProvider.type] = dict([(p.id, p) for p in TorrentProvider.get_providers()])*
  • File “D:\SiCKRAGE\sickrage\providers_init_.py”, line 725, in get_providers*
  • return super(TorrentProvider, cls).load_providers(cls.type)*
  • File “D:\SiCKRAGE\sickrage\providers_init_.py”, line 553, in load_providers*
  • providers += [klass()]*
  • File “D:\SiCKRAGE\sickrage\providers\torrent\hdspace.py”, line 51, in init*
  • self.urls[‘search’] += str(cat) + ‘%%3B’*
  • File “D:\SiCKRAGE\sickrage\providers_init_.py”, line 111, in urls*
  • resp = ProviderAPI().get_urls(self.id)*
  • File “D:\SiCKRAGE\sickrage\core\api\provider_init_.py”, line 28, in get_urls*
  • return self._request(‘GET’, query)*
  • File “D:\SiCKRAGE\sickrage\core\api_init_.py”, line 85, in _request*
  • resp = self.session.request(method, urljoin(self.api_url, url), timeout=timeout, hooks={‘response’: self.throttle_hook}, *kwargs)
  • File “C:\Program Files (x86)\Python 3.7\lib\site-packages\requests_oauthlib\oauth2_session.py”, line 408, in request*
  • self.auto_refresh_url, auth=auth, *kwargs
  • File “C:\Program Files (x86)\Python 3.7\lib\site-packages\requests_oauthlib\oauth2_session.py”, line 374, in refresh_token*
  • self.token = self._client.parse_request_body_response(r.text, scope=self.scope)*
  • File “C:\Program Files (x86)\Python 3.7\lib\site-packages\oauthlib\oauth2\rfc6749\clients\base.py”, line 421, in parse_request_body_response*
  • self.token = parse_token_response(body, scope=scope)*
  • File “C:\Program Files (x86)\Python 3.7\lib\site-packages\oauthlib\oauth2\rfc6749\parameters.py”, line 431, in parse_token_response*
  • validate_token_parameters(params)*
  • File “C:\Program Files (x86)\Python 3.7\lib\site-packages\oauthlib\oauth2\rfc6749\parameters.py”, line 438, in validate_token_parameters*
  • raise_from_error(params.get(‘error’), params)*
  • File “C:\Program Files (x86)\Python 3.7\lib\site-packages\oauthlib\oauth2\rfc6749\errors.py”, line 405, in raise_from_error*
  • raise cls(*kwargs)
    oauthlib.oauth2.rfc6749.errors.InvalidGrantError: (invalid_grant) Offline user session not found

Some kind of OAuth session error?
As I recall the Authentication server was moved but my install has worked fine on that new server until last night.

Any ideas as to what I can do?
Details: SickRage on Windows 10 x64, Python 3.7

Could you please email me you’re cache.db, main.db, config.ini, privatekey.pem, and token.json files to [email protected] so I can try and re-create the issue on my end and work a solution.

If the OAuth2 token expires which looks like it has in this situation you should still be able to log into the web-ui which would trigger issuing a new OAuth2 token and resolve this.

Hi,
Thanks for the reply.

I will send you the files from my D: installation, the one that does not start.

Should I try a new install to default location with latest installer and copy over the db files and see if I have any joy?

Could just be you’re install is also not on the latest version, what does version.txt contents read ?

Version.txt is 9.4.193

Latest version is 9.4.194 so explains why its cutting out right now, i’ll compile a newer windows installer to resolve the issue and post it

Thanks. Really Appreciate it.

It’ll most likely be tomorrow as I’m dead tired tonight and need to put a fix together for another bug related to a torrent client as well.

Cool Man.
Oh and I’ve done some experimenting on my side.
First un-install the old install and put in a new one from the latest installer on C:
Then the service powers up and I can see on the GUI an empty install.
Then try restore an old config backup from the older install.
and I get this:
“C:\Program Files (x86)\Python 3.7\python.exe” “C:\SiCKRAGE\SiCKRAGE.py” --datadir=“C:\SickRage\Data”
08:27:00 INFO::CORE::Restoring SiCKRAGE backup: SUCCESSFUL!
08:27:00 INFO::CORE::Loading encrypted config from disk
Traceback (most recent call last):
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\engine\base.py”, line 1244, in _execute_context
cursor, statement, parameters, context
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\engine\default.py”, line 552, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: oauth2_token

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “C:\SiCKRAGE\sickrage_init_.py”, line 356, in main
app.start()
File “C:\SiCKRAGE\sickrage\core_init_.py”, line 235, in start
self.config.load()
File “C:\SiCKRAGE\sickrage\core\config.py”, line 1850, in load
sickrage.app.search_providers.load()
File “C:\SiCKRAGE\sickrage\providers_init_.py”, line 1282, in load
self[TorrentProvider.type] = dict([(p.id, p) for p in TorrentProvider.get_providers()])
File “C:\SiCKRAGE\sickrage\providers_init_.py”, line 725, in get_providers
return super(TorrentProvider, cls).load_providers(cls.type)
File “C:\SiCKRAGE\sickrage\providers_init_.py”, line 553, in load_providers
providers += [klass()]
File “C:\SiCKRAGE\sickrage\providers\torrent\hdspace.py”, line 51, in init
self.urls[‘search’] += str(cat) + ‘%%3B’
File “C:\SiCKRAGE\sickrage\providers_init_.py”, line 111, in urls
resp = ProviderAPI().get_urls(self.id)
File “C:\SiCKRAGE\sickrage\core\api\provider_init_.py”, line 28, in get_urls
return self.request(‘GET’, query)
File "C:\SiCKRAGE\sickrage\core\api_init
.py", line 78, in request
resp = self.session.request(method, urljoin(self.api_url, url), timeout=timeout, hooks={‘response’: self.throttle_hook}, **kwargs)
File "C:\SiCKRAGE\sickrage\core\api_init
.py", line 32, in session
return OAuth2Session(token=self.token,
File “C:\SiCKRAGE\sickrage\core\databases_init_.py”, line 147, in wrapper
return func(*args, **kwargs)
File “C:\SiCKRAGE\sickrage\core\api_init_.py”, line 41, in token
token = session.query(CacheDB.OAuth2Token).one()
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\orm\query.py”, line 3275, in one
ret = self.one_or_none()
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\orm\query.py”, line 3244, in one_or_none
ret = list(self)
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\orm\query.py”, line 3317, in iter
return self._execute_and_instances(context)
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\orm\query.py”, line 3342, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\engine\base.py”, line 988, in execute
return meth(self, multiparams, params)
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\sql\elements.py”, line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\engine\base.py”, line 1107, in _execute_clauseelement
distilled_params,
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\engine\base.py”, line 1248, in _execute_context
e, statement, parameters, cursor, context
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\engine\base.py”, line 1466, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\util\compat.py”, line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\util\compat.py”, line 128, in reraise
raise value.with_traceback(tb)
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\engine\base.py”, line 1244, in _execute_context
cursor, statement, parameters, context
File “C:\Program Files (x86)\Python 3.7\lib\site-packages\sqlalchemy\engine\default.py”, line 552, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: oauth2_token
[SQL: SELECT oauth2_token.id AS oauth2_token_id, oauth2_token.access_token AS oauth2_token_access_token, oauth2_token.refresh_token AS oauth2_token_refresh_token, oauth2_token.expires_in AS oauth2_token_expires_in, oauth2_token.expires_at AS oauth2_token_expires_at, oauth2_token.scope AS oauth2_token_scope
FROM oauth2_token]
(Background on this error at: http://sqlalche.me/e/e3q8)

I’m thinking there’s a DB difference somewhere between versions?
In any event thought you’d find the above useful in diagnosing the issue.

Thanks for all your hard work and hear from you later.

Can you email me the old backup you tried please ?
Also just pushed new Windows installer out.

OK, I was able to reproduce the bug, oddly seems to only happen if restored from web-ui but does not happen if backup is decompressed into data folder and app is then started.

Looking further into this and will reply back tomorrow, going to bed now, thanks for all the help on this.

1 Like

Actually I was able to fix it quicker then I thought, pushing fix now to both branches, please test after updating and let me know if this issue is resolved.

Thanks!

1 Like

Mine seems to be stuck in a loop. Tried to uninstall and reinstall both sickrage and python.

Looking at the log it shows the below:

2020-01-09 11:28:48 INFO::CORE::Performing migrations on cache database
2020-01-09 11:28:48 INFO::CORE::Performing sync on cache database
2020-01-09 11:28:57 INFO::CORE::Performing disk space checks
2020-01-09 11:28:57 INFO::CORE::Performing integrity check on main database
2020-01-09 11:28:57 INFO::CORE::Performing migrations on main database
2020-01-09 11:28:57 INFO::CORE::Performing sync on main database
2020-01-09 11:28:57 INFO::CORE::Performing cleanup on main database
2020-01-09 11:28:57 INFO::CORE::Performing integrity check on cache database
2020-01-09 11:28:57 INFO::CORE::Performing migrations on cache database
2020-01-09 11:28:57 INFO::CORE::Performing sync on cache database
2020-01-09 11:29:07 INFO::CORE::Performing disk space checks
2020-01-09 11:29:07 INFO::CORE::Performing integrity check on main database
2020-01-09 11:29:07 INFO::CORE::Performing migrations on main database
2020-01-09 11:29:07 INFO::CORE::Performing sync on main database
2020-01-09 11:29:07 INFO::CORE::Performing cleanup on main database
2020-01-09 11:29:07 INFO::CORE::Performing integrity check on cache database
2020-01-09 11:29:07 INFO::CORE::Performing migrations on cache database
2020-01-09 11:29:07 INFO::CORE::Performing sync on cache database
2020-01-09 11:29:16 INFO::CORE::Performing disk space checks
2020-01-09 11:29:16 INFO::CORE::Performing integrity check on main database
2020-01-09 11:29:16 INFO::CORE::Performing migrations on main database
2020-01-09 11:29:16 INFO::CORE::Performing sync on main database
2020-01-09 11:29:16 INFO::CORE::Performing cleanup on main database
2020-01-09 11:29:16 INFO::CORE::Performing integrity check on cache database
2020-01-09 11:29:16 INFO::CORE::Performing migrations on cache database
2020-01-09 11:29:16 INFO::CORE::Performing sync on cache database
2020-01-09 11:29:25 INFO::CORE::Performing disk space checks
2020-01-09 11:29:25 INFO::CORE::Performing integrity check on main database
2020-01-09 11:29:25 INFO::CORE::Performing migrations on main database
2020-01-09 11:29:25 INFO::CORE::Performing sync on main database
2020-01-09 11:29:25 INFO::CORE::Performing cleanup on main database
2020-01-09 11:29:25 INFO::CORE::Performing integrity check on cache database
2020-01-09 11:29:25 INFO::CORE::Performing migrations on cache database
2020-01-09 11:29:25 INFO::CORE::Performing sync on cache database

I’ve just tried that “Decompress Backup into data folder” and that seems to have worked.
I can login in again.

I will also test your new fix / build when it’s available.

I’m pushing a new fix to master branch, v9.4.195
Please test it once its out and let me know if its resolved you’re issues.

1 Like

It works. Thanks ! :slight_smile:

I seem to have mine in this loop as well for a.few days now. How did you get out of the loop? Just with the update or something else?

Ok managed to sort this mostly now, had to delete the sickrage folder completely, then install and restore from a backup from December. Right now my downloads look a bit messed up but I’m hoping a rescan will sorry that out