我正在尝试使用以下命令从数据存储区下载一些数据:
appcfg.py download_data --config_file=bulkloader.yaml --application=myappname
--kind=mykindname --filename=myappname_mykindname.csv
--url=http://myappname.appspot.com/_ah/remote_api
当我在这种特定类型/表格中没有太多数据时,我可以一次性下载数据 - 偶尔会遇到以下错误:
.................................[ERROR ] [Thread-11]
ExportProgressThread:
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\tools
\bulkload
er.py", line 1448, in run
self.PerformWork()
File "C:\Program Files\Google\google_appengine\google\appengine\tools
\bulkload
er.py", line 2216, in PerformWork
item.key_end)
File "C:\Program Files\Google\google_appengine\google\appengine\tools
\bulkload
er.py", line 2011, in StoreKeys
(STATE_READ, unicode(kind), unicode(key_start), unicode(key_end)))
OperationalError: unable to open database file
这是我在服务器日志中看到的:
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/
ext/remote_api/handler.py", line 277, in post
response_data = self.ExecuteRequest(request)
File "/base/python_runtime/python_lib/versions/1/google/appengine/
ext/remote_api/handler.py", line 308, in ExecuteRequest
response_data)
File "/base/python_runtime/python_lib/versions/1/google/appengine/
api/apiproxy_stub_map.py", line 86, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "/base/python_runtime/python_lib/versions/1/google/appengine/
api/apiproxy_stub_map.py", line 286, in MakeSyncCall
rpc.CheckSuccess()
File "/base/python_runtime/python_lib/versions/1/google/appengine/
api/apiproxy_rpc.py", line 126, in CheckSuccess
raise self.exception
ApplicationError: ApplicationError: 4 no matching index found.
当出现该错误时,我只需重新运行下载,一切都会顺利进行。
最近,我注意到随着我的类型的大小增加,下载工具失败的频率越来越高。例如,对于具有约 3500 个实体的种类,我必须运行该命令 5 次 - 只有最后一次成功。有没有办法解决这个错误?以前,我唯一担心的是由于偶尔的失败,我无法在脚本中自动下载 - 现在我害怕我根本无法获取我的数据。
这个问题之前在这里讨论过, 但帖子很旧,我不确定建议的标志是做什么的 - 因此再次发布我的类似查询。
一些额外的细节。正如这里提到的,我尝试了继续中断下载的建议(在从 App Engine 下载数据部分)。当我在中断后恢复时,我没有收到任何错误,但下载的行数少于数据存储管理员向我显示的实体计数。这是我收到的消息:
[INFO ] Have 3220 entities, 3220 previously transferred
[INFO ] 3220 entities (1003 bytes) transferred in 2.9 seconds
数据存储区管理员告诉我这种特殊类型有大约 4300 个实体。为什么没有下载剩余的实体?
谢谢!