Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing import #14

Open
dnanaklouvi opened this issue Jan 26, 2022 · 3 comments
Open

Missing import #14

dnanaklouvi opened this issue Jan 26, 2022 · 3 comments

Comments

@dnanaklouvi
Copy link

Hi Ted,

We recently added an app to a self-hosted version of the GitHub app and below is the log of what happened. It threw an error in one of the pods being used.

2022-01-25T09:50:01Z return await self.app(scope, receive, send)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/fastapi/applications.py", line 199, in call

2022-01-25T09:50:01Z await super().call(scope, receive, send)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/applications.py", line 112, in call

2022-01-25T09:50:01Z await self.middleware_stack(scope, receive, send)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 181, in call

2022-01-25T09:50:01Z raise exc from None

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/middleware/errors.py", line 159, in call

2022-01-25T09:50:01Z await self.app(scope, receive, _send)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 82, in call

2022-01-25T09:50:01Z raise exc from None

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/exceptions.py", line 71, in call

2022-01-25T09:50:01Z await self.app(scope, receive, sender)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 580, in call

2022-01-25T09:50:01Z await route.handle(scope, receive, send)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 241, in handle

2022-01-25T09:50:01Z await self.app(scope, receive, send)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/routing.py", line 52, in app

2022-01-25T09:50:01Z response = await func(request)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/fastapi/routing.py", line 215, in app

2022-01-25T09:50:01Z dependant=dependant, values=values, is_coroutine=is_coroutine

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/fastapi/routing.py", line 151, in run_endpoint_function

2022-01-25T09:50:01Z return await run_in_threadpool(dependant.call, **values)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool

2022-01-25T09:50:01Z return await loop.run_in_executor(None, func, *args)

2022-01-25T09:50:01Z File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run

2022-01-25T09:50:01Z result = self.fn(*self.args, **self.kwargs)

2022-01-25T09:50:01Z File "/app/main.py", line 28, in github_webhook

2022-01-25T09:50:01Z return installation_payload(data)

2022-01-25T09:50:01Z File "/app/main.py", line 62, in installation_payload

2022-01-25T09:50:01Z install = ghapp.get_installation(install_id)

2022-01-25T09:50:01Z NameError: name 'ghapp' is not defined

- This is the error message we are getting.

@tedivm
Copy link
Member

tedivm commented Jan 26, 2022

I can take a look this weekend, or if you're up for it I can review a PR that has a fix. Let me know either way!

@dnanaklouvi
Copy link
Author

Hi Ted - that sound's great. I'll get back to my team and I'll respond immediately as soon as we know which time and if we have a PR that you can look at.

@tobes64
Copy link

tobes64 commented Jan 28, 2022

Hi Ted,

Looks like I fixed this error by updating the www.py file with the following import:

from githuborganizer.services.github import ghapp, get_organization_client

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants