oncall
oncall copied to clipboard
connect oncall to grafana doesn´t work.it shows 403 error.
Hi all!!
I can`t connect oncall in grafana. Follow all steps, but insert token , oncall engine url and grafana url in their texts box : https://snipboard.io/amcAK4.jpg
it shows 403 error.
https://snipboard.io/dm8Is6.jpg
¿ can somebody help me ?
added screens from links to context


Hi @manolooon! Two things could help:
- Restarting Grafana
- Issuing new "Invite token"
Hi @Matvey-Kuk I have a similar problem, can I give a little more details:
2022-09-12 09:20:53 source=engine:app google_trace_id=none logger=root inbound latency=0.051188 status=500 method=POST path=/api/internal/v1/plugin/self-hosted/install content-length=0 slow=0 integration_type=N/A integration_token=N/A
2022-09-12 09:20:53 source=engine:uwsgi status=500 method=POST path=/api/internal/v1/plugin/self-hosted/install latency=0.051927 google_trace_id=- protocol=HTTP/1.1 resp_size=329 req_body_size=0
2022-09-12 09:20:53 source=engine:app google_trace_id=none logger=django.request Internal Server Error: /api/internal/v1/plugin/self-hosted/install
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/mirage/crypto.py", line 83, in encrypt
self.cipher.decrypt(text)
File "/usr/local/lib/python3.9/site-packages/mirage/crypto.py", line 57, in decrypt
decryptor = Cipher(algorithms.AES(self.key), modes.CBC(
File "/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 113, in __init__
mode.validate_for_algorithm(algorithm)
File "/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/ciphers/modes.py", line 84, in _check_iv_and_key_length
_check_iv_length(self, algorithm)
File "/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/ciphers/modes.py", line 75, in _check_iv_length
raise ValueError(
ValueError: Invalid IV size (4) for CBC.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/etc/app/apps/grafana_plugin/views/self_hosted_install.py", line 43, in post
organization = Organization.objects.create(
File "/usr/local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 453, in create
obj.save(force_insert=True, using=self.db)
File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 739, in save
self.save_base(using=using, force_insert=force_insert,
File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 776, in save_base
updated = self._save_table(
File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 881, in _save_table
results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 919, in _do_insert
return manager._insert(
File "/usr/local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1270, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1415, in execute_sql
for sql, params in self.as_sql():
File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1358, in as_sql
value_rows = [
File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1359, in <listcomp>
[self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1359, in <listcomp>
[self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1300, in prepare_value
value = field.get_db_prep_save(value, connection=self.connection)
File "/usr/local/lib/python3.9/site-packages/django/db/models/fields/__init__.py", line 842, in get_db_prep_save
return self.get_db_prep_value(value, connection=connection, prepared=False)
File "/usr/local/lib/python3.9/site-packages/mirage/fields.py", line 19, in get_db_prep_value
encrypted_text = self.crypto.encrypt(value)
File "/usr/local/lib/python3.9/site-packages/mirage/crypto.py", line 86, in encrypt
return self.cipher.encrypt(text)
File "/usr/local/lib/python3.9/site-packages/mirage/crypto.py", line 49, in encrypt
encryptor = Cipher(algorithms.AES(self.key), modes.CBC(
File "/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 113, in __init__
mode.validate_for_algorithm(algorithm)
File "/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/ciphers/modes.py", line 84, in _check_iv_and_key_length
_check_iv_length(self, algorithm)
File "/usr/local/lib/python3.9/site-packages/cryptography/hazmat/primitives/ciphers/modes.py", line 75, in _check_iv_length
raise ValueError(
ValueError: Invalid IV size (4) for CBC.
2022-09-12 09:20:53 source=engine:app google_trace_id=none logger=root inbound latency=0.059579 status=500 method=POST path=/api/internal/v1/plugin/self-hosted/install content-length=0 slow=0 integration_type=N/A integration_token=N/A
2022-09-12 09:20:53 source=engine:uwsgi status=500 method=POST path=/api/internal/v1/plugin/self-hosted/install latency=0.060322 google_trace_id=- protocol=HTTP/1.1 resp_size=329 req_body_size=0
2022-09-12 09:20:54 source=engine:app google_trace_id=none logger=root inbound latency=0.016508 status=403 method=POST path=/api/internal/v1/plugin/sync content-length=0 slow=0 integration_type=N/A integration_token=N/A
Your two things didn't help.
image version latest: grafana/oncall@sha256:47dc8822213788f992b52764f15cdd8f9fdab35b4499969af10ef7d59be6a099
2022-09-12 10:06:36 *** Starting uWSGI 2.0.20 (64bit) on [Mon Sep 12 10:06:34 2022] ***
2022-09-12 10:06:36 compiled with version: 11.2.1 20220219 on 07 September 2022 11:27:59
2022-09-12 10:06:36 os: Linux-5.18.5-1.el8.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 14 17:07:38 EDT 2022
2022-09-12 10:06:36 nodename: grafana-oncall-testz-5b98bd5d6f-8mfnv
2022-09-12 10:06:36 machine: x86_64
2022-09-12 10:06:36 clock source: unix
2022-09-12 10:06:36 pcre jit disabled
2022-09-12 10:06:36 detected number of CPU cores: 12
2022-09-12 10:06:36 current working directory: /etc/app
2022-09-12 10:06:36 detected binary path: /usr/local/bin/uwsgi
2022-09-12 10:06:36 chdir() to /etc/app
2022-09-12 10:06:36 your memory page size is 4096 bytes
2022-09-12 10:06:36 detected max file descriptor number: 1048576
2022-09-12 10:06:36 lock engine: pthread robust mutexes
2022-09-12 10:06:36 thunder lock: disabled (you can enable it with --thunder-lock)
2022-09-12 10:06:36 uWSGI http bound on 0.0.0.0:8080 fd 9
2022-09-12 10:06:36 uwsgi socket 0 bound to TCP address 127.0.0.1:34647 (port auto-assigned) fd 7
2022-09-12 10:06:36 Python version: 3.9.13 (main, Aug 10 2022, 00:39:17) [GCC 11.2.1 20220219]
2022-09-12 10:06:36 *** Python threads support is disabled. You can enable it with --enable-threads ***
2022-09-12 10:06:36 Python main interpreter initialized at 0x7fac07a0ca90
2022-09-12 10:06:36 your server socket listen backlog is limited to 1024 connections
2022-09-12 10:06:36 your mercy for graceful operations on workers is 60 seconds
2022-09-12 10:06:36 mapped 855306 bytes (835 KB) for 5 cores
2022-09-12 10:06:36 *** Operational MODE: preforking ***
Strangely works locally dev env
Django version 3.2.15, using settings 'settings.dev'
Starting development server at http://0.0.0.0:8080/
source=engine:app google_trace_id=none logger=root inbound latency=0.334152 status=201 method=POST path=/api/internal/v1/plugin/self-hosted/install content-length=0 slow=0 integration_type=N/A integration_token=N/A
[12/Sep/2022 16:04:36] "POST /api/internal/v1/plugin/self-hosted/install HTTP/1.1" 201 285
source=engine:app google_trace_id=none logger=root inbound latency=0.065587 status=202 method=POST path=/api/internal/v1/plugin/sync content-length=0 slow=0 integration_type=N/A integration_token=N/A
[12/Sep/2022 16:04:37] "POST /api/internal/v1/plugin/sync HTTP/1.1" 202 67
source=engine:app google_trace_id=none logger=root inbound latency=0.021375 status=200 method=GET path=/api/internal/v1/plugin/sync content-length= slow=0 integration_type=N/A integration_token=N/A
[12/Sep/2022 16:04:39] "GET /api/internal/v1/plugin/sync HTTP/1.1" 200 60
ValueError: Invalid IV size (4) for CBC.
This is referring to the environment variable MIRAGE_CIPHER_IV, its length should be 16 rather than 4,
In local dev environment it is using a default value for this in the engine/settings/dev.py so likely why it isn't being hit there.
ValueError: Invalid IV size (4) for CBC.
This is referring to the environment variable MIRAGE_CIPHER_IV, its length should be 16 rather than 4,
In local dev environment it is using a default value for this in the engine/settings/dev.py so likely why it isn't being hit there.
Thanks. After I set the variables MIRAGE_SECRET_KEY and MIRAGE_CIPHER_IV it turned out to connect
@manolooon Try to set envs MIRAGE_SECRET_KEY and MIRAGE_CIPHER_IV
Hi @manolooon! Two things could help:
1. Restarting Grafana 2. Issuing new "Invite token"
Hello @Matvey-Kuk !!
I have executed a few times these steps, without sucess.
Thanks! Regards!
@manolooon Try to set envs MIRAGE_SECRET_KEY and MIRAGE_CIPHER_IV
Hello @kmlebedev !
Now I working in other proyect. As soon as posible, will try set theses envs.
Thanks! Regards!
Should be fixed with https://github.com/grafana/oncall/issues/452
Closing as this should be fixed in #624. Feel free to open a new issue if you are still running into this!
Thank you for your help, guys. Adding MIRAGE_SECRET_KEY="xxxxx" MIRAGE_CIPHER_IV="xxxxxx" to .env and restarting the entire stack has helped with initialisation: