Netflix / dispatch

All of the ad-hoc things you're doing to manage incidents today, done for you, and much more!
Apache License 2.0
5.01k stars 497 forks source link

Viewing incidents in web UI results in JS error: TypeError: n.commander is null #570

Closed 0x4c6565 closed 3 years ago

0x4c6565 commented 4 years ago

Describe the bug When attempting to view incidents in the web UI (Created either via slack or web ui), the following JS error is logged with no incidents returned:

TypeError: n.commander is null

To Reproduce Steps to reproduce the behavior:

  1. Create incident
  2. Attempt to view incidents in web UI

Expected behavior Incidents returned

Screenshots image

Desktop (please complete the following information):

mvilanova commented 4 years ago

Thanks for the report. Can you share your .env file (redact sensitive info) and server logs? Are any of the oncall plugins enabled?

0x4c6565 commented 4 years ago

Please find .env below:

# For configuration details, see: https://hawkins.gitbook.io/dispatch/configuration/app

# General
COMPOSE_PROJECT_NAME=dispatch
DISPATCH_HELP_EMAIL=help@example.com
DISPATCH_HELP_SLACK_CHANNEL=#general
DISPATCH_UI_URL=https://example.com
DISPATCH_AUTHENTICATION_PROVIDER_SLUG="" #dispatch-auth-provider-basic
SECRET_KEY="<redacted>"
DISPATCH_JWT_SECRET="<redacted>"

LOG_LEVEL=DEBUG

# Database
# NOTE: Ensure that DATABASE_CREDENTIALS match the values passed to POSTGRES_USER and POSTGRES_PASSWORD
DATABASE_CREDENTIALS=dispatch:<redacted>
DATABASE_HOSTNAME=postgres
DATABASE_NAME=dispatch
DATABASE_PORT=5432

# Used by postgres docker
POSTGRES_DB=dispatch
POSTGRES_PASSWORD=<redacted>
POSTGRES_USER=dispatch

# Cost
ANNUAL_COST_EMPLOYEE=50000
BUSINESS_HOURS_YEAR=2080

# Incident configuration
INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID=INCIDENT_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT_ID
INCIDENT_ONCALL_SERVICE_ID=None
INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID=INCIDENT_DOCUMENT_INVESTIGATION_SHEET_ID
INCIDENT_FAQ_DOCUMENT_ID=INCIDENT_FAQ_DOCUMENT_ID
INCIDENT_NOTIFICATION_CONVERSATIONS=incidents
INCIDENT_NOTIFICATION_DISTRIBUTION_LISTS=incidents@example.com
INCIDENT_RESOURCE_CONVERSATION_COMMANDS_REFERENCE_DOCUMENT=google-docs-conversation-commands-reference-document
INCIDENT_RESOURCE_FAQ_DOCUMENT=google-docs-faq-document
INCIDENT_RESOURCE_INCIDENT_REVIEW_DOCUMENT=google-docs-incident-review-document
INCIDENT_RESOURCE_INCIDENT_TASK=google-docs-incident-task
INCIDENT_RESOURCE_INVESTIGATION_DOCUMENT=google-docs-investigation-document
INCIDENT_RESOURCE_INVESTIGATION_SHEET=google-docs-investigation-sheet
INCIDENT_RESOURCE_NOTIFICATIONS_GROUP=google-group-participant-notifications-group
INCIDENT_RESOURCE_TACTICAL_GROUP=google-group-participant-tactical-group
INCIDENT_STORAGE_FOLDER_ID=INCIDENT_STORAGE_FOLDER_ID
INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID=INCIDENT_STORAGE_EXECUTIVE_REPORT_FILE_ID
INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID=INCIDENT_STORAGE_INCIDENT_REVIEW_FILE_ID
INCIDENT_STORAGE_RESTRICTED=False

# Plugin configuration
INCIDENT_PLUGIN_CONTACT_SLUG=slack-contact
INCIDENT_PLUGIN_CONVERSATION_SLUG=slack-conversation
INCIDENT_PLUGIN_DOCUMENT_RESOLVER_SLUG=dispatch-document-resolver
INCIDENT_PLUGIN_DOCUMENT_SLUG=google-docs-document
INCIDENT_PLUGIN_EMAIL_SLUG=google-gmail-conversation
INCIDENT_PLUGIN_GROUP_SLUG=group-participant-group
INCIDENT_PLUGIN_PARTICIPANT_SLUG=dispatch-participants
INCIDENT_PLUGIN_STORAGE_SLUG=google-drive-storage
INCIDENT_PLUGIN_TASK_SLUG=google-drive-task
INCIDENT_PLUGIN_TICKET_SLUG=jira-ticket

