Skip to content

Gitlab merge request metrics produce connection error #12696

@nvanloon92

Description

@nvanloon92

Describe the bug
Since yesterday, we see the following Connection error for all our merge requests metrics:

Traceback (most recent call last):
File "/home/collector/base_collectors/source_collector.py", line 106, in __safely_get_source_responses
responses = await asyncio.wait_for(self._get_source_responses(api_url), timeout=self._session.timeout.total)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/asyncio/tasks.py", line 488, in wait_for
return await fut
^^^^^^^^^
File "/home/collector/source_collectors/gitlab/merge_requests.py", line 89, in _get_source_responses
approved_field = await self._approved_field(client)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/collector/source_collectors/gitlab/merge_requests.py", line 101, in _approved_field
fields = [field["name"] for field in json["data"]["__type"]["fields"]]
~~~~~~~~~~~~^^^^^^^^^^
KeyError: '__type'

This seems to have something to do with a Gitlab upgrade.

To Reproduce
Steps to reproduce the behaviour:

  1. Click on 'ADD METRIC'
  2. Select 'Merge requests'
  3. Click on 'SOURCES'
  4. Add 'GitLab' as Source type
  5. Enter a GitLab instance URL, private token and project name

Expected behaviour
Number of merge requests should be displayed.

Screenshots

Image

Your environment (please complete the following information):

  • Operating system: -
  • Browser: Chrome v145.0.7632.117
  • Quality-time: v5.48.2
  • Source version: Gitlab v18.9.1

Additional context
Yesterday, our Gitlab was upgraded to version 18.9.1, but I am not entirely sure this error message did pop up earlier on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions