opsgenie / opsgenie-configuration-backup

Backup your OpsGenie account's configuration and restore it later
https://opsgenie.com
Apache License 2.0
28 stars 26 forks source link

Could not initiate rate limits. Forbidden #42

Closed iainelder closed 4 years ago

iainelder commented 4 years ago

I have a daily process to backup my Opsgenie configuration.

Today (2020-04-01) it failed because it was forbidden to make a rate limit request.

The problem first occurred on 2020-03-11.

Info from backup log

+ java -jar /opt/opsgenie/OpsGenieExportUtil-0.23.2.jar --apiKey $OPSGENIE_API_KEY --opsgenieHost https://api.eu.opsgenie.com --backupPath /root/tmp
08:04:26.199 [main] INFO  com.opsgenie.tools.backup.ExportMain - Export directory path: /root/tmp
08:04:26.201 [main] INFO  com.opsgenie.tools.backup.ExportMain - Opsgenie host: https://api.eu.opsgenie.com
08:04:27.067 [main] ERROR com.opsgenie.tools.backup.util.BackupUtils - Could not initiate rate limits. Forbidden

Info from Opsgenie log

Message

WARN APIREQUESTLOG Skipped incoming data. Team API Keys are not authorized to perform this action.

Time

(+02:00) CEST Madrid

2020/04/01 10:04:27.013 (+02:00)

Raw

{
  "_incomingData": {
    "integrationType": "API",
    "_httpParams": {},
    "httpUrl": "/v2/request-limits/",
    "integrationId": "3d4b0f08-e6a8-4c4b-a203-EXAMPLE",
    "incomingDataId": "4c9cd920-be52-4fbc-a46c-EXAMPLE",
    "_httpHeaders": {
      "CloudFront-Viewer-Country": "US",
      "CloudFront-Forwarded-Proto": "https",
      "CloudFront-Is-Tablet-Viewer": "false",
      "CloudFront-Is-Mobile-Viewer": "false",
      "X-Forwarded-Proto": "https",
      "User-Agent": "Apache-HttpClient/4.3.6 (java 1.5)",
      "cloudfront-headers": "...",
      "CloudFront-Is-SmartTV-Viewer": "false",
      "Host": "api.eu.opsgenie.com",
      "Accept-Encoding": "gzip,deflate",
      "X-Forwarded-Port": "443",
      "X-Amzn-Trace-Id": "Root=1-5e844b0a-7a550b7e6c1dfeb0e092922a",
      "Via": "1.1 dd169cfdbbafbb3da513bede6bc6640e.cloudfront.net (CloudFront)",
      "Authorization": "...",
      "X-Amz-Cf-Id": "cBcnTJHY0Yj2xx6C7CLfLa0yyVsXUDGDvM37DR9kgEN9OPC9hD4H9w==",
      "X-Forwarded-For": "34.199.54.113, 70.132.33.68",
      "CloudFront-Is-Desktop-Viewer": "true"
    },
    "ownerTeamId": "8ddd9505-0b00-4cfc-8fa7-EXAMPLE"
  }
}
iainelder commented 4 years ago

Opsgenie support helped me resolve the issue.

The solution:

I'm not sure how it happened, but I was using a team integration API key. By design the team integration API key does not have enough permissions to use the backup tool.

For more information see the Opsgenie API Key Management documentation.