# Slack
SLACK_APP_USER_SLUG=<redacted>
SLACK_API_BOT_TOKEN=<redacted>
SLACK_SIGNING_SECRET=<redacted>
SLACK_WORKSPACE_NAME=<redacted>.slack.com

# Google
GOOGLE_DEVELOPER_KEY=key
GOOGLE_DOMAIN=site.com
GOOGLE_SERVICE_ACCOUNT_CLIENT_EMAIL=info@example.com
GOOGLE_SERVICE_ACCOUNT_CLIENT_ID=id
GOOGLE_SERVICE_ACCOUNT_DELEGATED_ACCOUNT=account
GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY=key
GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY_ID=id
GOOGLE_SERVICE_ACCOUNT_PROJECT_ID=id

# Jira
JIRA_API_URL=
JIRA_BROWSER_URL=
JIRA_PROJECT_KEY=
JIRA_ISSUE_TYPE_ID=
JIRA_USERNAME=
JIRA_PASSWORD=

# PagerDuty
PAGERDUTY_API_KEY=<redacted>
PAGERDUTY_API_FROM_EMAIL=<redacted>

We imported the example data, which allowed for the incidents page to be viewed, however this issue started when reporting a new incident via slack. There aren't any error-level logs when browsing to the incidents page, just the mentioned js error.

One error that did catch my eye was the following:

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.pagerduty.com/services/P8H....
mvilanova commented 4 years ago

Hi @0x4c6565,

