simonw / datasette-app-support

Part of https://github.com/simonw/datasette-app
4 stars 3 forks source link

Fix app startup crash issue #139 #20

Closed spod closed 2 years ago

spod commented 2 years ago

This fixes https://github.com/simonw/datasette-app/issues/139 on my install.

Notes on how to reproduce the crash and fix.

9:15:57 PM: Shutting down
9:15:57 PM: Waiting for application shutdown.
9:15:57 PM: Application shutdown complete.
9:15:57 PM: Finished server process [60451]
9:15:57 PM: Traceback (most recent call last):
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/bin/datasette", line 8, in <module>
9:15:57 PM:     sys.exit(cli())
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
9:15:57 PM:     return self.main(*args, **kwargs)
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
9:15:57 PM:     rv = self.invoke(ctx)
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
9:15:57 PM:     return _process_result(sub_ctx.command.invoke(sub_ctx))
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
9:15:57 PM:     return ctx.invoke(self.callback, **ctx.params)
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
9:15:57 PM:     return __callback(*args, **kwargs)
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/datasette/cli.py", line 582, in serve
9:15:57 PM:     asyncio.get_event_loop().run_until_complete(ds.invoke_startup())
9:15:57 PM:   File "/Applications/Datasette.app/Contents/Resources/python/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
9:15:57 PM:     return future.result()
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/datasette/app.py", line 387, in invoke_startup
9:15:57 PM:     await await_me_maybe(hook)
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/datasette/utils/__init__.py", line 111, in await_me_maybe
9:15:57 PM:     value = await value
9:15:57 PM:   File "/Users/m.collins/.datasette-app/venv/lib/python3.9/site-packages/datasette_app_support/__init__.py", line 44, in inner
9:15:57 PM:     < version.parse(plugin["tag_name"])
9:15:57 PM: KeyError: 'tag_name'
MichaelTiemannOSC commented 2 years ago

Applying this fix (to ~/.datasette-app/venv/lib/python3.9/site-packages/datasette_app_support/__init__.py) worked for me.

simonw commented 2 years ago

Thanks very much for this.