gitlab icon indicating copy to clipboard operation
gitlab copied to clipboard

Updated readme

Open daladim opened this issue 3 years ago • 3 comments

A few updates because the readme does not look up-to-date anymore.

Also, I'm not totally sure about my second commit. I first configured a random secret, and maubot would reply HTTP 401 (Unauthorized) to /_matrix/maubot/plugin/gitlab/webhooks.

After I understood where to get the secret, Maubot now replies a 403 (Forbidden). I think that's slightly better, but this still does not work. Am I doing something wrong? (I'm still trying to get the Gitlab bot up and running, but that still isn't working for me).

By the way, I am trying the manual setup of webhooks because the automated !gitlab webhook add https://gitlab.corp.com group/project failed with the following error. Should I open a new issue?

[2021-12-20 17:26:36,618] [[email protected]] Failed to handle command
Traceback (most recent call last):
  File "/data/plugins/xyz.maubot.gitlab-v0.2.0.mbp/gitlab_matrix/util/decorators.py", line 50, in wrapper
    return await func(self, evt, gl=gl, **kwargs)
  File "/data/plugins/xyz.maubot.gitlab-v0.2.0.mbp/gitlab_matrix/commands/webhook.py", line 38, in webhook_add
    project = gl.projects.get(repo)
  File "/usr/lib/python3.9/site-packages/gitlab/v4/objects/projects.py", line 782, in get
    return cast(Project, super().get(id=id, lazy=lazy, **kwargs))
  File "/usr/lib/python3.9/site-packages/gitlab/exceptions.py", line 304, in wrapped_f
    return f(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/gitlab/mixins.py", line 115, in get
    return self._obj_cls(self, server_data)
  File "/usr/lib/python3.9/site-packages/gitlab/base.py", line 56, in __init__
    raise GitlabParsingError(
gitlab.exceptions.GitlabParsingError: Attempted to initialize RESTObject with a non-dictionary value: [{'id': 114, 'description': " .....REDACTED..... {'access_level': 50, 'notification_level': 3}}}]
This likely indicates an incorrect or malformed server response.
[2021-12-20 17:27:04,543] [[email protected].@gitlab_bot:hlab.ems.host] Failed to run handler
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/mautrix/client/syncer.py", line 204, in _catch_errors
    await handler(data)
  File "/opt/maubot/maubot/handlers/command.py", line 108, in __call__
    ok, res = await self.__call_subcommand__(evt, call_args, remaining_val)
  File "/opt/maubot/maubot/handlers/command.py", line 128, in __call_subcommand__
    return True, await subcommand(evt, _existing_args=call_args,
  File "/opt/maubot/maubot/handlers/command.py", line 108, in __call__
    ok, res = await self.__call_subcommand__(evt, call_args, remaining_val)
  File "/opt/maubot/maubot/handlers/command.py", line 128, in __call_subcommand__
    return True, await subcommand(evt, _existing_args=call_args,
  File "/opt/maubot/maubot/handlers/command.py", line 104, in __call__
    ok, remaining_val = await self.__parse_args__(evt, call_args, remaining_val)
  File "/opt/maubot/maubot/handlers/command.py", line 136, in __parse_args__
    remaining_val, call_args[arg.name] = arg.match(remaining_val.strip(), evt=evt,
  File "/data/plugins/xyz.maubot.gitlab-v0.2.0.mbp/gitlab_matrix/util/arguments.py", line 40, in match
    return " ".join(vals[1:]), instance.bot.db.get_login(evt.sender, url_alias=val[0])
  File "/data/plugins/xyz.maubot.gitlab-v0.2.0.mbp/gitlab_matrix/db.py", line 154, in get_login
    row = (s.query(Token)
  File "/usr/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 3500, in one
    raise orm_exc.NoResultFound("No row was found for one()")
sqlalchemy.orm.exc.NoResultFound: No row was found for one()

daladim avatar Dec 20 '21 18:12 daladim

Hook executed successfully but returned HTTP 403 403: Forbidden The bot is not in the room. Please invite @gitlab_bot:hlab.ems.host to the room.`

I changed the room to an ID where the bot actually was, and it now works

daladim avatar Dec 20 '21 18:12 daladim

I've added a line in the Readme so that others will not have the same trouble :-)

daladim avatar Dec 20 '21 18:12 daladim

Just had the same problem! Please accept this PR!

col-panic avatar May 03 '23 08:05 col-panic