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

404 Cannot POST error from GitLab #940

Open
artooro opened this issue May 29, 2024 · 1 comment
Open

404 Cannot POST error from GitLab #940

artooro opened this issue May 29, 2024 · 1 comment

Comments

@artooro
Copy link

artooro commented May 29, 2024

Currently running hookshot v5.3.0.

I configured the GitLab integration and bridged a room using the message.

!hookshot gitlab project https://git.example.com/group/project

It successfully created the webhook in the GitLab project, but when testing it, GitLab gets an HTTP 404 error with a body of

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /hookshot/gitlab/</pre>
</body>
</html>

I have debug logging enabled for hookshot, and the only log message that it outputs is

DEBUG 20:36:18:998 [Webhooks] Verified GitLab request

So I am not finding any errors in hookshot, and bot is making API calls to GitLab successfully, and I haven't been able to figure out why it's responding with a Cannot POST message.

Here are the relevant configs. Of which the generic webhooks are working fine. It's only GitLab that I'm having an issue with.

hookshot config

bridge:
  domain: example.com
  url: http://10.1.2.3:8008
  mediaUrl: https://matrix.example.com
  port: 9993
  bindAddress: 0.0.0.0


gitlab:
  instances:
    git.example.com:
      url: https://git.example.com
  webhook:
    secret: ABCD1234567-ABCD1234567-ABCD1234567
    publicUrl: https://matrix.example.com/hookshot/gitlab/
  userIdPrefix: _gitlab_

generic:
  enabled: true
  enableHttpGet: false
  urlPrefix: https://matrix.example.com/webhook/
  userIdPrefix: _webhooks_
  allowJsTransformationFunctions: false
  waitForComplete: false

feeds:
  enabled: true
  pollConcurrency: 4
  pollIntervalSeconds: 600
  pollTimeoutSeconds: 30

bot:
  displayname: Bot

passFile: /data/passkey.pem

listeners:
  - port: 9000
    bindAddress: 0.0.0.0
    resources:
      - webhooks

logging:
  level: debug

Reverse Proxy config

I'm using Caddy server for the reverse proxy, it has the following config.

matrix.example.com {
  reverse_proxy /_matrix/* localhost:8008
  reverse_proxy /_synapse/client/* localhost:8008

  reverse_proxy /webhook* localhost:9000
  reverse_proxy /hookshot/gitlab* localhost:9000
}

Considering the request is getting to hookshot based on it's DEBUG log entry, I don't think the reverse proxy is the issue.

@artooro
Copy link
Author

artooro commented Jul 8, 2024

Just updated to 5.4.1 2024-06-21 and there is no change.

Hookshot log:

matrix-hookshot-1  | DEBUG 15:38:07:310 [Webhooks] Verified GitLab request

But GitLab shows an error of

Hook executed successfully but returned HTTP 404 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot POST /hookshot/gitlab/</pre> </body> </html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant