2017-07-30 74 views
0

我一直在嘗試將此application_readable: true添加到app.yaml文件,並且出現此錯誤!嘗試向app.yaml文件添加'application_readable:true'時出錯

Traceback (most recent call last): 
    File "/google/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 103, in <module> 
    _run_file(__file__, globals()) 
    File "/google/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 97, in _run_file 
    execfile(_PATHS.script_file(script_name), globals_) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 381, in <module> 
    main() 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 369, in main 
    dev_server.start(options) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 105, in start 
    env_variables=parsed_env_variables) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 864, in __init__ 
    env_variables) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 131, in __init__ 
    self._config_path) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 454, in _parse_configuration 
    config, files = appinfo_includes.ParseAndReturnIncludePaths(f) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/api/appinfo_includes.py", line 82, in ParseAndReturnIncludePaths 
    appyaml = appinfo.LoadSingleAppInfo(appinfo_file) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/api/appinfo.py", line 2482, in LoadSingleAppInfo 
    listener.Parse(app_info) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/api/yaml_listener.py", line 227, in Parse 
    self._HandleEvents(self._GenerateEventParameters(stream, loader_class)) 
    File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/api/yaml_listener.py", line 178, in _HandleEvents 
    raise yaml_errors.EventError(e, event_object) 
google.appengine.api.yaml_errors.EventError: Unexpected attribute "application_readable" for mapping type script. 
    in "app.yaml", line 10, column 

和我的app.yaml文件中是這樣

runtime: python27 
api_version: 1 
threadsafe: true 

handlers: 
- url: /.* 
    script: main.app 
    application_readable: true 

哪裏出了問題?

回答

0

application_readable標誌僅適用於static_files和/或static_dir類型的處理程序。這是因爲該靜態內容默認存儲在與應用程序代碼不同的地方。從Handlers element

application_readable

可選。布爾。默認情況下,靜態文件 處理程序中聲明的文件將作爲靜態數據上載,並且僅供最終用戶使用。 它們不能被應用程序讀取。如果該字段設置爲true,則 這些文件也將作爲代碼數據上傳,以便您的應用程序可以讀取它們的 。這兩種上傳都是針對您的代碼和靜態數據收取的 存儲resource quotas

非靜態處理程序的腳本已經是應用程序的一部分,添加標誌沒有多大意義。當然,可以爭辯說,這可以做得比這更友好:)

所以只是不要添加該標誌的非靜態處理程序,你應該沒問題。