sanitizers / chronographer-github-app

Your severe chronographer robot who is watching you record all the news to change note files!
https://github.com/apps/chronographer
GNU General Public License v3.0
10 stars 3 forks source link

[BUG] Track down and fix why the app crashes now #15

Closed webknjaz closed 5 years ago

webknjaz commented 5 years ago

It looks like GitHub now has modified webhook contents:

 Starting process with command `python -m chronographer`
 /app/.heroku/python/lib/python3.7/site-packages/envparse.py:195: UserWarning: Could not any envfile.
 ings.warn('Could not any envfile.')
 asyncio:unhandled exception during asyncio.run() shutdown
 task: <Task finished coro=<<async_generator_athrow without __name__>()> exception=RuntimeError("can't send non-None value to a just-started coroutine")>
 Traceback (most recent call last):
   File "/app/.heroku/python/lib/python3.7/asyncio/runners.py", line 43, in run
     return loop.run_until_complete(main)
   File "/app/.heroku/python/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
     return future.result()
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/app/server/machinery.py", line 43, in run_forever
     async with GitHubApp(config.github) as github_app:
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/github/api/app_client.py", line 70, in __aenter__
     self._installations = await self.get_installations()
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/github/api/app_client.py", line 172, in get_installations
     await installations[install.id].retrieve_access_token()
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/github/entities/app_installation.py", line 59, in retrieve_access_token
     accept='application/vnd.github.machine-man-preview+json',
   TypeError: __init__() got an unexpected keyword argument 'permissions'
 58 <190>1 -
 During handling of the above exception, another exception occurred:
 58 <190>1 -
   RuntimeError: can't send non-None value to a just-started coroutine
 Traceback (most recent call last):
   File "/app/.heroku/python/lib/python3.7/runpy.py", line 193, in _run_module_as_main
     "__main__", mod_spec)
   File "/app/.heroku/python/lib/python3.7/runpy.py", line 85, in _run_code
     exec(code, run_globals)
   File "/app/chronographer/__main__.py", line 12, in <module>
     url='https://github.com/apps/chronographer',
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/app/server/runner.py", line 64, in run
     asyncio.run(run_server_forever(config))
   File "/app/.heroku/python/lib/python3.7/asyncio/runners.py", line 43, in run
     return loop.run_until_complete(main)
   File "/app/.heroku/python/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
     return future.result()
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/app/server/machinery.py", line 43, in run_forever
     async with GitHubApp(config.github) as github_app:
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/github/api/app_client.py", line 70, in __aenter__
     self._installations = await self.get_installations()
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/github/api/app_client.py", line 172, in get_installations
     await installations[install.id].retrieve_access_token()
   File "/app/.heroku/python/lib/python3.7/site-packages/octomachinery/github/entities/app_installation.py", line 59, in retrieve_access_token
     accept='application/vnd.github.machine-man-preview+json',
   TypeError: __init__() got an unexpected keyword argument 'permissions'
 Process exited with status 1
 State changed from starting to crashed
webknjaz commented 5 years ago

Ah... They've changed the response type of the installation access token retrieval https://developer.github.com/v3/apps/#create-a-new-installation-token — now it contains permissions key and (optionally) repositories.

webknjaz commented 5 years ago

Ref: https://github.com/sanitizers/octomachinery/issues/22 Ref: https://github.com/sanitizers/octomachinery/issues/21