【问题标题】:freebase api error on deployment to appengine: DownloadError: ApplicationError: 2部署到 appengine 时出现 freebase api 错误:DownloadError: ApplicationError: 2
【发布时间】:2012-05-29 13:34:15
【问题描述】:

我正在使用 google.appengine.api urlfetch 来执行以下 freebase MQL 查询:

https://api.freebase.com/api/service/mqlread?queries={"q1": {"query": [{"subjects": [{"name|=": ["doubt","trust"]}], "type": "/media_common/quotation", "name": null, "author": []}]}}

这在我的本地设置上按预期工作。部署到 Google AppEngine 后,我收到以下错误:

File "/base/python_runtime/python_lib/versions/1/google/appengine/api/urlfetch.py", line 263, in fetch
return rpc.get_result()
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 604, in get_result
return self.__get_result_hook(self)
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/urlfetch.py", line 365, in _get_fetch_result
raise DownloadError(str(err))
DownloadError: ApplicationError: 2

从我的谷歌搜索看来,freebase 可能会阻止来自 appengine 的请求。我尝试使用http://wiki.freebase.com/wiki/Google_API_Client_Libraries#Python 得到相同的结果。

【问题讨论】:

    标签: google-app-engine gwt freebase api-key


    【解决方案1】:

    尝试使用 Freebase API 密钥。这可能会有所帮助。

    【讨论】:

    • 我收到 {u'code': 100, u'message': u'Invalid API Key (Key not found)', u'stat': u'fail'}。我注册了 freebase 服务并将浏览器应用程序的简单 API 密钥添加到查询中:'&key=apikeystringhere'
    • 我已将 API 密钥问题添加为新问题:stackoverflow.com/questions/10807184/…
    • @waigani 我看到新问题已解决,当前问题是否也已解决?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-27
    • 1970-01-01
    • 1970-01-01
    • 2013-04-23
    • 2017-06-23
    相关资源
    最近更新 更多