database sqlite3.DatabaseError: database disk image is malformed
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https://stackoverflow.com/a/5...