我最近尝试切换我上传备份的 Google Drive,但现在备份实用程序 (deja-dup) 无法正常工作。当我尝试进行备份时,它会扫描,然后超时
Giving up after 5 attempts. timeout: The read operation timed out
我该如何排除故障和调试?我尝试删除所有在线帐户并添加我想使用的新 Google 帐户。(Google 和 ubuntu 帐户)我还尝试重新安装duplicity
和,并重置 deja-dup 的所有设置。到目前为止,没有任何效果,当我从终端deja-dup
运行时没有任何错误消息。deja-dup
编辑1:
按照 codlord 的建议,我使用 set 运行了 deja dup DEJA_DUP_DEBUG
。以下是日志输出:
....
DUPLICITY: INFO 1
DUPLICITY: . Added incremental Backupset (start_time: Thu Nov 5 07:57:24 2020 / end_time: Thu Nov 12 08:05:49 2020)
DUPLICITY: DEBUG 1
DUPLICITY: . Added set Thu Nov 12 08:05:49 2020 to pre-existing chain [Thu Aug 20 18:47:31 2020]-[Thu Nov 12 08:05:49 2020]
DUPLICITY: NOTICE 1
DUPLICITY: . Synchronizing remote metadata to local cache...
DUPLICITY: NOTICE 1
DUPLICITY: . Copying duplicity-full-signatures.20200821T014731Z.sigtar.gz to local cache.
DUPLICITY: DEBUG 1
DUPLICITY: . Registering (mktemp) temporary file /tmp/duplicity-2izahox3-tempdir/mktemp-aww0pdv8-2
DUPLICITY: INFO 1
DUPLICITY: . PyDrive backend: found file 'duplicity-full-signatures.20200821T014731Z.sigtar.gz' with id 135UZSkFvRDv7egAogXy6MYaHiH3iopqN on server, adding to cache
DUPLICITY: DEBUG 1
DUPLICITY: . Backtrace of previous error: Traceback (innermost last):
DUPLICITY: . File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 376, in inner_retry
DUPLICITY: . return fn(self, *args)
DUPLICITY: . File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 570, in get
DUPLICITY: . self.backend._get(remote_filename, local_path)
DUPLICITY: . File "/usr/lib/python3/dist-packages/duplicity/backends/pydrivebackend.py", line 186, in _get
DUPLICITY: . drive_file.GetContentFile(util.fsdecode(local_path.name))
DUPLICITY: . File "/usr/lib/python3/dist-packages/pydrive/files.py", line 210, in GetContentFile
DUPLICITY: . self.FetchContent(mimetype, remove_bom)
DUPLICITY: . File "/usr/lib/python3/dist-packages/pydrive/files.py", line 43, in _decorated
DUPLICITY: . return decoratee(self, *args, **kwargs)
DUPLICITY: . File "/usr/lib/python3/dist-packages/pydrive/files.py", line 255, in FetchContent
DUPLICITY: . self.content = io.BytesIO(self._DownloadFromUrl(download_url))
DUPLICITY: . File "/usr/lib/python3/dist-packages/pydrive/auth.py", line 75, in _decorated
DUPLICITY: . return decoratee(self, *args, **kwargs)
DUPLICITY: . File "/usr/lib/python3/dist-packages/pydrive/files.py", line 503, in _DownloadFromUrl
DUPLICITY: . resp, content = self.http.request(url)
DUPLICITY: . File "/usr/lib/python3/dist-packages/oauth2client/transport.py", line 173, in new_request
DUPLICITY: . resp, content = request(orig_request_method, uri, method, body,
DUPLICITY: . File "/usr/lib/python3/dist-packages/oauth2client/transport.py", line 280, in request
DUPLICITY: . return http_callable(uri, method=method, body=body, headers=headers,
DUPLICITY: . File "/home/grant/.local/lib/python3.8/site-packages/httplib2/__init__.py", line 1985, in request
DUPLICITY: . (response, content) = self._request(
DUPLICITY: . File "/home/grant/.local/lib/python3.8/site-packages/httplib2/__init__.py", line 1650, in _request
DUPLICITY: . (response, content) = self._conn_request(
DUPLICITY: . File "/home/grant/.local/lib/python3.8/site-packages/httplib2/__init__.py", line 1589, in _conn_request
DUPLICITY: . response = conn.getresponse()
DUPLICITY: . File "/usr/lib/python3.8/http/client.py", line 1347, in getresponse
DUPLICITY: . response.begin()
DUPLICITY: . File "/usr/lib/python3.8/http/client.py", line 307, in begin
DUPLICITY: . version, status, reason = self._read_status()
DUPLICITY: . File "/usr/lib/python3.8/http/client.py", line 268, in _read_status
DUPLICITY: . line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
DUPLICITY: . File "/usr/lib/python3.8/socket.py", line 669, in readinto
DUPLICITY: . return self._sock.recv_into(b)
DUPLICITY: . File "/usr/lib/python3.8/ssl.py", line 1241, in recv_into
DUPLICITY: . return self.read(nbytes, buffer)
DUPLICITY: . File "/usr/lib/python3.8/ssl.py", line 1099, in read
DUPLICITY: . return self._sslobj.read(len, buffer)
DUPLICITY: . socket.timeout: The read operation timed out
DUPLICITY: .
DUPLICITY: WARNING 1
DUPLICITY: . Attempt 1 failed. timeout: The read operation timed out
DUPLICITY: INFO 1
DUPLICITY: . PyDrive backend: found file 'duplicity-full-signatures.20200821T014731Z.sigtar.gz' with id 135UZSkFvRDv7egAogXy6MYaHiH3iopqN in ID cache
.... // at this point the error would repeat 4 more times and deja-dup would give up.
这似乎表明 deja-dup 能够访问我的驱动器,但某些读取操作不起作用?我检查了我的驱动器,文件duplicity-full-signatures.20200821T014731Z.sigtar.gz
似乎不存在。也许 deja-dup 正在尝试读取它,但由于它不存在而无法读取?我该如何解决这个问题?
答案1
这实际上不是对您问题的答案,但可以解决您的问题的替代方案是使用 Google Drive 安装,它的外观和功能与任何其他安装或硬盘驱动器非常相似。我曾经以deja-up
这种方式将文件备份到驱动器,从未遇到任何问题。
过去,我在 Ubuntu 中使用内置支持的 Google Drive 时遇到了很多问题。它可能可以完成基本功能,但仅此而已。因此,我转而使用google-drive-ocamlfuse
以下功能:https://github.com/astrada/google-drive-ocamlfuse
所有详细信息都在 github 产品页面上,但我认为这是我所做的:
安装软件包 google-drive-ocamlfuse:
sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt-get update
sudo apt-get install google-drive-ocamlfuse
Web 浏览器登录以获取访问令牌:
google-drive-ocamlfuse -label YOUR_GOOGLE_ACCOUNT_HERE
创建挂载点:
mkdir /home/wherever/Documents/mygoogledrive
山:
google-drive-ocamlfuse -label mygoogledrive /home/wherever/Documents/mygoogledrive
如果 -u 不起作用,则使用fusermount -u /home/wherever/Documents/mygoogledrive
卸载 或者延迟卸载。fusermount -uz /home/wherever/Documents/mygoogledrive
就我个人而言,我只是有一个运行卸载和安装命令的启动脚本,然后如果我遇到任何问题,我只需重新运行该脚本。
答案2
我遇到了同样的问题。第一次,它终于消失了,可能是因为 Google Drive 响应时间不稳定。当手动复制要在其缓存中下载的文件时,这需要 30 多秒,我认为这是用于下载文件的duplicity
默认超时值。该延迟是响应时间,因为一旦开始 ~50 MB 的文件传输,大约需要一秒钟才能完成。pydrive
httplib2
http
duplicity
我可以识别这个原因,并通过在's pydrivebackend.py
(中硬编码 60 秒超时来暂时解决此错误参见 GitLab),在其实例化的3个地方GoogleAuth()
,即GoogleAuth(http_timeout=60)
。
这不是一个永久的解决方案。如果它再次出现,我想我们应该想办法在deja-dup
x duplicity
x中指定更高的 HTTP/Google Drive API 请求超时值pydrive
。
我希望这会有所帮助,如果您有任何问题,请告诉我。