DatabaseError:数据库磁盘映像格式错误sqlite3

时间:2016-05-22 13:25:16

标签: python database process sqlite multiprocessing

我运行的代理服务器可以过滤客户端请求的域。 代理服务器通过包含域的sqlite本地数据库过滤这些请求,对于客户端发出的每个请求,代理查询数据库。

经过一些查询,我收到了这个错误:

Traceback (most recent call last):
  File "./proxy.py", line 582, in run
    self._process()
  File "./proxy.py", line 567, in _process
    if self._process_rlist(r):
  File "./proxy.py", line 535, in _process_rlist
    self._process_request(data)
  File "./proxy.py", line 426, in _process_request
    checking_url = DOMAINFILTER.SearchAll(site)  # DOMAINFILTER is the class that uses the database
  File "/root/PROXY/filterDomain.py", line 203, in SearchAll
    results_db = self.__local_db.find(url) # local_db is attribute of DOMAINFILTER and handles the connection to the database
  File "/root/PROXY/filterDomain.py", line 67, in find
    self.__cursor.execute(self.__statements["find_phish"], (url,)) # cursor is attribute of DOMAINFILTER and handles the cursor of the database
DatabaseError: database disk image is malformed
对于每个请求都是BTW,代理会创建新进程,完成后,进程就会终止。

注意:self.__statements["find_phish"]包含r"SELECT site FROM phishTBL WHERE url=?;"

0 个答案:

没有答案