Closed tomarv2 closed 4 years ago
passed the document creation, by restarting, I added my own jira plugin, so I have two: one come default and one that I created, now showing this:
INFO: Dispatch Core App: Incident created
INFO: 172.31.0.1:46242 - "POST /api/v1/incidents/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 150, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
return await loop.run_in_executor(None, func, *args)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/views.py", line 103, in create_incident
incident = create(
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/service.py", line 177, in create
reporter_participant = participant_flows.add_participant(
File "/usr/local/lib/python3.8/site-packages/dispatch/participant/flows.py", line 26, in add_participant
individual = individual_service.get_or_create(db_session=db_session, email=user_email)
File "/usr/local/lib/python3.8/site-packages/dispatch/individual/service.py", line 47, in get_or_create
contact_plugin = plugin_service.get_active(db_session=db_session, plugin_type="contact")
File "/usr/local/lib/python3.8/site-packages/dispatch/plugin/service.py", line 20, in get_active
db_session.query(Plugin)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3413, in one_or_none
raise orm_exc.MultipleResultsFound(
sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one_or_none()
@tomarv2 the error is telling you that there are more than one contact
plugins enabled. Disable all except the one you want to use and you should be good.
@mvilanova :
getting below errror, it says slug: slack-contact
not found, but I can see it in list:
INFO: Dispatch Core App: Incident created
ERROR: Unable to find slug: slack-contact in self.all version 1: <generator object PluginManager.all at 0x7ff45c872740> or version 2: <generator object PluginManager.all at 0x7ff45c872740>
INFO: 172.31.0.1:46454 - "POST /api/v1/incidents/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 150, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
return await loop.run_in_executor(None, func, *args)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/views.py", line 103, in create_incident
incident = create(
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/service.py", line 177, in create
reporter_participant = participant_flows.add_participant(
File "/usr/local/lib/python3.8/site-packages/dispatch/participant/flows.py", line 26, in add_participant
individual = individual_service.get_or_create(db_session=db_session, email=user_email)
File "/usr/local/lib/python3.8/site-packages/dispatch/individual/service.py", line 48, in get_or_create
individual_info = contact_plugin.instance.get(email, db_session=db_session)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugin/models.py", line 28, in instance
return plugins.get(self.slug)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/base/manager.py", line 43, in get
raise KeyError(slug)
KeyError: 'slack-contact'
root@cf007250c101:/# dispatch plugins list
No metric providers specified metrics will not be sent.
WARNING:dispatch.common.utils.cli:Failed to load plugin: opsgenie_oncall Reason: "Config 'OPSGENIE_TEAM_ID' is missing, and has no default."
Title Slug Version Type Author Description
-------------------------------------------------- ------------------------------ ---------- ----------------- ----------- ---------------------------------------------------------
Dispatch Plugin - Basic Authentication Provider dispatch-auth-provider-basic 0.1.0 auth-provider Netflix Generic basic authentication provider.
Dispatch Plugin - Contact plugin dispatch-contact 0.1.0 contact Netflix Uses dispatch itself to resolve incident participants.
Dispatch Plugin - Document Resolver dispatch-document-resolver 0.1.0 document-resolver Netflix Uses dispatch itself to resolve incident documents.
Dispatch Plugin - PKCE Authentication Provider dispatch-auth-provider-pkce 0.1.0 auth-provider Netflix Generic PCKE authentication provider.
Dispatch Plugin - Participant Resolver dispatch-participant-resolver 0.1.0 participant Netflix Uses dispatch itself to resolve incident participants.
Dispatch Plugin - Ticket Management dispatch-ticket 0.1.0 ticket Netflix Uses dispatch itself to create a ticket.
Google Calendar Plugin - Conference Management google-calendar-conference 0.1.0 conference Netflix Uses Google calendar to manage conference rooms/meets.
Google Docs Plugin - Document Management google-docs-document 0.1.0 document Netflix Uses Google docs to manage document contents.
Google Drive Plugin - Storage Management google-drive-storage 0.1.0 storage Netflix Uses Google Drive to help manage incident storage.
Google Drive Plugin - Task Management google-drive-task 0.1.0 task Netflix Uses Google Drive to help manage incident tasks.
Google Gmail Plugin - Conversation Management google-gmail-conversation 0.1.0 conversation Netflix Uses gmail to facilitate conversations.
Google Group Plugin - Participant Group Management google-group-participant-group 0.1.0 participant_group Netflix Uses Google Groups to help manage participant membership.
Jira - Ticket(custom) jira-ticket-custom 0.1.0.dev2 ticket Varun Tomar Uses Jira as an external ticket creator(custom).
Jira Plugin - Ticket Management jira-ticket 0.1.0 ticket Netflix Uses Jira to hepl manage external tickets.
PagerDuty Plugin - Oncall Management pagerduty-oncall 0.1.0 oncall Netflix Uses PagerDuty to resolve and page oncall teams.
Slack Plugin - Contact Information Resolver slack-contact 0.1.0 contact Netflix Uses Slack to resolve contact information details.
Slack Plugin - Conversation Management slack-conversation 0.1.0 conversation Netflix Uses Slack to facilitate conversations.
Zoom Plugin - Conference Management zoom-conference 0.1.0 conference HashiCorp Uses Zoom to manage conference meetings.
tried to debug, added this, looks like its not reaching it:
async def get_user_email_async(client: Any, user_id: str):
"""Gets the user's email."""
result = (await get_user_info_by_id_async(client, user_id))
print("=" * 50)
print(result)
print("=" * 50)
return result["profile"]["email"]
#return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
@tomarv2 last release broke master. We just fixed it. Try again and let us know.
@mvilanova now getting this:
INFO: 172.31.0.37:12076 - "GET /static/m.png HTTP/1.1" 200 OK
INFO: 172.31.0.37:12090 - "GET / HTTP/1.1" 200 OK
INFO: 172.31.45.203:34192 - "GET / HTTP/1.1" 200 OK
INFO: Dispatch Core App: Incident created
ERROR: SlackError. Response: {'ok': False, 'error': 'missing_scope', 'needed': 'users.profile:read', 'provided': 'incoming-webhook,channels:read,groups:read,groups:history,reactions:read,commands,chat:write,files:read,groups:write,im:history,im:write,mpim:history,mpim:read,mpim:write,pins:write,reactions:write,reminders:read,reminders:write,remote_files:read,team:read,users:read,users:read.email,users:write'} Endpoint: users.profile.get kwargs: {'user': 'xyz'}
INFO: 172.31.0.37:12092 - "POST /api/v1/incidents/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 150, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
return await loop.run_in_executor(None, func, *args)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/views.py", line 103, in create_incident
incident = create(
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/service.py", line 177, in create
reporter_participant = participant_flows.add_participant(
File "/usr/local/lib/python3.8/site-packages/dispatch/participant/flows.py", line 26, in add_participant
individual = individual_service.get_or_create(db_session=db_session, email=user_email)
File "/usr/local/lib/python3.8/site-packages/dispatch/individual/service.py", line 48, in get_or_create
individual_info = contact_plugin.instance.get(email, db_session=db_session)
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 75, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 59, in wrapper
result = func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/plugin.py", line 203, in get
profile = get_user_profile_by_email(self.client, email)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 196, in get_user_profile_by_email
profile = make_call(client, "users.profile.get", user=user["id"])["profile"]
File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 329, in wrapped_f
return self.call(f, *args, **kw)
File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 409, in call
do = self.iter(retry_state=retry_state)
File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 356, in iter
return fut.result()
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
raise self._exception
File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 412, in call
result = fn(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 136, in make_call
raise e
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 116, in make_call
response = client.api_call(endpoint, http_verb="GET", params=kwargs)
File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 215, in api_call
return self._sync_send(api_url=api_url, req_args=req_args)
File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 341, in _sync_send
return self._urllib_api_call(
File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 463, in _urllib_api_call
return SlackResponse(
File "/usr/local/lib/python3.8/site-packages/slack/web/slack_response.py", line 195, in validate
raise e.SlackApiError(message=msg, response=self)
slack.errors.SlackApiError: The request to the Slack API failed.
The server responded with: {'ok': False, 'error': 'missing_scope', 'needed': 'users.profile:read', 'provided': 'incoming-webhook,channels:read,groups:read,groups:history,reactions:read,commands,chat:write,files:read,groups:write,im:history,im:write,mpim:history,mpim:read,mpim:write,pins:write,reactions:write,reminders:read,reminders:write,remote_files:read,team:read,users:read,users:read.email,users:write'}
INFO: 127.0.0.1:55032 - "GET / HTTP/1.1" 200 OK
INFO: 172.31.0.37:12102 - "GET / HTTP/1.1" 200 OK
INFO: 172.31.45.203:34200 - "GET / HTTP/1.1" 200 OK
INFO: 127.0.0.1:55040 - "GET / HTTP/1.1" 200 OK
INFO: 172.31.0.37:12114 - "GET / HTTP/1.1" 200 OK
INFO: 172.31.45.203:34214 - "GET / HTTP/1.1" 200 OK
INFO: 127.0.0.1:55048 - "GET / HTTP/1.1" 200 OK
@tomarv2 the following error is telling you that you're missing the Slack users.profile:read
bot scope: ERROR: SlackError. Response: {'ok': False, 'error': 'missing_scope', 'needed': 'users.profile:read', 'provided': 'incoming-webhook,channels:read,groups:read,groups:history,reactions:read,commands,chat:write,files:read,groups:write,im:history,im:write,mpim:history,mpim:read,mpim:write,pins:write,reactions:write,reminders:read,reminders:write,remote_files:read,team:read,users:read,users:read.email,users:write'} Endpoint: users.profile.get kwargs: {'user': 'xyz'}
@mvilanova it moved bit further, this error:
NFO: 172.31.39.178:38946 - "GET /api/v1/incident_priorities/?sortBy[]=view_order&descending[]=false HTTP/1.1" 200 OK
INFO: 172.31.10.250:54546 - "GET /api/v1/incident_types/?itemsPerPage=50&sortBy[]=name&descending[]=false HTTP/1.1" 200 OK
INFO: 172.31.39.178:38948 - "GET /img/icons/favicon-32x32.png HTTP/1.1" 200 OK
INFO: 172.31.39.178:38952 - "GET / HTTP/1.1" 200 OK
INFO: 172.31.39.178:38948 - "GET /img/icons/favicon-16x16.png HTTP/1.1" 200 OK
INFO: 127.0.0.1:60070 - "GET / HTTP/1.1" 200 OK
INFO: Dispatch Core App: Incident created
INFO: Dispatch Core App: dispatch added to incident with Reporter role
INFO: Dispatch Core App: xxxxxxx added to incident with Incident Commander role
INFO: 172.31.39.178:38960 - "POST /api/v1/incidents/ HTTP/1.1" 200 OK
INFO: Dispatch Plugin - Participant Resolver: Incident participants resolved
INFO: Dispatch Core App: Incident participants added to incident
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 35, in wrapper
result = func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 515, in incident_create_flow
ticket = create_incident_ticket(incident, db_session)
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 130, in create_incident_ticket
ticket = plugin.instance.create(
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 75, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 59, in wrapper
result = func(*args, **kwargs)
TypeError: create() takes from 6 to 7 positional arguments but 8 were given
INFO: 172.31.39.178:38968 - "GET /api/v1/incidents/5 HTTP/1.1" 200 OK
INFO: 172.31.10.250:54610 - "GET / HTTP/1.1" 200 OK
INFO: 172.31.39.178:38968 - "GET /api/v1/incidents/5 HTTP/1.1" 200 OK
@tomarv2 IIRC you said you had your own Jira plugin? Is it taking a different amount of arguments that the ones passed to plugin.instance.create()
in incident/flows.py line 130?
thanks @mvilanova it was working in the previous deployment, let me see what changed..
started getting this, may be I am doing something wrong:
web_1 | INFO: 172.18.0.1:42840 - "GET /incidents/report HTTP/1.1" 200 OK
web_1 | INFO: 172.18.0.1:42842 - "GET /img/icons/android-chrome-192x192.png HTTP/1.1" 200 OK
web_1 | INFO: 172.18.0.1:42838 - "GET /api/v1/incident_priorities/?sortBy[]=view_order&descending[]=false HTTP/1.1" 200 OK
web_1 | INFO: 172.18.0.1:42840 - "GET /api/v1/incident_types/?itemsPerPage=50&sortBy[]=name&descending[]=false HTTP/1.1" 200 OK
web_1 | INFO: 172.18.0.1:42840 - "GET /service-worker.js HTTP/1.1" 304 Not Modified
web_1 | INFO: Dispatch Core App: Incident created
web_1 | ERROR: SlackError. Response: {'ok': False, 'error': 'users_not_found'} Endpoint: users.lookupByEmail kwargs: {'email': 'dispatch@example.com'}
web_1 | INFO: 172.18.0.1:42844 - "POST /api/v1/incidents/ HTTP/1.1" 500 Internal Server Error
web_1 | ERROR: Exception in ASGI application
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
web_1 | result = await app(self.scope, self.receive, self.send)
web_1 | File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
web_1 | return await self.app(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
web_1 | await self.middleware_stack(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
web_1 | raise exc from None
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
web_1 | await self.app(scope, receive, _send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1 | await response(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
web_1 | async for chunk in self.body_iterator:
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1 | task.result()
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1 | await self.app(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
web_1 | raise exc from None
web_1 | File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
web_1 | await self.app(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1 | await response(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
web_1 | async for chunk in self.body_iterator:
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1 | task.result()
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1 | await self.app(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
web_1 | await response(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
web_1 | async for chunk in self.body_iterator:
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
web_1 | task.result()
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
web_1 | await self.app(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
web_1 | raise exc from None
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
web_1 | await self.app(scope, receive, sender)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
web_1 | await route.handle(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
web_1 | await self.app(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
web_1 | await super().__call__(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
web_1 | await self.middleware_stack(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
web_1 | raise exc from None
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
web_1 | await self.app(scope, receive, _send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
web_1 | raise exc from None
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
web_1 | await self.app(scope, receive, sender)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
web_1 | await route.handle(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
web_1 | await self.app(scope, receive, send)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
web_1 | response = await func(request)
web_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
web_1 | raw_response = await run_endpoint_function(
web_1 | File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 150, in run_endpoint_function
web_1 | return await run_in_threadpool(dependant.call, **values)
web_1 | File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
web_1 | return await loop.run_in_executor(None, func, *args)
web_1 | File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
web_1 | result = self.fn(*self.args, **self.kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/views.py", line 103, in create_incident
web_1 | incident = create(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/service.py", line 177, in create
web_1 | reporter_participant = participant_flows.add_participant(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/participant/flows.py", line 26, in add_participant
web_1 | individual = individual_service.get_or_create(db_session=db_session, email=user_email)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/individual/service.py", line 48, in get_or_create
web_1 | individual_info = contact_plugin.instance.get(email, db_session=db_session)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 75, in wrapper
web_1 | return func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 59, in wrapper
web_1 | result = func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/plugin.py", line 203, in get
web_1 | profile = get_user_profile_by_email(self.client, email)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 195, in get_user_profile_by_email
web_1 | user = make_call(client, "users.lookupByEmail", email=email)["user"]
web_1 | File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 329, in wrapped_f
web_1 | return self.call(f, *args, **kw)
web_1 | File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 409, in call
web_1 | do = self.iter(retry_state=retry_state)
web_1 | File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 356, in iter
web_1 | return fut.result()
web_1 | File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 432, in result
web_1 | return self.__get_result()
web_1 | File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
web_1 | raise self._exception
web_1 | File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 412, in call
web_1 | result = fn(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 136, in make_call
web_1 | raise e
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 116, in make_call
web_1 | response = client.api_call(endpoint, http_verb="GET", params=kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 215, in api_call
web_1 | return self._sync_send(api_url=api_url, req_args=req_args)
web_1 | File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 341, in _sync_send
web_1 | return self._urllib_api_call(
web_1 | File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 463, in _urllib_api_call
web_1 | return SlackResponse(
web_1 | File "/usr/local/lib/python3.8/site-packages/slack/web/slack_response.py", line 195, in validate
web_1 | raise e.SlackApiError(message=msg, response=self)
web_1 | slack.errors.SlackApiError: The request to the Slack API failed.
web_1 | The server responded with: {'ok': False, 'error': 'users_not_found'}
web_1 | INFO: 172.18.0.1:42850 - "GET /dashboard HTTP/1.1" 200 OK
web_1 | INFO: 172.18.0.1:42856 - "GET /service-worker.js HTTP/1.1" 304 Not Modified
web_1 | INFO: 172.18.0.1:42856 - "GET /img/icons/android-chrome-192x192.png HTTP/1.1" 200 OK
web_1 | INFO: 172.18.0.1:42848 - "GET /api/v1/incident_priorities/ HTTP/1.1" 200 OK
ERROR: SlackError. Response: {'ok': False, 'error': 'users_not_found'} Endpoint: users.lookupByEmail kwargs: {'email': 'dispatch@example.com'}
dispatch@example.com
is the default user when authentication is disabled: https://hawkins.gitbook.io/dispatch/configuration/app#dispatch_authentication_default_user-default-dispatch-example-com. Unless there's a user in your Slack workspace with this email address, Slack will throw an error. You may want to set DISPATCH_AUTHENTICATION_PROVIDER_SLUG=dispatch-auth-provider-basic in your .env
to use basic email/ password login. Then, Dispatch will use the email you're using to login to find the user in Slack.
@mvilanova:
I think all the components are working now, thanks for all the help.
Few issues I noticed
Every time I move away from the dispatch window I have to go back to the login page to make it work and it does not say I am logged out, it stops working. I checked the token timeout is set to 24hrs.
As soon as I refresh the window, I have to go back to the login page and start.
Also, I noticed the plugins are not getting loaded easily or taking too long.
One last thing, I am seeing this is logs:
INFO: 172.31.39.178:25694 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
INFO: 172.31.39.178:25696 - "GET /api/v1/incidents/16 HTTP/1.1" 200 OK
INFO: 172.31.39.178:25696 - "GET /api/v1/incidents/16 HTTP/1.1" 200 OK
INFO: 172.31.39.178:25696 - "GET /api/v1/individuals/?q=demo+demo HTTP/1.1" 200 OK
INFO: 172.31.39.178:25706 - "GET /api/v1/individuals/?q=demo+demo HTTP/1.1" 200 OK
INFO: 172.31.10.250:39312 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 208, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
KeyError: 'email'
INFO: 172.31.39.178:25696 - "GET /api/v1/individuals/?q=demo+demo HTTP/1.1" 200 OK
INFO: 172.31.39.178:25706 - "GET /api/v1/individuals/?q=demo+demo HTTP/1.1" 200 OK
INFO: 172.31.39.178:25692 - "GET /api/v1/individuals/ HTTP/1.1" 200 OK
INFO: 172.31.39.178:25692 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
@tomarv2 hmm looks like the email
key does not exist inside profile
in your workspace. Could you paste the result of running (await get_user_info_by_id_async(client, user_id))["profile"]
here please?
Stuck on this, i was not seeing it before, any pointers:
eb_1 | INFO: 172.26.0.1:39136 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
web_1 | INFO: 172.26.0.1:39116 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
web_1 | INFO: 172.26.0.1:39136 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 35, in wrapper
web_1 | result = func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 684, in incident_create_flow
web_1 | update_document(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 446, in update_document
web_1 | p.update(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 59, in wrapper
web_1 | result = func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 75, in wrapper
web_1 | return func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/docs/plugin.py", line 112, in update
web_1 | return replace_text(client, document_id, kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/docs/plugin.py", line 30, in replace_text
web_1 | return client.batchUpdate(documentId=document_id, body=body).execute()
web_1 | File "/usr/local/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
web_1 | return wrapped(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 892, in execute
web_1 | resp, content = _retry_request(
web_1 | File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 177, in _retry_request
web_1 | resp, content = http.request(uri, method, *args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/google_auth_httplib2.py", line 186, in request
web_1 | self.credentials.before_request(
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/credentials.py", line 124, in before_request
web_1 | self.refresh(request)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/service_account.py", line 334, in refresh
web_1 | access_token, expiry, _ = _client.jwt_grant(request, self._token_uri, assertion)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 153, in jwt_grant
web_1 | response_data = _token_endpoint_request(request, token_uri, body)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 124, in _token_endpoint_request
web_1 | _handle_error_response(response_body)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 60, in _handle_error_response
web_1 | raise exceptions.RefreshError(error_details, response_body)
web_1 | google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', '{\n "error": "unauthorized_client",\n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."\n}')
web_1 |
I looked at the logs, I think this might be the cause:
while building docker:
ERROR: google-auth 1.16.1 has requirement rsa<4.1,>=3.1.4, but you'll have rsa 4.1 which is incompatible.
and then while starting:
ERROR:dispatch.common.utils.cli:Failed to load plugin google_calendar_conference:Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/dispatch/common/utils/cli.py", line 34, in install_plugins
plugin = ep.load()
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2452, in load
self.require(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2475, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'google-auth'})
pinning it to version: rsa==4.0 worked.
Cool. Is everything working now @tomarv2 ?
I thought, it was some issue with permissions on my side, so I moved to a new setup but still hitting this:
INFO: 172.16.1.93:54438 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
INFO: 172.16.0.29:44736 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.0.29:44736 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.0.29:44736 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.0.29:44764 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
INFO: 172.16.1.93:54438 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.16.0.29:44736 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 35, in wrapper
result = func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 684, in incident_create_flow
update_document(
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 446, in update_document
p.update(
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 59, in wrapper
result = func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 75, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/docs/plugin.py", line 112, in update
return replace_text(client, document_id, kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/docs/plugin.py", line 30, in replace_text
return client.batchUpdate(documentId=document_id, body=body).execute()
File "/usr/local/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 892, in execute
resp, content = _retry_request(
File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 177, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/google_auth_httplib2.py", line 186, in request
self.credentials.before_request(
File "/usr/local/lib/python3.8/site-packages/google/auth/credentials.py", line 124, in before_request
self.refresh(request)
File "/usr/local/lib/python3.8/site-packages/google/oauth2/service_account.py", line 334, in refresh
access_token, expiry, _ = _client.jwt_grant(request, self._token_uri, assertion)
File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 153, in jwt_grant
response_data = _token_endpoint_request(request, token_uri, body)
File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 124, in _token_endpoint_request
_handle_error_response(response_body)
File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 60, in _handle_error_response
raise exceptions.RefreshError(error_details, response_body)
google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', '{\n "error": "unauthorized_client",\n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."\n}')
INFO: 172.16.0.29:44736 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.0.29:44748 - "GET /api/v1/incidents/3 HTTP/1.1" 200 OK
INFO: 172.16.0.29:44736 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.1.93:54438 - "GET /api/v1/incidents/3 HTTP/1.1" 200 OK
INFO: 172.16.0.29:44736 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
I added this, it dint seems to hit it:
@functools.lru_cache()
async def get_user_info_by_id_async(client: Any, user_id: str):
"""Gets profile information about a user by id."""
result = (await get_user_info_by_id_async(client, user_id))
print("=" * 50)
print(result)
print("=" * 50)
return result["profile"]["email"]
few more logs:
INFO: Dispatch Core App: Conversation added to incident
INFO: 172.16.0.29:21280 - "POST /api/v1/events/slack/event HTTP/1.1" 200 OK
INFO: 172.16.0.29:21280 - "POST /api/v1/events/slack/event HTTP/1.1" 200 OK
INFO: 172.16.0.29:21282 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 213, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 183, in get_user_info_by_id_async
result = (await get_user_info_by_id_async(client, user_id))
ValueError: coroutine already executing
INFO: 172.16.1.93:27552 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 213, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 183, in get_user_info_by_id_async
result = (await get_user_info_by_id_async(client, user_id))
ValueError: coroutine already executing
INFO: 172.16.1.93:27540 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 213, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 183, in get_user_info_by_id_async
result = (await get_user_info_by_id_async(client, user_id))
ValueError: coroutine already executing
INFO: 172.16.1.93:27560 - "POST /api/v1/events/slack/event HTTP/1.1" 200 OK
INFO: 172.16.1.93:27560 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 213, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 183, in get_user_info_by_id_async
result = (await get_user_info_by_id_async(client, user_id))
ValueError: coroutine already executing
INFO: 172.16.1.93:27564 - "GET /api/v1/incidents/6 HTTP/1.1" 200 OK
INFO: 172.16.1.93:27564 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.1.93:27576 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.1.93:27578 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.1.93:27566 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.16.1.93:27580 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.16.1.93:27564 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
This google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', '{\n "error": "unauthorized_client",\n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."\n}')
makes me thing that it's an issue on your GCP side.
I have not seen the following before. Did it start when you modify the code? Try removing the outermost parentheses.
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 183, in get_user_info_by_id_async result = (await get_user_info_by_id_async(client, user_id)) ValueError: coroutine already executing
It started after I moved to use basic auth
, just to see if it's even going inside func, added print before the await and if you see the logs, its going inside, but there is an issue with await :
@functools.lru_cache()
async def get_user_info_by_id_async(client: Any, user_id: str):
"""Gets profile information about a user by id."""
print("=" * 50)
print("inside get_user_info_by_id_async")
print("user id:" , user_id)
print("=" * 50)
result = await get_user_info_by_id_async(client, user_id)
print("=" * 50)
print(result)
print("=" * 50)
return result["profile"]["email"]
#return (await make_call_async(client, "users.info", user=user_id))["user"]
INFO: Slack Plugin - Conversation Management: Incident conversation created
INFO: 172.31.26.115:59728 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.31.26.115:59734 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
INFO: Dispatch Core App: Conversation added to incident
INFO: 172.31.26.115:59734 - "POST /api/v1/events/slack/event HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
==================================================
inside get_user_info_by_id_async
user id: U1234567U
==================================================
INFO: 172.31.47.49:4676 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 217, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 187, in get_user_info_by_id_async
result = await get_user_info_by_id_async(client, user_id)
ValueError: coroutine already executing
==================================================
inside get_user_info_by_id_async
user id: U1234567U
==================================================
INFO: 172.31.47.49:4678 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 217, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 187, in get_user_info_by_id_async
result = await get_user_info_by_id_async(client, user_id)
ValueError: coroutine already executing
==================================================
inside get_user_info_by_id_async
user id: U123456R
==================================================
INFO: 172.31.47.49:4680 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 217, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 187, in get_user_info_by_id_async
result = await get_user_info_by_id_async(client, user_id)
ValueError: coroutine already executing
==================================================
inside get_user_info_by_id_async
user id: U123456R
==================================================
INFO: 172.31.47.49:4682 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
await response(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
async for chunk in self.body_iterator:
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
task.result()
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
response = await func(request)
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
return await dependant.call(**values)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 217, in get_user_email_async
return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 187, in get_user_info_by_id_async
result = await get_user_info_by_id_async(client, user_id)
ValueError: coroutine already executing
INFO: 172.31.47.49:4684 - "POST /api/v1/events/slack/event HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.31.26.115:59734 - "POST /api/v1/events/slack/event HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/incidents/5 HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.31.26.115:59734 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
INFO: 172.31.26.115:59728 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 35, in wrapper
result = func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 684, in incident_create_flow
update_document(
File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 446, in update_document
p.update(
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 59, in wrapper
result = func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 75, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/docs/plugin.py", line 112, in update
return replace_text(client, document_id, kwargs)
File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/docs/plugin.py", line 30, in replace_text
return client.batchUpdate(documentId=document_id, body=body).execute()
File "/usr/local/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 892, in execute
resp, content = _retry_request(
File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 177, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/google_auth_httplib2.py", line 186, in request
self.credentials.before_request(
File "/usr/local/lib/python3.8/site-packages/google/auth/credentials.py", line 124, in before_request
self.refresh(request)
File "/usr/local/lib/python3.8/site-packages/google/oauth2/service_account.py", line 334, in refresh
access_token, expiry, _ = _client.jwt_grant(request, self._token_uri, assertion)
File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 153, in jwt_grant
response_data = _token_endpoint_request(request, token_uri, body)
File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 124, in _token_endpoint_request
_handle_error_response(response_body)
File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 60, in _handle_error_response
raise exceptions.RefreshError(error_details, response_body)
google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', '{\n "error": "unauthorized_client",\n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."\n}')
INFO: 172.31.26.115:59716 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.31.26.115:59716 - "GET /api/v1/incidents/5 HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
INFO: 172.31.26.115:59716 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.31.26.115:59712 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
INFO: 172.31.26.115:59716 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
So, If I am updating slack channel for the event its failing, so I am guessing something connecting to slack is having issue
2020-06-10T15:39:45.124-07:00 | INFO: 172.16.1.93:34228 - "GET / HTTP/1.1" 200 OK
-- | --
| 2020-06-10T15:39:45.560-07:00 | INFO: 172.16.0.29:27710 - "GET / HTTP/1.1" 200 OK
| 2020-06-10T15:39:47.187-07:00 | INFO: 172.16.1.93:34230 - "POST /api/v1/events/slack/event HTTP/1.1" 500 Internal Server Error
| 2020-06-10T15:39:47.187-07:00 | ERROR: Exception in ASGI application
| 2020-06-10T15:39:47.187-07:00 | Traceback (most recent call last):
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 385, in run_asgi
| 2020-06-10T15:39:47.187-07:00 | result = await app(self.scope, self.receive, self.send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
| 2020-06-10T15:39:47.187-07:00 | return await self.app(scope, receive, send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
| 2020-06-10T15:39:47.187-07:00 | await self.middleware_stack(scope, receive, send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
| 2020-06-10T15:39:47.187-07:00 | raise exc from None
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
| 2020-06-10T15:39:47.187-07:00 | await self.app(scope, receive, _send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
| 2020-06-10T15:39:47.187-07:00 | await response(scope, receive, send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
| 2020-06-10T15:39:47.187-07:00 | async for chunk in self.body_iterator:
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
| 2020-06-10T15:39:47.187-07:00 | task.result()
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
| 2020-06-10T15:39:47.187-07:00 | await self.app(scope, receive, send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 22, in __call__
| 2020-06-10T15:39:47.187-07:00 | raise exc from None
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/sentry_asgi/middleware.py", line 19, in __call__
| 2020-06-10T15:39:47.187-07:00 | await self.app(scope, receive, send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
| 2020-06-10T15:39:47.187-07:00 | await response(scope, receive, send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
| 2020-06-10T15:39:47.187-07:00 | async for chunk in self.body_iterator:
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
| 2020-06-10T15:39:47.187-07:00 | task.result()
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
| 2020-06-10T15:39:47.187-07:00 | await self.app(scope, receive, send)
| 2020-06-10T15:39:47.187-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 26, in __call__
| 2020-06-10T15:39:47.188-07:00 | await response(scope, receive, send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 197, in __call__
| 2020-06-10T15:39:47.188-07:00 | async for chunk in self.body_iterator:
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 56, in body_stream
| 2020-06-10T15:39:47.188-07:00 | task.result()
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/base.py", line 38, in coro
| 2020-06-10T15:39:47.188-07:00 | await self.app(scope, receive, send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
| 2020-06-10T15:39:47.188-07:00 | raise exc from None
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
| 2020-06-10T15:39:47.188-07:00 | await self.app(scope, receive, sender)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
| 2020-06-10T15:39:47.188-07:00 | await route.handle(scope, receive, send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 376, in handle
| 2020-06-10T15:39:47.188-07:00 | await self.app(scope, receive, send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/fastapi/applications.py", line 146, in __call__
| 2020-06-10T15:39:47.188-07:00 | await super().__call__(scope, receive, send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 102, in __call__
| 2020-06-10T15:39:47.188-07:00 | await self.middleware_stack(scope, receive, send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 181, in __call__
| 2020-06-10T15:39:47.188-07:00 | raise exc from None
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/middleware/errors.py", line 159, in __call__
| 2020-06-10T15:39:47.188-07:00 | await self.app(scope, receive, _send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 82, in __call__
| 2020-06-10T15:39:47.188-07:00 | raise exc from None
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/exceptions.py", line 71, in __call__
| 2020-06-10T15:39:47.188-07:00 | await self.app(scope, receive, sender)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 550, in __call__
| 2020-06-10T15:39:47.188-07:00 | await route.handle(scope, receive, send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 227, in handle
| 2020-06-10T15:39:47.188-07:00 | await self.app(scope, receive, send)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/starlette/routing.py", line 41, in app
| 2020-06-10T15:39:47.188-07:00 | response = await func(request)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 196, in app
| 2020-06-10T15:39:47.188-07:00 | raw_response = await run_endpoint_function(
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 148, in run_endpoint_function
| 2020-06-10T15:39:47.188-07:00 | return await dependant.call(**values)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/views.py", line 865, in handle_event
| 2020-06-10T15:39:47.188-07:00 | user_email = await dispatch_slack_service.get_user_email_async(slack_async_client, user_id)
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 213, in get_user_email_async
| 2020-06-10T15:39:47.188-07:00 | return (await get_user_info_by_id_async(client, user_id))["profile"]["email"]
| 2020-06-10T15:39:47.188-07:00 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_slack/service.py", line 183, in get_user_info_by_id_async
| 2020-06-10T15:39:47.188-07:00 | result = (await get_user_info_by_id_async(client, user_id))
| 2020-06-10T15:39:47.188-07:00 | ValueError: coroutine already executing
| 2020-06-10T15:39:50.840-07:00 | ERROR: Exception in ASGI application
so, even with basic auth
disabled. I am getting this error, I am using develop
branch, I pull changes from this morning and we even gave super-admin permission in gcp to test if it was an issue:
INFO: Slack Plugin - Conversation Management: Incident conversation created
web_1 | INFO: Dispatch Core App: Conversation added to incident
web_1 | INFO: 192.168.176.1:44038 - "GET /api/v1/incidents/2 HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44038 - "GET /api/v1/individuals/?q=dev+dispatch HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44122 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44070 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44038 - "GET /api/v1/individuals/?q=dev+dispatch HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44038 - "GET /api/v1/terms/ HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44070 - "GET /api/v1/tags/ HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44070 - "GET /api/v1/incidents/2 HTTP/1.1" 200 OK
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 35, in wrapper
web_1 | result = func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 684, in incident_create_flow
web_1 | update_document(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/incident/flows.py", line 446, in update_document
web_1 | p.update(
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 59, in wrapper
web_1 | result = func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/decorators.py", line 75, in wrapper
web_1 | return func(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/docs/plugin.py", line 112, in update
web_1 | return replace_text(client, document_id, kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_google/docs/plugin.py", line 30, in replace_text
web_1 | return client.batchUpdate(documentId=document_id, body=body).execute()
web_1 | File "/usr/local/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
web_1 | return wrapped(*args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 892, in execute
web_1 | resp, content = _retry_request(
web_1 | File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 177, in _retry_request
web_1 | resp, content = http.request(uri, method, *args, **kwargs)
web_1 | File "/usr/local/lib/python3.8/site-packages/google_auth_httplib2.py", line 186, in request
web_1 | self.credentials.before_request(
web_1 | File "/usr/local/lib/python3.8/site-packages/google/auth/credentials.py", line 124, in before_request
web_1 | self.refresh(request)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/service_account.py", line 334, in refresh
web_1 | access_token, expiry, _ = _client.jwt_grant(request, self._token_uri, assertion)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 153, in jwt_grant
web_1 | response_data = _token_endpoint_request(request, token_uri, body)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 124, in _token_endpoint_request
web_1 | _handle_error_response(response_body)
web_1 | File "/usr/local/lib/python3.8/site-packages/google/oauth2/_client.py", line 60, in _handle_error_response
web_1 | raise exceptions.RefreshError(error_details, response_body)
web_1 | google.auth.exceptions.RefreshError: ('unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.', '{\n "error": "unauthorized_client",\n "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."\n}')
web_1 |
web_1 | INFO: 192.168.176.1:44122 - "GET /api/v1/individuals/?q=dev+dispatch HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44070 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
web_1 | INFO: 192.168.176.1:44038 - "GET /api/v1/individuals/?q=Varun+Tomar HTTP/1.1" 200 OK
@tomarv2 does your service account's Client ID have access to all the necessary OAuth scopes, and more specifically the ones required by the docs plugin?
See https://developers.google.com/identity/protocols/oauth2/service-account#delegatingauthority and https://developers.google.com/identity/protocols/oauth2/service-account#error-codes
I reverted to the old version from couple of weeks ago and I am not seeing that error, so I guess something in the flow is different.
Let me do some more debugging(print statements).
added few print statement:
incident/flows.py
-> def update_document
and I see its getting all variables
web_1 | --------------------------------------------------
web_1 | document_id: 1abc
web_1 | name: SECOPS-431
web_1 | priority: low
web_1 | status: Active
web_1 | type: i1
web_1 | title: demo101
web_1 | description: demo10
web_1 | commander_fullname: abc
web_1 | conversation_weblink: https://slack.com/app_redirect?channel=abc
web_1 | document_weblink: https://docs.google.com/document/d/abc/edit?usp=drivesdk
web_1 | storage_weblink: https://drive.google.com/drive/folders/abc
web_1 | ticket_weblink: https://xyz.atlassian.net/browse/SECOPS-431
web_1 | conference_weblink: https://meet.google.com/xyz
web_1 | conference_challenge:
web_1 | --------------------------------------------------
@mvilanova finally it worked, i sent a PR, if you feel its right, please merge: https://github.com/Netflix/dispatch/pull/441/files
SO, my old checkout is working, I did a pull from master this morning and it's broken:
The old order that I was using was:
today it is not creating Document, it's erroring: