New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to a corrupt DB throws an exception #1994

Closed
LefterisJP opened this Issue Jul 29, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@LefterisJP
Collaborator

LefterisJP commented Jul 29, 2018

Problem Definition

If the DB is corrupt for some reason then raiden will throw an exception when trying to connect to it.

Traceback (most recent call last):                                                                                                                                                                                                                                              
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/lefteris/ew/raiden/raiden/__main__.py", line 15, in <module>
    main()
  File "/home/lefteris/ew/raiden/raiden/__main__.py", line 11, in main
    run(auto_envvar_prefix='RAIDEN')
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/lefteris/.virtualenvs/raiden/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/lefteris/ew/raiden/raiden/ui/cli.py", line 969, in run
    NodeRunner(kwargs, ctx).run()
  File "/home/lefteris/ew/raiden/raiden/ui/cli.py", line 825, in run
    app = self._run_app()
  File "/home/lefteris/ew/raiden/raiden/ui/cli.py", line 843, in _run_app
    app_ = run_app(**self._options)
  File "/home/lefteris/ew/raiden/raiden/ui/cli.py", line 671, in run_app
    discovery=discovery,
  File "/home/lefteris/ew/raiden/raiden/app.py", line 119, in __init__
    discovery=discovery,
  File "/home/lefteris/ew/raiden/raiden/raiden_service.py", line 216, in __init__
    self.start()
  File "/home/lefteris/ew/raiden/raiden/raiden_service.py", line 228, in start
    storage = sqlite.SQLiteStorage(self.database_path, serialize.PickleSerializer())
  File "/home/lefteris/ew/raiden/raiden/storage/sqlite.py", line 22, in __init__
    conn.executescript(DB_SCRIPT_CREATE_TABLES)                                                                                                                                                                                                                                 
sqlite3.DatabaseError: file is not a database                                                                                                                                                                                                                                   
Exception ignored in: <bound method SQLiteStorage.__del__ of <raiden.storage.sqlite.SQLiteStorage object at 0x7f7c5ba5af28>>                                                                                                                                                    
Traceback (most recent call last):
  File "/home/lefteris/ew/raiden/raiden/storage/sqlite.py", line 244, in __del__
    self.conn.close()
AttributeError: 'SQLiteStorage' object has no attribute 'conn'

Task

Print a proper error and quit Raiden. This is a Fatal error and will need manual intervention from the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment