sqlite3.OperationalError: database is locked

匿名 (未验证) 提交于 2019-12-02 23:38:02

情景描述

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     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

原因

sqlite3与smb的lock冲突

解决

mount -t cifs //192.168.1.121/coacs /opt/coacs -o username=username,password=password,nobrl
nobrl 表示不向服务器发送对 byte range lock 的请求。

文章来源: https://blog.csdn.net/whatday/article/details/90771723
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!