Guest User

Untitled

a guest
Feb 19th, 2018
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >>> from app.models import User, Post
  2. >>> u = User(username='john', email='john@example.com')
  3. >>> db.session.add(u)
  4. >>> db.session.commit()
  5. Traceback (most recent call last):
  6. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2138, in _wrap_pool_connect
  7. return fn()
  8. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 387, in connect
  9. return _ConnectionFairy._checkout(self)
  10. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 766, in _checkout
  11. fairy = _ConnectionRecord.checkout(pool)
  12. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 516, in checkout
  13. rec = pool._do_get()
  14. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 1229, in _do_get
  15. return self._create_connection()
  16. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 333, in _create_connection
  17. return _ConnectionRecord(self)
  18. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 461, in __init__
  19. self.__connect(first_connect_check=True)
  20. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 651, in __connect
  21. connection = pool._invoke_creator(self)
  22. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 105, in connect
  23. return dialect.connect(*cargs, **cparams)
  24. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 393, in connect
  25. return self.dbapi.connect(*cargs, **cparams)
  26. sqlite3.OperationalError: unable to open database file
  27.  
  28. The above exception was the direct cause of the following exception:
  29.  
  30. Traceback (most recent call last):
  31. File "<stdin>", line 1, in <module>
  32. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/scoping.py", line 157, in do
  33. return getattr(self.registry(), name)(*args, **kwargs)
  34. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 874, in commit
  35. self.transaction.commit()
  36. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 461, in commit
  37. self._prepare_impl()
  38. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 441, in _prepare_impl
  39. self.session.flush()
  40. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2139, in flush
  41. self._flush(objects)
  42. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2259, in _flush
  43. transaction.rollback(_capture_exception=True)
  44. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
  45. compat.reraise(exc_type, exc_value, exc_tb)
  46. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
  47. raise value
  48. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 2223, in _flush
  49. flush_context.execute()
  50. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 389, in execute
  51. rec.execute(self)
  52. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/unitofwork.py", line 548, in execute
  53. uow
  54. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 156, in save_obj
  55. base_mapper, states, uowtransaction
  56. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 279, in _organize_states_for_save
  57. states):
  58. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py", line 1094, in _connections_for_states
  59. connection = uowtransaction.transaction.connection(base_mapper)
  60. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 294, in connection
  61. return self._connection_for_bind(bind, execution_options)
  62. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 392, in _connection_for_bind
  63. conn = self._parent._connection_for_bind(bind, execution_options)
  64. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/orm/session.py", line 403, in _connection_for_bind
  65. conn = bind.contextual_connect()
  66. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2103, in contextual_connect
  67. self._wrap_pool_connect(self.pool.connect, None),
  68. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2142, in _wrap_pool_connect
  69. e, dialect, self)
  70. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1456, in _handle_dbapi_exception_noconnection
  71. exc_info
  72. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
  73. reraise(type(exception), exception, tb=exc_tb, cause=cause)
  74. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
  75. raise value.with_traceback(tb)
  76. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2138, in _wrap_pool_connect
  77. return fn()
  78. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 387, in connect
  79. return _ConnectionFairy._checkout(self)
  80. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 766, in _checkout
  81. fairy = _ConnectionRecord.checkout(pool)
  82. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 516, in checkout
  83. rec = pool._do_get()
  84. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 1229, in _do_get
  85. return self._create_connection()
  86. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 333, in _create_connection
  87. return _ConnectionRecord(self)
  88. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 461, in __init__
  89. self.__connect(first_connect_check=True)
  90. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/pool.py", line 651, in __connect
  91. connection = pool._invoke_creator(self)
  92. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 105, in connect
  93. return dialect.connect(*cargs, **cparams)
  94. File "/home/nathan/code/envs/nc/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 393, in connect
  95. return self.dbapi.connect(*cargs, **cparams)
  96. sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
RAW Paste Data