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

  • 解决
sudo mount -t cifs //192.168.1.121/coacs /opt/coacs -o username=username,password=password,vers=1.0,nobrl


nobrl 表示不向服务器发送对 byte range lock 的请求。


《寿康宝鉴》有声书
寿康宝鉴百话有声书(mp3)
百度网盘  https://pan.baidu.com/s/1rs5k7RTB9DxgdCuG-mSzog  密码 9lf1


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值