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

Impossible to create a service account when api_key_max_seconds_to_live is set #5293

Open
swoopla opened this issue Nov 22, 2024 · 1 comment
Labels

Comments

@swoopla
Copy link

swoopla commented Nov 22, 2024

What went wrong?

What happened:

  • When api_key_max_seconds_to_live configuration option is set, it's impossible to create a service account on step 2 in Grafana OnCall configuration page. The message is "Number of seconds before expiration should be set".

What did you expect to happen:

  • Create a new token in sa-autogen-OnCall service account with an expiration time
  • Have a process to renew this token

How do we reproduce it?

  1. Open Grafana and set api_key_max_seconds_to_live in default.ini file with a positive value
  2. Restart Grafana
  3. Run Oncall engine containers
  4. Provision the plugin with cURL commands
  5. In Gafana, go to administration > Modules > Plug-ins > Grafana OnCall
  6. Go to step 2 and clic on Re-create button

Grafana OnCall Version

Grafana v11..3.1 and OnCall v1.13.3

Product Area

Other

Grafana OnCall Platform?

Docker

User's Browser?

No response

Anything else to add?

No response

@swoopla swoopla added the bug Something isn't working label Nov 22, 2024
@OuiSouss
Copy link

Hello, I'm working with swoopla

Here's some additional information.

We are on Grafana 11.4.0 and Grafana OnCall 1.13.10.

We've got the value api_key_max_seconds_to_live set to 86400 in our Grafana config.

So, when we are trying to connect Grafana to GrafanaOnCall, we've got this error :

HTTP Response
message "Number of seconds before expiration should be set"

The request done is the following ( extracted as curl from my browser) :

curl 'https://grafana.lab/api/serviceaccounts/34/tokens' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0' -H 'Accept: application/json, text/plain, /' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Referer: https://grafana.lab/plugins/grafana-oncall-app' -H 'content-type: application/json' -H 'x-grafana-device-id: fffffffffffffffffffffffffffff' -H 'x-grafana-org-id: 1' -H 'Origin: https://grafana.lab' -H 'Connection: keep-alive' -H 'Cookie: grafana_session=ffffffffffffffffffffffffff; grafana_session_expiry=1734083792' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Priority: u=4' --data-raw '{"name":"OnCall","role":"Admin"}'

Regards

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

No branches or pull requests

2 participants