1

我正在尝试使用 appcfg.py 将 CSV 数据上传到最初为空的数据存储区。在“dry_run”模式下运行 appcfg.py 可以正常工作,但使用 remote_api 运行它会给我以下错误消息:

BadRequestError:
[ERROR   ] Error in WorkerThread-0: app s~pcloudeconomy cannot access app pcloudeconomy's data

如错误消息所示,有关为什么无法访问数据的任何建议?谢谢你。

appcfg.py (dry_run mode) log:

C:\GAE\appengine-python-sdk-1.8.0>python appcfg.py upload_data --config_file=county_loader.py --filename=lgucodir.txt --kind=County --dry_run c:\cloud\pcloudeconomy
10:57 AM Application: pcloudeconomy
10:57 AM Uploading data records.
[INFO    ] Logging to bulkloader-log-20130603.105718
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
[INFO    ] Opening database: bulkloader-progress-20130603.105718.sql3
[INFO    ] Running in dry run mode, skipping remote_api setup
[INFO    ] Connecting to pcloudeconomy.appspot.com/_ah/remote_api
[INFO    ] Starting import; maximum 10 entities per post
................................................................................
................................................................................
................................................................................
................................................................
[INFO    ] 3033 entities total, 0 previously transferred
[INFO    ] 3033 entities (0 bytes) transferred in 12.9 seconds
[INFO    ] All entities successfully transferred

appcfg.py (remote_api mode) log:

C:\GAE\appengine-python-sdk-1.8.0>python appcfg.py upload_data --config_file=county_loader.py --filename=lgucodir.txt --kind=County c:\cloud\pcloudeconomy
10:58 AM Application: pcloudeconomy
10:58 AM Uploading data records.
[INFO    ] Logging to bulkloader-log-20130603.105820
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
[INFO    ] Opening database: bulkloader-progress-20130603.105820.sql3
[INFO    ] Connecting to pcloudeconomy.appspot.com/_ah/remote_api
Please enter login credentials for pcloudeconomy.appspot.com
Email: edgamboa@gmail.com
Password for edgamboa@gmail.com:
[INFO    ] Starting import; maximum 10 entities per post
[ERROR   ] [WorkerThread-0] WorkerThread:
Traceback (most recent call last):
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\tools\adaptive_thread_pool.py", line 176, in WorkOnItems
status, instruction = item.PerformWork(self.__thread_pool)
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\tools\bulkloader.py",
line 767, in PerformWork
transfer_time = self._TransferItem(thread_pool)
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\tools\bulkloader.py",
line 938, in _TransferItem
self.request_manager.PostEntities(self.content)
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\tools\bulkloader.py",
line 1423, in PostEntities
datastore.Put(entities)
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\api\datastore.py", line 579, in Put
return PutAsync(entities, **kwargs).get_result()
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\datastore\datastore_rpc.py", line 828, in get_result
results = self.__rpcs[0].get_result()
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\api\apiproxy_stub_map.py", line 604, in get_result
return self.__get_result_hook(self)
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\datastore\datastore_rpc.py", line 1569, in __put_hook
self.check_rpc_success(rpc)
File "C:\GAE\appengine-python-sdk-1.8.0\google\appengine\datastore\datastore_rpc.py", line 1224, in check_rpc_success
raise _ToDatastoreError(err)
BadRequestError: app s~pcloudeconomy cannot access app pcloudeconomy's data
[INFO    ] [WorkerThread-1] Backing off due to errors: 1.0 seconds
[INFO    ] Unexpected thread death: WorkerThread-0
[INFO    ] An error occurred. Shutting down...
[ERROR   ] Error in WorkerThread-0: app s~pcloudeconomy cannot access app pcloudeconomy's data
[INFO    ] 680 entities total, 0 previously transferred
[INFO    ] 0 entities (8677 bytes) transferred in 28.8 seconds
[INFO    ] Some entities not successfully transferred

app.yaml

application: pcloudeconomy
version: 1
runtime: python27
api_version: 1
threadsafe: yes

builtins:
- remote_api: on

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.2"
4

2 回答 2

0

请注意实际的错误措辞“adRequestError:app s~pcloudeconomy 无法访问 app pcloudeconomy 的数据”转储来自何处。

old_dev_server 有一个参数 --default_partition 允许您显式设置数据存储的应用程序 ID 前缀。在您的情况下,数据(键)的 id 不匹配。

看来新的 dev_server 已经放弃了这个论点。

https://developers.google.com/appengine/docs/python/tools/devserver

于 2013-06-06T04:46:17.670 回答
0

根据收到的答案,我用“--url= http://pcloudeconomy.appspot.com/_ah/remote_api ”替换了“c:\cloud\pcloudeconomy”,它起作用了。

于 2013-06-07T17:29:02.633 回答