iam_mr_h
iam_mr_h

Reputation: 11

Grafana OnCall mobile app can’t scan QR-code

I installed grafana and oncall via docker compose on a vps in a private network. Oncall API URL looks like http://oncall:8888 (it is not visible from the internet). Connected in Grafana to oncall backend, alerting works. Next I made a grafana cloud account, added the oncall API URL to docker-compose.yml (GRAFANA_CLOUD_ONCALL_API_URL: https://oncall-prod-eu-west-0.grafana.net/oncall) Added a token in the cloud version, connected using this token in the OSS version. The OSS show me a QR code. And I can’t scan this code with 3 phones. No any errors. Nothing is happened.

Has anyone ever had this? Can I use mobile app by another way?

Should the OSS OnCall backend be visible from the outside? I don’t have it visible and grafana worked fine…

Thank you.

Upvotes: 1

Views: 525

Answers (3)

Zeeshan Shakeel
Zeeshan Shakeel

Reputation: 21

I recently deployed Grafana On-Call (OSS) on AWS and encountered issues with the mobile app signing in. Here's what I experienced:

QR Code Scan Failure: The mobile app wouldn't scan the QR code, essentially doing nothing. Deep Link Sign-In Error: After manual sign-in through the browser, clicking "Connect to Mobile App" resulted in an "Error Signing In" message with a retry button that didn't resolve the issue.

Solution:

These steps fixed the mobile app sign-in problem and enabled push notifications:

1. Configure Base URL: Update grafana.ini with the following:

server:
  base_url_protocol: https
  base_url: oncallurl.domain.com  # No protocol here (already in base_url_protocol)

This ensures the correct base URL configuration for the mobile app.

2. Expose Grafana On-Call Engine: In your Kubernetes or Docker Compose configuration, expose the Grafana On-Call engine service:

spec:
  rules:
  - host: your.external.hostname.com
    http:
      paths:
      - pathType: Prefix
        path: "/grafana"
        backend:
          service:
            name: grafana
            port:
              number: 8080
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: oncall-engine
            port:
              number: 8080

This exposes the engine service on the specified path for communication with the mobile app.

3. Enable Serve from Sub Path:

In grafana.ini, set serve_from_sub_path to true:

    server:
      domain: 'your domain url here'
      serve_from_sub_path: true

After doing this, Apps started signing in & it all worked fine.

Additional Notes:

Replace your.external.hostname.com and oncallurl.domain.com with your actual values. Ensure your firewall rules allow access to the exposed ports.

Upvotes: 1

Christian Ciach
Christian Ciach

Reputation: 183

The cause for me was a missing Ingress definition for the oncall-engine backend. I didn't know that we need to expose the oncall-engine to the internet; I thought the Grafana service was enough.

Make sure to expose the Oncall-Engine and adapt the BASE_URL accordingly:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: grafana
  annotations:
    traefik.ingress.kubernetes.io/router.tls: "true"
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
spec:
  rules:
  - host: your.external.hostname.com
    http:
      paths:
      - pathType: Prefix
        path: "/grafana"
        backend:
          service:
            name: grafana
            port:
              number: 8080
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: oncall-engine
            port:
              number: 8080
BASE_URL=https://your.external.hostname.com

Upvotes: 1

judokan9
judokan9

Reputation: 1

Most likely your phone can't connect to your Oncall backend.

The documentation describes at THIS point that the phone and the backend must be on the same network. Since it is a Docker environment, you may need to open the port of the backend. In the current OSS app version, a light gray "Error" text appears in the lower right corner, which further describes the problem.

Furthermore, you could use another QR code app to determine the content of the code and see which URL should be addressed.

Upvotes: -1

Related Questions