1
我試圖通過運行以下命令部署一個PHP的網站,谷歌應用程序引擎:谷歌App Engine的部署錯誤:僞造逃生
appcfg.py -A <app-id> update <app-location>
我不斷收到以下錯誤:
Traceback (most recent call last):
...
line 327, in __GetMimeTypeIfStaticFile
if re.match(regex, filename):
File "C:\python27\lib\re.py", line 137, in match
return _compile(pattern, flags).match(string)
File "C:\python27\lib\re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: bogus escape: '\\1'
我不確定是否存在Python無法識別的MIME類型,或者某些文件被Google阻止。我試圖通過部署代碼,但有很多引用,我必須追查。有沒有人有任何想法?
完整堆棧跟蹤:
Traceback (most recent call last):
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform/google_appengine\appcfg.py", line 133, in <module>
run_file(__file__, globals())
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform/google_appengine\appcfg.py", line 129, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 5511, in <module>
main(sys.argv)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 5502, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 3021, in Run
self.action(self)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 5158, in __call__
return method()
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 3880, in Update
self._UpdateWithParsedAppYaml(appyaml, self.basepath)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 3933, in _UpdateWithParsedAppYaml
self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 3818, in UpdateVersion
return appversion.DoUpload(paths, openfunc)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 2441, in DoUpload
self._AddFilesThatAreSmallEnough(paths, openfunc)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 2540, in _AddFilesThatAreSmallEnough
self.config, path, self.error_fh)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 298, in __init__
self.__static_mime_type = self.__GetMimeTypeIfStaticFile(config, filename)
File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\appcfg.py",
line 327, in __GetMimeTypeIfStaticFile
if re.match(regex, filename):
File "C:\python27\lib\re.py", line 137, in match
return _compile(pattern, flags).match(string)
File "C:\python27\lib\re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: bogus escape: '\\1'
這裏是我的app.yaml文件的內容:
application: <app-id>
version: 1
runtime: php55
api_version: 1
threadsafe: yes
handlers:
- url: /(.*\.(css|js|png|jpg|jpeg|ttf|woff|xsl|htm|html|ico).*)$
static_files: \1
upload: \1
- url: /(.+\.php)$
script: \1
- url: /(.+)/$
script: \1/default.php
- url: /(.+)$
script: \1.php
- url: /|/default.php
script: default.php
什麼在你的app.yaml? – Greg
@Greg請參閱編輯。 –