sqlite3.OperationalError: database is locked

情景描述

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 的请求。

相关文章

功能概要:(目前已实现功能)公共展示部分:1.网站首页展示...
大体上把Python中的数据类型分为如下几类: Number(数字) ...
开发之前第一步,就是构造整个的项目结构。这就好比作一幅画...
源码编译方式安装Apache首先下载Apache源码压缩包,地址为ht...
前面说完了此项目的创建及数据模型设计的过程。如果未看过,...
python中常用的写爬虫的库有urllib2、requests,对于大多数比...