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

Unable to connect to OnCall engine #5205

Closed
kosfango opened this issue Oct 24, 2024 · 1 comment
Closed

Unable to connect to OnCall engine #5205

kosfango opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working part:API part:auth/teams

Comments

@kosfango
Copy link

kosfango commented Oct 24, 2024

What went wrong?

Grafana Oncall http://10.0.1.26:8888
Grafana 11.2.3 http://10.0.1.26:3000

2024-10-24 10:22:27 source=engine:uwsgi status=200 method=GET path=/api/internal/v1/health/ latency=0.001598 google_trace_id=- protocol=HTTP/1.1 resp_size=221 req_body_size=0
2024-10-24 10:22:27 source=engine:app google_trace_id=none logger=apps.user_management.sync RBAC status org=1 rbac_enabled=False
2024-10-24 10:22:27 source=engine:app google_trace_id=none logger=root outbound latency=0.016752496361732483 status=200 method=HEAD url=http://10.0.168.26:3000/api/org slow=0
2024-10-24 10:22:27 source=engine:app google_trace_id=none logger=root inbound latency=0.119812 status=200 method=POST path=/api/internal/v1/plugin/v2/install user_agent=Go-http-client/1.1 content-length=3948 slow=0
2024-10-24 10:22:27 source=engine:uwsgi status=200 method=POST path=/api/internal/v1/plugin/v2/install latency=0.122875 google_trace_id=- protocol=HTTP/1.1 resp_size=428 req_body_size=3948
2024-10-24 10:22:27 source=engine:app google_trace_id=none logger=root inbound latency=0.000512 status=200 method=GET path=/api/internal/v1/health/ user_agent=Go-http-client/1.1 content-length=0 slow=0
2024-10-24 10:22:27 source=engine:uwsgi status=200 method=GET path=/api/internal/v1/health/ latency=0.001337 google_trace_id=- protocol=HTTP/1.1 resp_size=221 req_body_size=0
2024-10-24 10:22:27 source=engine:app google_trace_id=none logger=apps.social_auth.middlewares SocialAuthAuthCanceledExceptionMiddleware.process_exception: 'NoneType' object has no attribute 'endswith'
2024-10-24 10:22:27 source=engine:app google_trace_id=none logger=django.request Internal Server Error: /api/internal/v1/plugin/v2/status
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 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.12/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.12/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/etc/app/apps/grafana_plugin/views/status_v2.py", line 33, in get
    api_url = create_engine_url("")
              ^^^^^^^^^^^^^^^^^^^^^
  File "/etc/app/common/api_helpers/utils.py", line 96, in create_engine_url
    if not base.endswith("/"):
           ^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'endswith'
2024-10-24 10:22:27 source=engine:app google_trace_id=none logger=root inbound latency=0.024812 status=500 method=GET path=/api/internal/v1/plugin/v2/status user_agent=GrafanaOnCall/1.11.3 content-length=0 slow=0 user_id=16 org_id=1 org_slug=self_hosted_org
2024-10-24 10:22:27 source=engine:uwsgi status=500 method=GET path=/api/internal/v1/plugin/v2/status latency=0.026071 google_trace_id=- protocol=HTTP/1.1 resp_size=385 req_body_size=0

curl backend answer:

    "pluginConnection": {
        "settings": {
            "ok": true
        },
        "service_account_token": {
            "ok": true
        },
            "ok": true
        },
        "grafana_url_from_engine": {
            "ok": false,
            "error": "Not validated"
        },
        "oncall_api_url": {
            "ok": false,
            "error": "Unable to connect to OnCall engine: /api/internal/v1/plugin/v2/status, status code: 500"
        },
        "oncall_token": {
            "ok": false,
            "error": "Not validated"
        }
    },
    "license": "",
    "version": "",
    "currently_undergoing_maintenance_message": "",
    "api_url": ""
}

ENV:

DOMAIN="http://10.0.1.26:8888"
SECRET_KEY="key"
DATABASE_TYPE="sqlite3"
BROKER_TYPE="redis"
REDIS_URI="redis://10.0.1.26:6379/0"
DJANGO_SETTINGS_MODULE="settings.hobby"
CELERY_WORKER_QUEUE="default,critical,long,slack,telegram,webhook,retry,celery,grafana"
CELERY_WORKER_CONCURRENCY="1"
CELERY_WORKER_MAX_TASKS_PER_CHILD="100"
CELERY_WORKER_SHUTDOWN_INTERVAL="65m"
CELERY_WORKER_BEAT_ENABLED="True"
GRAFANA_API_URL="http://10.0.1.26:3000"

How do we reproduce it?

  1. Open Grafana OnCall and do X
  2. Now click button Y
  3. Wait for the browser to crash. Error message says: "Error..."

Grafana OnCall Version

v1.11.3

Product Area

API, Auth

Grafana OnCall Platform?

Docker

User's Browser?

Chrome 109.0.5414.120 (Official Build) (64-bit)

Anything else to add?

No response

@kosfango
Copy link
Author

Seems, I didn't understand variables mapping:
https://github.com/grafana/oncall/blob/dev/docker-compose.yml#L4C3-L4C20
empirically, it's known that variable $DOMAIN is needed for grafana, but in this case I don't understand, why need variable definging in compose file:
BASE_URL: $DOMAIN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working part:API part:auth/teams
Projects
None yet
Development

No branches or pull requests

1 participant