Google App Engine:在开发服务器上,upload_data因“目标机器主动拒绝”失败

4 投票
1 回答
1363 浏览
提问于 2025-04-16 00:28

我正在尝试通过开发服务器将CSV文件中的数据上传到我的应用程序:

appcfg.py upload_data --config_file="DataLoader.py" --filename="data.csv" --kind=Foo --url=http://localhost:8083/remote_api "path/to/app"

结果是:

Application: appname; version: 1.
Uploading data records.
[INFO    ] Logging to bulkloader-log-20100626.181045
[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-20100626.181045.sql3
Please enter login credentials for localhost
Email: email@domain.com
Password for email@domain.com:
[INFO    ] Connecting to localhost:8083/remote_api
[INFO    ] Starting import; maximum 10 entities per post
Google\google_appengine\google\appengine\api\datastore_types.py:673: DeprecationWarning: object.__init__() takes no parameters
  super(Link, self).__init__(self, link)
............[INFO    ] Unexpected thread death: WorkerThread-7
[INFO    ] An error occurred. Shutting down...
........[ERROR   ] Error in WorkerThread-1: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>
[ERROR   ] Error in WorkerThread-7: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>

[INFO    ] 1230 entites total, 0 previously transferred
[INFO    ] 200 entities (218274 bytes) transferred in 25.8 seconds
[INFO    ] Some entities not successfully transferred

每次尝试时,传输的实体数量在200到850之间波动。

这是怎么回事呢?通常这个过程是没问题的。我访问 http://localhost:8083/ 一切正常,应用程序也运行得很好。(只是缺少数据。)

1 个回答

10

通过在命令行中添加选项 --num_threads=4 来把线程数量减少到4个。

如果这样还是不行,就再把线程数量减少一些。

撰写回答