binaryage / drydrop

Deploy static sites to App Engine by pushing to GitHub
http://drydrop.binaryage.com
Other
224 stars 32 forks source link

Syntax error in site.yaml, now application won't run at all #1

Closed zzamboni closed 14 years ago

zzamboni commented 14 years ago

Hi,

I introduced a syntax error in site.yaml, and it seems that now my drydrop install is stuck on the broken version, and even if I remove the file from git it doesn't seem to pick up the change. Here's what I get on http://zzambonidotorg.appspot.com/, also on the /admin page:

VFS: serving resource site.yaml (240 bytes)
Meta: dispatching /
regex \1/.*$ does not compile: bogus escape: '\\1'
Traceback (most recent call last):
  File "/base/data/home/apps/zzambonidotorg/master.336702990686891754/drydrop_handler.py", line 309, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/zzambonidotorg/master.336702990686891754/drydrop_handler.py", line 254, in get
    self.route(*args, **kvargs)
  File "/base/data/home/apps/zzambonidotorg/master.336702990686891754/drydrop_handler.py", line 275, in route
    dispatched = self.meta_dispatch(self.settings.source, config_source, self.request.path, self.request.headers, self.request.environ)
  File "/base/data/home/apps/zzambonidotorg/master.336702990686891754/drydrop_handler.py", line 118, in meta_dispatch
    config, matcher = ParseAppConfig(self.settings.source, config_source, self.vfs, static_caching=True)
  File "drydrop.zip/drydrop/app/meta/server.py", line 868, in ParseAppConfig
    vfs)
  File "drydrop.zip/drydrop/app/meta/server.py", line 812, in CreateURLMatcherFromMaps
    StaticFileConfigMatcher(url_map_list, path_adjuster, default_expiration), vfs)
  File "drydrop.zip/drydrop/app/meta/server.py", line 611, in __init__
    (regex, e))
InvalidAppConfigError: regex \1/.*$ does not compile: bogus escape: '\\1'
<type 'exceptions.ImportError'>: cannot import name DEVELOPMENT_PROJECT_ROOT
Traceback (most recent call last):
  File "/base/data/home/apps/zzambonidotorg/master.336702990686891754/drydrop_handler.py", line 372, in <module>
    main()
  File "/base/data/home/apps/zzambonidotorg/master.336702990686891754/drydrop_handler.py", line 369, in main
    run_wsgi_app(application)
  File "/base/python_lib/versions/1/google/appengine/ext/webapp/util.py", line 76, in run_wsgi_app
    result = application(env, _start_response)
  File "/base/data/home/apps/zzambonidotorg/master.336702990686891754/drydrop_handler.py", line 327, in __call__
    from drydrop.lib.nice_traceback import show_error
  File "/base/python_dist/lib/python2.5/py_zipimport.py", line 242, in load_module
    exec code in mod.__dict__
  File "drydrop.zip/drydrop/lib/nice_traceback.py", line 7, in <module>
<type 'exceptions.ImportError'>: cannot import name DEVELOPMENT_PROJECT_ROOT
darwin commented 14 years ago

ah, your only chance is to clear project's datastore in your google app engine web console

  1. fix your site.yaml (or remove it altogether)
  2. clear cache via app engine datastore manager
zzamboni commented 14 years ago

Indeed, this worked. Thanks a lot! I know next to nothing about GAE, would it be possible to trap these errors, so that they don't render the application unusable?

darwin commented 14 years ago

Yes, one try-catch block should fix it easily. In case of some troubles parsing site.yaml I should just use the default one.

darwin commented 14 years ago

main routing routine is wrapped into try-catch block, better error page explaining possible steps to fix broken drydrop (closed by 9fcc4576337971b945995f1354cf545171325b1b)

zzamboni commented 14 years ago

This seems to work fine now - I get the message also for regular "file not found" errors though - would it be possible to differentiate?

darwin commented 14 years ago

Look at this code: http://github.com/darwin/drydrop/blob/master/dryapp/drydrop_handler.py#L284

It is trying to fetch your /404.html page in case drydrop has no file to be served for this url. In case all fails, it serves this error page. But maybe you are right and I should change it in case of file not found.

darwin commented 14 years ago

Added separate error page for missing files in 3508c2e806a9750992a7c3b626e21615d0f68b37