sqlite3.OperationalError: database is locked

妙音 posted @ 2018年6月24日 07:12 in sqlite , 183 阅读
  • 情景描述
windows上的代码文件,设置为共享目录,mount到linux使用。运行python manage.py migrate命令,出现错误
  • 报错
[root@localhost sqlalchemy]# python manage.py db migrate
/root/py_env/coacs/lib/python3.6/site-packages/flask_sqlalchemy/__init__.py:794: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.
  'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Traceback (most recent call last):
  File "/root/py_env/coacs/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
  File "/root/py_env/coacs/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 508, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: database is locked
  • 原因
  • 解决
sudo mount -t cifs // /opt/coacs -o username=wyq,password=sprite,vers=1.0,nobrl
nobrl 表示不向服务器发送对 byte range lock 的请求。


登录 *

loading captcha image...
or Ctrl+Enter