-
Notifications
You must be signed in to change notification settings - Fork 297
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
Connecting OnCall to seperate HTTPS Grafana instance #3823
Comments
Hi I think it is same as my issue. |
Can you check if it's not similar to #3607 too please ? |
No it is not. |
You may want to try exec into the oncall engine container and use wget/curl to reach the URL. If they have a problem the certificate can't be verified, to get around that you can extend the image and install your certificate, if wget/curl work from inside the same container but oncall does not let us know and we'll investigate further. |
It is quite similar with the only difference that both admin and non-admin user can not access oncall. Non-admin get "User with Admin permission in your organization must sign on and setup OnCall before it can be used" And the admin users get the two mentioned pop ups and the "OnCall was not able to load the current user. Try refreshing the page" Might https be a problem? |
Wget works like a charm inside the root_engine container and I get the index page. Curl doesn't seem to be installed though. |
From inside that container you can also try:
See if our client is correctly using the certificate |
Doesn't seem so: root@OnCall:~# docker exec -it 3d79ab25071d bash
During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
I'm not sure of the exact state of your certificate but it looks like in python requests it is missing the issuer or an intermediate certificate (I think curl works because it can figure this out on its own?). This appears to be how that library works and isn't particular to OnCall. Testing locally with a self signed certificate I see the same issue. To fix it I had to add the public key for the CA and any intermediate CAs to the cacerts used by certifi in the python environment. To do this for OnCall you would need to extend the Dockerfile and append all your CA pem files to Before doing that if you only have 1 root CA that signed this certificate you can test it by copying that file into the container using docker cp and then run a script similar to above:
|
I did that on the go and yes that seems to solve the problem (I got a 200 response). I will have to check on how to modify the docker file for my setup at home, as it would be my first time but I am guessing it won't be too complicated. May I ask if this behavior will be addressed in a release or if the workaround is the way to go to solve it. |
I haven't tested it but it could be easier to copy I don't think we have any immediate plans to handle this through the product/release. If mounting cacert from outside works we can add a entry for it in the docs for using self signed certificates. |
Your suggestion was incredibly helpful and worked perfectly. Initially, I attempted to simply mount my certificate authority into the Docker container, which would have sufficed for my local Grafana instance. However, I overlooked the fact that connecting a Grafana Cloud instance was necessary to utilize the on-call mobile app. Realizing this, I reverted back to your suggestion, as it required including the default CAs as well. I copied the CA out, made the necessary modifications, and then copied it back in (mount it to ensure it could still function after a reboot). As I delved into connecting a Grafana Cloud instance, I encountered another issue, which was already discussed here but it didn't help as the comments are not clear. However, I'll need to evaluate whether proceeding with this approach aligns with my goals, particularly since I'm unsure why a cloud instance is required if I only intend to use it within my local network or VPN. In any case, I'm marking this as resolved, as my original issue has been successfully addressed. Many thanks for your invaluable assistance, @mderynck! |
What went wrong?
What happened:
What did you expect to happen:
How do we reproduce it?
Grafana OnCall Version
docker compose version (latest I guess)
Product Area
Other
Grafana OnCall Platform?
Docker
User's Browser?
Firefox
Anything else to add?
I filterd my logs and see erros about "name not resolved" and "sslerrors":
Examples:
[36mcelery_1 |^[[0m ^[[1;33m2024-02-01 19:12:31,372 source=engine:celery worker=ForkPoolWorker-2 task_id=cb61aaf3-6039-427e-a563-a86e7fbf4fb9 task_name=apps.grafana_plugin.tasks.sync.plugin_sync_organization_async name=apps.grafana_plugin.helpers.client level=WARNING Error connecting to api instance HTTPConnectionPool(host='grafana', port=3000): Max retries exceeded with url: /api/access-control/users/permissions/search?actionPrefix=grafana-oncall-app (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc0b09a25d0>: Failed to establish a new connection: [Errno -2] Name does not resolve')
[[36mcelery_1 |^[[0m ^[[1;33m2024-02-01 19:20:18,584 source=engine:celery worker=ForkPoolWorker-2 task_id=e524768e-a1fc-4460-ae58-cff06f9760ba task_name=apps.grafana_plugin.tasks.sync.plugin_sync_organization_async name=apps.grafana_plugin.helpers.client level=WARNING Error connecting to api instance HTTPSConnectionPool(host='grafana.local.wiesemann.dev', port=443): Max retries exceeded with url: /api/access-control/users/permissions/search?actionPrefix=grafana-oncall-app (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)')))
The host itself has those certificates installed.
The text was updated successfully, but these errors were encountered: