oncall icon indicating copy to clipboard operation
oncall copied to clipboard

jsonData.stackid v1.9.1 Issues

Open HenilJainIO opened this issue 1 year ago • 17 comments

What went wrong?

I cloned the new docker-compose to run grafana oncall. On enabling the plugin, it gives me this error. Screenshot 2024-08-17 at 19 12 25

How do we reproduce it?

  1. Open Grafana OnCall Plugin UI
  2. Enable the oncall plugin
  3. It gives me this jsonData.stackid

Grafana OnCall Version

v1.9.1

Product Area

Alert Flow & Configuration

Grafana OnCall Platform?

Docker

User's Browser?

No response

Anything else to add?

No response

HenilJainIO avatar Aug 17 '24 13:08 HenilJainIO

Same issue for me

VermiumSifell avatar Aug 17 '24 17:08 VermiumSifell

As a workaround @HenilJainIO

      GF_INSTALL_PLUGINS: "grafana-oncall-app vv1.9.0"

Specify version like this (yes double vv due to some stupid reason I don't know of)

VermiumSifell avatar Aug 17 '24 17:08 VermiumSifell

Thank you soo much @VermiumSifell The vv worked!

I wasted hours trying different things

HenilJainIO avatar Aug 17 '24 18:08 HenilJainIO

Hopefully the software works for your usecase, it seems quite confusing to manage

VermiumSifell avatar Aug 17 '24 18:08 VermiumSifell

I am not using the docker containers and I get this error as well. Have already spent hours trying different things, but if I do figure something out, I will post it here as well. Can't get the plugins file under provisioning to work either as I don't know where to get the stackId value from.

drkthunder02 avatar Aug 19 '24 08:08 drkthunder02

I am also having this issue with v1.9.6 today.

Downgrading to v1.9.0 gave me a different problem that I was not able to resolve.

Any suggestions on what to do here?

Deployed grafana bitnami helm chart in k8s, version: 11.3.8 grafana oncall helm chart version: 1.7.2

vjm avatar Aug 20 '24 15:08 vjm

I have figured out there is a yaml file buried in the documentation that is an example file with like stackId: 5 as a parameter. I utilized that in the provisioning plugins in file. But before I provisioned the plugin, I built the backend server, as its not well documented in my opinion, but the backend server from what I can tell needs to be running first. Without the backend server, the plugin is useless. Therefore, I got the backend server running first, then setup the plugin. After getting both done it just worked.

Granted, I scrapped adding OnCall to my project as the feature I wanted is only available in a cloud environment, which I am not able to utilize for reasons I don't want to delve into here.

drkthunder02 avatar Aug 20 '24 15:08 drkthunder02

@drkthunder02 thanks for the reply -- are you saying that it's not possible to use this unless you use grafana's cloud environment?

Edit: it seems you're saying that you want to use a specific feature that is not available except in the cloud environment.

let me know if you have an example of how you set up provisioning to get it to work!

vjm avatar Aug 20 '24 15:08 vjm

Setting the env var GF_INSTALL_PLUGINS="grafana-oncall-app vv1.9.0" and then upgrading worked for me.

bck01215 avatar Aug 21 '24 13:08 bck01215

Where does that environment variable live at?

On Wed, Aug 21, 2024 at 8:06 AM Brandon Kauffman @.***> wrote:

Setting the env var GF_INSTALL_PLUGINS="grafana-oncall-app vv1.9.0" and then upgrading worked for me.

— Reply to this email directly, view it on GitHub https://github.com/grafana/oncall/issues/4843#issuecomment-2302012438, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5HABVNNAU65MJGJ4PLZQ3ZSSGGVAVCNFSM6AAAAABMVOBCNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBSGAYTENBTHA . You are receiving this because you were mentioned.Message ID: @.***>

-- Chris Mancuso

When you eliminate the impossible, whatever remains, however improbable, must be the truth. -- Spock

drkthunder02 avatar Aug 21 '24 17:08 drkthunder02

Where does that environment variable live at?

It's on the grafana instance, not the on call engine

bck01215 avatar Aug 21 '24 18:08 bck01215

+1. I got the same issue. In my case, I installed OnCall backend to existing K8s cluster which already have Grafana installed. Then I installed Grafana OnCall Plugin via dashboard and got the stackId issue. Grafana OnCall Version: v1.9.12 Grafana dashboard version: 10.4.3

Log of oncall-engine for the error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/core/handlers/base.py", line 220, in _get_response
    response = response.render()
               ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/template/response.py", line 114, in render
    self.content = self.rendered_content
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rest_framework/response.py", line 74, in rendered_content
    ret = renderer.render(self.data, accepted_media_type, context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rest_framework/renderers.py", line 100, in render
    ret = json.dumps(
          ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rest_framework/utils/json.py", line 25, in dumps
    return json.dumps(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
          ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rest_framework/utils/encoders.py", line 67, in default
    return super().default(obj)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type OnCallError is not JSON serializable

congbang-le avatar Aug 23 '24 10:08 congbang-le

same on v1.9.16

vashishkov avatar Aug 28 '24 06:08 vashishkov

Thanks all for the help, yes installing the older version first and then upgrading worked for me @VermiumSifell

However I also found another work around for someone who wants options and is using postgres. I Noticed the column json_data on table pluggin_settings had the data below and I believe this was causing the error {"onCallApiUrl":"http://engine:8080"}

If you build with the suggested idea of first using old version and then update, i noticed the update process populates the data below which i believe is what that is missing and hence causing the sonData.stackid Issues

{"grafanaUrl":"https://GF-IP:3000/","license":"OpenSource","onCallApiUrl":"http://engine:8080","orgId":100,"stackId":5}

so i noticed, you can go straight to install the current version and then manually edit that column with the above data, replace with your server.

they should resolve this, seems something small

chrisngene avatar Aug 31 '24 13:08 chrisngene

Recently we made some changes to the way Grafana OnCall is initialized. Use 1.9.22, there were quite a few changes along the way from 1.9.0-1.9.22 to get things working.

  • If you are running Grafana 11 and newer you must have externalServiceAccounts feature toggle enabled. This has already been enabled in the docker compose files and helm charts in the oncall repo.
  • Plugin settings must be provided to the plugin using an API call if you are installing for the first time (Note: credentials and hostnames need to be adjusted for your configuration, stackId and orgId are expected to be the listed constants in a self-hosted configuration)
curl -X POST 'http://admin:admin@localhost:3000/api/plugins/grafana-oncall-app/settings' -H "Content-Type: application/json" -d '{"enabled":true, "jsonData":{"stackId":5, "orgId":100, "onCallApiUrl":"http://engine:8080/", "grafanaUrl":"http://grafana:3000/"}}'
  • Once settings are configured use this API call to install:
curl -X POST 'http://admin:admin@localhost:3000/api/plugins/grafana-oncall-app/resources/plugin/install'

Grafana OnCall should now be ready to use. For additional troubleshooting see here

mderynck avatar Sep 06 '24 22:09 mderynck

regarding those needing to specify vvX.Y.Z, this should now be patched in v1.9.27 (via https://github.com/grafana/oncall/pull/5051)

joeyorlando avatar Sep 23 '24 16:09 joeyorlando

Managed to get it solved with:

  • Uninstalling the plugin,
  • Adding the plugin in Version 1.9.0 via the environment variable,
  • Removing and then reconfiguring my OnCall instance using 1.9.0
  • then upgrading.

This change was nowhere in the changelogs and I read those every time I update... unless I overlooked it, but I am quite positive. Also I was upgrading from 1.9.20 to 1.10.1.

I would suggest adding it to the README under the Troubbleshooting section; this easily just cost me two hours... x)

senpro-ingwersenk avatar Oct 04 '24 06:10 senpro-ingwersenk

Same Grafana OSS v11.2.1 (6291d0d714) installed with prometheus-stack helmchart 65.1.1 Grafana OnCall v1.11.1

Reinstalling and upgrading the plugin didn't help

c13 avatar Oct 21 '24 08:10 c13

Same issue here:

  • Grafana OSS v11.3.0-security-01 (installed via Grafana Operator)
  • Grafana OnCall v1.12.1 (installed via Helm chart)

R-Studio avatar Nov 14 '24 12:11 R-Studio

If anyone comes here and need to reset the grafana admin password with a backend that is not sqlite, this is the command:

grafana cli --config /etc/grafana/grafana.ini admin reset-admin-password <your-password>

Run it from inside the grafana container in K8s

paltaa avatar Nov 20 '24 18:11 paltaa

Same issue here: Grafana v11.3.0 (d9455ff7db) Grafana OnCall 1.13.1

All deployed using helm + argocd

primmayora avatar Nov 21 '24 03:11 primmayora

update grafana to v11.3.1 help me

thoshchenko avatar Nov 22 '24 12:11 thoshchenko

but now its just dont connect

thoshchenko avatar Nov 22 '24 12:11 thoshchenko

See See https://github.com/grafana/oncall/issues/4829#issuecomment-2334880368

joeyorlando avatar Nov 30 '24 13:11 joeyorlando