Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Could not initiate rate limits. Unexpected character #47

Open
DonLav opened this issue Sep 8, 2021 · 3 comments
Open

Could not initiate rate limits. Unexpected character #47

DonLav opened this issue Sep 8, 2021 · 3 comments

Comments

@DonLav
Copy link

DonLav commented Sep 8, 2021

Hey, I'm trying to run the export tool with the following command:
java -jar C:\OpsGenieExportUtil-0.23.6.jar --apiKey mykey --opsgenieHost https://mysite.app.eu.opsgenie.com

I then get the following response:
12:27:43.607 [main] INFO com.opsgenie.tools.backup.ExportMain - Export directory path: C:\ 12:27:43.609 [main] INFO com.opsgenie.tools.backup.ExportMain - Opsgenie host: https://mysite.app.eu.opsgenie.com 12:27:44.330 [main] ERROR com.opsgenie.tools.backup.util.BackupUtils - Could not initiate rate limits. Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (String)"<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="robots" content="none"/><meta name="viewport" content=""/><meta name="referrer" content="strict-origin-when-cross-origin"/><base href="/"/><link rel="dns-prefetch" href="https://ajax.googleapis.com"/><link rel="dns-prefetch" href="https://og-frontend-static.eu-central-1.prod.public.atl-paas.net"/><title ng-bind="pageTitle ? pageTitle : 'Opsgenie'"></title><script type="text/javascript">"/"!==window.location.pathname&&"/alert"[truncated 25969 chars]; line: 1, column: 2]

My API key is newly created but has all full permissions. I'm running the command from the same location as the .jar. Any help would be greatly appreciated. Thank you in advance.

@ghost
Copy link

ghost commented Sep 25, 2021

[luis@fedora backups]$ java -jar OpsGenieExportUtil-0.23.6.jar --apiKey ****************** --backupPath /*****************/export  --opsgenieHost https://api.app.eu.opsgenie.com

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
21:38:32.526 [main] INFO  com.opsgenie.tools.backup.ExportMain - Export directory path: /home/luis/dev/opsgenie/backups/export
21:38:32.528 [main] INFO  com.opsgenie.tools.backup.ExportMain - Opsgenie host: https://api.app.eu.opsgenie.com
21:38:33.539 [main] ERROR com.opsgenie.tools.backup.util.BackupUtils - Could not initiate rate limits. Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="robots" content="none"/><meta name="viewport" content=""/><meta name="referrer" content="strict-origin-when-cross-origin"/><base href="/"/><link rel="dns-prefetch" href="https://ajax.googleapis.com"/><link rel="dns-prefetch" href="https://og-frontend-static.eu-central-1.prod.public.atl-paas.net"/><title ng-bind="pageTitle ? pageTitle : 'Opsgenie'"></title><script type="text/javascript">"/"!==window.location.pathname&&"/alert"[truncated 25969 chars]; line: 1, column: 2]

@kristoferlandgren
Copy link

I get the same error, @DonLav did you ever get pass this issue?

@collynes
Copy link

collynes commented Apr 5, 2024

I recently encountered an issue while using this tool where I kept getting the same error message.

In my scenario, I was exporting configurations to another OpsGenie URL. Since I was working on my laptop, I assumed I needed to specify the URL for the new destination.

By default, the --opsgenieHost URL is set to https://api.opsgenie.com. However, as I am located in the EU, my URL appeared different, like https://api.myorg.app.eu.opsgenie.com.

Therefore, my command looked something like this:

java -jar OpsGenieImportUtil-0.23.9.jar --apiKey MY_API_KEY --opsgenieHost https://api.myorg.app.eu.opsgenie.com

Solution:
It turns out, you don't actually need to provide the opsgenieHost parameter. The API Key automatically resolves your project, as indicated in my log:

14:13:42.407 [main] INFO com.opsgenie.tools.backup.ImportMain - Account name is MyOrg

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

No branches or pull requests

3 participants