2016-05-06 24 views
2

嘗試部署的簡單留言 https://cloud.google.com/appengine/docs/python/gettingstartedpython27/deploying-the-application應用程序引擎NeedIndexError:沒有匹配的索引中找到

我嘗試部署像這樣的應用程序的錯誤:

appcfg.py --verbose -A glossy-apex-130310 -V v1 update ./ 
07:56 PM Application: glossy-apex-130310 (was: None); version: v1 (was: None) 
07:56 PM Host: appengine.google.com 
2016-05-06 19:56:11,019 INFO sdk_update_checker.py:229 Checking for updates to the SDK. 
2016-05-06 19:56:11,607 INFO appcfg.py:2378 Reading app configuration. 
07:56 PM 
Starting update of app: glossy-apex-130310, version: v1 
07:56 PM Getting current resource limits. 
2016-05-06 19:56:11,608 INFO appcfg.py:1693 Send: /api/appversion/getresourcelimits, params={'version': 'v1', 'app_id': 'glossy-apex-130310'} 
2016-05-06 19:56:12,350 ERROR appcfg.py:2396 An error occurred processing file '': HTTP Error 403: Forbidden Unexpected HTTP status 403. Aborting. 
Error 403: --- begin server output --- 
You do not have permission to modify this app (app_id=u's~glossy-apex-130310'). 
--- end server output --- 

所以我部署它像這樣:

gcloud preview app deploy --project glossy-apex-130310 

http://glossy-apex-130310.appspot.com/ 得到這個 內部服務器錯誤

The server has either erred or is incapable of performing the requested operation. 

Traceback (most recent call last): 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__ 
    rv = self.handle_exception(request, response, e) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__ 
    rv = self.router.dispatch(request, response) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher 
    return route.handler_adapter(request, response) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__ 
    return handler.dispatch() 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch 
    return self.handle_exception(e, self.app.debug) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch 
    return method(*args, **kwargs) 
    File "/base/data/home/apps/s~glossy-apex-130310/20160506t132909.392595029440587911/guestbook.py", line 72, in get 
    greetings = greetings_query.fetch(10) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/utils.py", line 160, in positional_wrapper 
    return wrapped(*args, **kwds) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/query.py", line 1203, in fetch 
    return self.fetch_async(limit, **q_options).get_result() 
    File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 378, in get_result 
    self.check_success() 
    File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 422, in _help_tasklet_along 
    value = gen.throw(exc.__class__, exc, tb) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/query.py", line 980, in _run_to_list 
    batch = yield rpc 
    File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/tasklets.py", line 508, in _on_rpc_completion 
    result = rpc.get_result() 
    File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result 
    return self.__get_result_hook(self) 
    File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2921, in __query_result_hook 
    yaml_index=yaml, xml_index=xml) 
NeedIndexError: no matching index found. recommended index is: 
- kind: Greeting 
    ancestor: yes 
    properties: 
    - name: date 
    direction: desc 

The suggested index for this query is: 
- kind: Greeting 
    ancestor: yes 
    properties: 
    - name: date 
    direction: desc 

index.yaml文件

indexes: 
- kind: Greeting 
    ancestor: yes 
    properties: 
    - name: date 
    direction: desc 

我看,我應該等待一段時間。已經4個小時了。

這裏就不會 https://console.cloud.google.com/datastore/indexes?project=glossy-apex-130310

+0

你可以看到在這個指數的狀態https://console.cloud.google.com/datastore/indexes?project = glossy-apex-130310? – snakecharmerb

+0

hi @snakecharmerb在問題中添加了。沒有索引存在 – WebQube

+0

我猜它應該自動生成,但沒有。在哪裏可以查看相關日誌來調試呢? – WebQube

回答

2

的gcloud SDK可以上傳索引到雲存儲與create-indexes命令,像這樣(docs)創建的索引:

$ gcloud preview datastore create-indexes ~/myapp/index.yaml

App Engine的SDK將appcfg.pyupdate command一起執行時將上傳索引以及應用程序代碼:

$ appcfg.py -A <YOUR_PROJECT_ID> update myapp/

或當appcfg.pyupdate_indexes command執行索引可以單獨上傳:

appcfg.py update_indexes myapp/

相關問題