database sqlite3.DatabaseError: database disk image is malformed

发布于 2022-09-05 08:54:30 字数 5777 浏览 15 评论 0

Process Process-5:
Traceback (most recent call last):
  File "/Users/zhangchuan/anaconda/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/Users/zhangchuan/anaconda/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/run.py", line 194, in scheduler
    kwargs = dict(taskdb=g.taskdb, projectdb=g.projectdb, resultdb=g.resultdb,
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/libs/utils.py", line 345, in __getattr__
    return ret.__get__(self, ObjectDict)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/libs/utils.py", line 332, in __get__
    return self.getter()
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/run.py", line 127, in <lambda>
    db, kwargs['data_path'], db[:-2])))
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/__init__.py", line 44, in connect_database
    db = _connect_database(url)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/__init__.py", line 99, in _connect_database
    return TaskDB(path)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/sqlite/taskdb.py", line 25, in __init__
    self._list_project()
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/sqlite/sqlitebase.py", line 53, in _list_project
    where='type = "table"'):
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/basedb.py", line 54, in _select
    for row in self._execute(sql_query, where_values):
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/basedb.py", line 37, in _execute
    dbcur.execute(sql_query, values)
sqlite3.DatabaseError: database disk image is malformed
Traceback (most recent call last):
  File "/Users/zhangchuan/anaconda/bin/pyspider", line 11, in <module>
    sys.exit(main())
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/run.py", line 754, in main
    cli()
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/run.py", line 165, in cli
    ctx.invoke(all)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/run.py", line 497, in all
    ctx.invoke(webui, **webui_config)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/run.py", line 336, in webui
    app.config['taskdb'] = g.taskdb
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/libs/utils.py", line 345, in __getattr__
    return ret.__get__(self, ObjectDict)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/libs/utils.py", line 332, in __get__
    return self.getter()
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/run.py", line 127, in <lambda>
    db, kwargs['data_path'], db[:-2])))
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/__init__.py", line 44, in connect_database
    db = _connect_database(url)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/__init__.py", line 99, in _connect_database
    return TaskDB(path)
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/sqlite/taskdb.py", line 25, in __init__
    self._list_project()
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/sqlite/sqlitebase.py", line 53, in _list_project
    where='type = "table"'):
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/basedb.py", line 54, in _select
    for row in self._execute(sql_query, where_values):
  File "/Users/zhangchuan/anaconda/lib/python3.6/site-packages/pyspider/database/basedb.py", line 37, in _execute
    dbcur.execute(sql_query, values)
sqlite3.DatabaseError: database disk image is malformed

使用pyspider爬去信息,突然断电,sqlite3崩溃了,无法再启动pyspider

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文