Pivotal Knowledge Base

Follow

UAA error seen when sending a notification to everyone endpoint in PCF®

Environment

Product Version
Pivotal Cloud Foundry® (PCF) 1.7.x

 Symptom

The following error is seen when sending a notification to everyone endpoint:

ubuntu@pivotal-ops-manager:~$ uaac curl https://notifications.system.lichen.com/everyone -k -X POST --data '{"kind_id":"system-going-down","text":"The system is going down while we upgrade our storage","html":"<h1>THE SYSTEM IS DOWN</h1><p>The system is going down while we upgrade our storage</p>","subject":"Upgrade to Storage","reply_to":"dzhou@pivotal.io"}'
POST https://notifications.system.lichen.com/everyone
REQUEST BODY: "{"kind_id":"system-going-down","text":"The system is going down while we upgrade our storage","html":"<h1>THE SYSTEM IS DOWN</h1><p>The system is going down while we upgrade our storage</p>","subject":"Upgrade to Storage","reply_to":"dzhou@pivotal.io"}"

500 Internal Server Error
RESPONSE HEADERS:
  Content-Length: 123
  Content-Type: text/plain; charset=utf-8
  Date: Thu, 07 Jul 2016 02:59:19 GMT
  X-Cf-Requestid: 71771fc1-25db-4cb5-7586-0f5b81caa366
  Connection: close
RESPONSE BODY:
{"errors":["UAA Failure: 401 {\"error\":\"invalid_token\",\"error_description\":\"Invalid token (could not decode): \"}"]}

Cause

This is, in fact, a bug with this version of the Notifications API when sending to everyone.

Resolution

The workaround would be to enumerate all orgs and send an org-level email. The steps to do that can be found in this KB article, Send a notification to an organization.

Here is an example at the org level:

ubuntu@pivotal-ops-manager:~$ uaac curl https://notifications.system.lichen.com/organizations/68e6113f-f5bd-4ad9-9881-63107f91964b -k -X POST --data '{"kind_id":"system-going-down","text":"The system is going down while we upgrade our storage","html":"<h1>THE SYSTEM IS DOWN</h1><p>The system is going down while we upgrade our storage</p>","subject":"Upgrade to Storage","reply_to":"dzhou@pivotal.io"}'
POST https://notifications.system.lichen.com/organizations/68e6113f-f5bd-4ad9-9881-63107f91964b
REQUEST BODY: "{"kind_id":"system-going-down","text":"The system is going down while we upgrade our storage","html":"<h1>THE SYSTEM IS DOWN</h1><p>The system is going down while we upgrade our storage</p>","subject":"Upgrade to Storage","reply_to":"dzhou@pivotal.io"}"

200 OK
RESPONSE HEADERS:
  Content-Length: 371
  Content-Type: text/plain; charset=utf-8
  Date: Thu, 07 Jul 2016 06:15:12 GMT
  X-Cf-Requestid: 82f7ec94-90ca-4677-69dd-1087b52b93e1
  Connection: close
RESPONSE BODY:
[{"status":"queued","recipient":"11fc6635-0a06-4629-9d0e-6931fc50c830","notification_id":"ccb99ff7-b330-1807-9afe-6a2d2036abe4","vcap_request_id":"57deedd8-7b0c-4950-47da-e075a6ca18d8"},{"status":"queued","recipient":"3714f579-920f-47a6-8cf3-f6912b94fbb5","notification_id":"4bc36585-5653-9233-cf86-7a716bb9c625","vcap_request_id":"57deedd8-7b0c-4950-47da-e075a6ca18d8"}]
ubuntu@pivotal-ops-manager:~$ 

Please note that unfortunately, in API 2.0 of Notifications, the everyone endpoint feature will be removed.

Additional Information

For further information, please refer to the following resource:

Getting Started with the Notifications Service

Comments

Powered by Zendesk