Here are a few things that I've noticed after taking a look at your .env file:

  1. You only need to provide the workspace name in SLACK_WORKSPACE_NAME var. (see https://hawkins.gitbook.io/dispatch/configuration/plugins/configuring-slack#slack_workspace_name-required-secret-true). Remove .slack.com and try again.
  2. Do not add inline comments like in DISPATCH_AUTHENTICATION_PROVIDER_SLUG="" #dispatch-auth-provider-basic , as they'll get included in the env var value.
  3. You not longer need to specify the plugins you want to use in the .env file (e.g. INCIDENT_PLUGIN_CONTACT_SLUG). You enable/ disable them in the /plugins section in the web UI.

Regarding requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.pagerduty.com/services/P8H.... , looks like our test PagerDuty service id (P8H...) made it to the sample data. You can change it in the /services endpoint.

Let me know if you run into any other issues.

0x4c6565 commented 4 years ago

Hi @mvilanova,

Thanks for your reply - I've now made the suggested changes.

From looking at the database, I can see that the new incident is created without a participant with the Incident Commander role. How is an incident commander allocated for an incident?

kevgliss commented 4 years ago

What commit are you running? The incident commander is allocated depending on the oncall plugin that is currently enabled. There is a recent change (still on the develop branch) where we default to the reporter if there is no oncall plugin enabled.

0x4c6565 commented 4 years ago

What commit are you running? The incident commander is allocated depending on the oncall plugin that is currently enabled. There is a recent change (still on the develop branch) where we default to the reporter if there is no oncall plugin enabled.

See below:

[root@dispatch dispatch]# git log
commit 227674e0016247ebfccaf2336aa61c133ae16358 (HEAD -> master, origin/master)

I'll have a play with pagerduty, see if I can get it to play ball :)

0x4c6565 commented 4 years ago

What commit are you running? The incident commander is allocated depending on the oncall plugin that is currently enabled. There is a recent change (still on the develop branch) where we default to the reporter if there is no oncall plugin enabled.

See below:

[root@dispatch dispatch]# git log
commit 227674e0016247ebfccaf2336aa61c133ae16358 (HEAD -> master, origin/master)

I'll have a play with pagerduty, see if I can get it to play ball :)

I've configured the external ID correctly on the service now, however the reported js error is still occurring when an incident isn't created correctly. We received the following error when reporting an incident:

web_1        | DEBUG:https://api.pagerduty.com:443 "POST /incidents HTTP/1.1" 400 60:/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:_make_request:433
web_1        | INFO:     78.137.119.4:56344 - "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 390, 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 111, 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 228, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 220, in stream_response
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 228, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 220, in stream_response
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 228, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 220, in stream_response
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 566, 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 179, in __call__
web_1        |     await super().__call__(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 111, 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 566, 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 182, in app
web_1        |     raw_response = await run_endpoint_function(
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 135, 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 111, in create_incident
web_1        |     incident = create(
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/incident/service.py", line 200, in create
web_1        |     incident_commander_email = resolve_incident_commander_email(
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/incident/service.py", line 47, in resolve_incident_commander_email
web_1        |     p.instance.page(
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_pagerduty/plugin.py", line 37, in page
web_1        |     return page_oncall(service_id, incident_name, incident_title, incident_description)
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_pagerduty/service.py", line 68, in page_oncall
web_1        |     incident = pypd.Incident.create(data=data, add_headers={"from": PAGERDUTY_API_FROM_EMAIL})
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/models/entity.py", line 468, in create
web_1        |     inst._set(cls._parse(inst.request(method,
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 120, in request
web_1        |     return self._do_request(
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 72, in _do_request
web_1        |     return self._handle_response(requests_method(*args, **kwargs))
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 48, in _handle_response
web_1        |     raise BadRequest(response.status_code, response.text)
web_1        | pypd.errors.BadRequest: BadRequest (1008): Requester User Not Found
web_1        | ERROR:Exception in ASGI application
web_1        | :/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py:run_asgi:393
web_1        | Traceback (most recent call last):
web_1        |   File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 390, 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 111, 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 228, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 220, in stream_response
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 228, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 220, in stream_response
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 228, in __call__
web_1        |     await run_until_first_complete(
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in run_until_first_complete
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 18, in <listcomp>
web_1        |     [task.result() for task in done]
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/responses.py", line 220, in stream_response
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 566, 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 179, in __call__
web_1        |     await super().__call__(scope, receive, send)
web_1        |   File "/usr/local/lib/python3.8/site-packages/starlette/applications.py", line 111, 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 566, 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 182, in app
web_1        |     raw_response = await run_endpoint_function(
web_1        |   File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 135, 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 111, in create_incident
web_1        |     incident = create(
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/incident/service.py", line 200, in create
web_1        |     incident_commander_email = resolve_incident_commander_email(
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/incident/service.py", line 47, in resolve_incident_commander_email
web_1        |     p.instance.page(
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_pagerduty/plugin.py", line 37, in page
web_1        |     return page_oncall(service_id, incident_name, incident_title, incident_description)
web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_pagerduty/service.py", line 68, in page_oncall
web_1        |     incident = pypd.Incident.create(data=data, add_headers={"from": PAGERDUTY_API_FROM_EMAIL})
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/models/entity.py", line 468, in create
web_1        |     inst._set(cls._parse(inst.request(method,
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 120, in request
web_1        |     return self._do_request(
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 72, in _do_request
web_1        |     return self._handle_response(requests_method(*args, **kwargs))
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 48, in _handle_response
web_1        |     raise BadRequest(response.status_code, response.text)
web_1        | pypd.errors.BadRequest: BadRequest (1008): Requester User Not Found
mvilanova commented 4 years ago

@0x4c6565 did you set the PAGERDUTY_API_FROM_EMAIL var in your .env? Does a user with that email exist in your PagerDuty organization?

web_1        |   File "/usr/local/lib/python3.8/site-packages/dispatch/plugins/dispatch_pagerduty/service.py", line 68, in page_oncall
web_1        |     incident = pypd.Incident.create(data=data, add_headers={"from": PAGERDUTY_API_FROM_EMAIL})
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/models/entity.py", line 468, in create
web_1        |     inst._set(cls._parse(inst.request(method,
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 120, in request
web_1        |     return self._do_request(
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 72, in _do_request
web_1        |     return self._handle_response(requests_method(*args, **kwargs))
web_1        |   File "/usr/local/lib/python3.8/site-packages/pypd/mixins.py", line 48, in _handle_response
web_1        |     raise BadRequest(response.status_code, response.text)
web_1        | pypd.errors.BadRequest: BadRequest (1008): Requester User Not Found