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

jsonData.stackid v1.9.1 Issues #4843

Closed
HenilJainIO opened this issue Aug 17, 2024 · 24 comments
Closed

jsonData.stackid v1.9.1 Issues #4843

HenilJainIO opened this issue Aug 17, 2024 · 24 comments
Labels

Comments

@HenilJainIO
Copy link

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

@VermiumSifell
Copy link

Same issue for me

@VermiumSifell
Copy link

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)

@HenilJainIO
Copy link
Author

Thank you soo much @VermiumSifell
The vv worked!

I wasted hours trying different things

@VermiumSifell
Copy link

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

@drkthunder02
Copy link

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.

@vjm
Copy link

vjm commented Aug 20, 2024

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

@drkthunder02
Copy link

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.

@vjm
Copy link

vjm commented Aug 20, 2024

@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!

@bck01215
Copy link
Contributor

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

@drkthunder02
Copy link

drkthunder02 commented Aug 21, 2024 via email

@bck01215
Copy link
Contributor

bck01215 commented Aug 21, 2024

Where does that environment variable live at?

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

@congbang-le
Copy link

+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

@vashishkov
Copy link

same on v1.9.16

@chrisngene
Copy link

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

@mderynck
Copy link
Contributor

mderynck commented Sep 6, 2024

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

@joeyorlando
Copy link
Contributor

regarding those needing to specify vvX.Y.Z, this should now be patched in v1.9.27 (via #5051)

@senpro-ingwersenk
Copy link

senpro-ingwersenk commented Oct 4, 2024

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)

@c13
Copy link

c13 commented Oct 21, 2024

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

@R-Studio
Copy link

Same issue here:

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

@paltaa
Copy link

paltaa commented Nov 20, 2024

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

@primmayora
Copy link

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

All deployed using helm + argocd

@thoshchenko
Copy link

update grafana to v11.3.1 help me

@thoshchenko
Copy link

but now its just dont connect

@joeyorlando
Copy link
Contributor

See See #4829 (comment)

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