matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

[BUG] Hookshot Webhooks are not generated correctly

Open JustCodeIt4Head opened this issue 3 years ago • 0 comments

Describe the bug We had an Installation running of Matrix with Hookshot and using the Ansible Playbook. After redeploying the known working Playbook, Hookshot Webhooks are not generated correctly, and it seems to be an Issue with the Playbook. Completely reinstalled the VM multiple Times with the same issue. Used another VM on another Server with no Firewall in front and the same Issue appears.

Already opened an Issue with the Hookshot Developer, he says we should ask the Playbook Developer

To Reproduce Following the Installation Guide here: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/prerequisites.md leads to this issue.

`---
# The bare domain name which represents your Matrix identity.
# Matrix user ids for your server will be of the form (`@user:<matrix-domain>`).
#
# Note: this playbook does not touch the server referenced here.
# Installation happens on another server ("matrix.<matrix-domain>").
#
# If you've deployed using the wrong domain, you'll have to run the Uninstalling step,
# because you can't change the Domain after deployment.
#
# Example value: example.com
matrix_domain: domain.tld

# The Matrix homeserver software to install.
# See `roles/matrix-base/defaults/main.yml` for valid options.
matrix_homeserver_implementation: synapse

# A secret used as a base, for generating various other secrets.
# You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`).
matrix_homeserver_generic_secret_key: 'KEY'

# This is something which is provided to Let's Encrypt when retrieving SSL certificates for domains.
#
# In case SSL renewal fails at some point, you'll also get an email notification there.
#
# If you decide to use another method for managing SSL certificates (different than the default Let's Encrypt),
# you won't be required to define this variable (see `docs/configuring-playbook-ssl-certificates.md`).
#
# Example value: [email protected]
#matrix_ssl_lets_encrypt_support_email: ''
#matrix_ssl_retrieval_method: none

matrix_ssl_retrieval_method: manually-managed


# A Postgres password to use for the superuser Postgres user (called `matrix` by default).
#
# The playbook creates additional Postgres users and databases (one for each enabled service)
# using this superuser account.
matrix_postgres_connection_password: 'PASSWORD'

#No Federation
matrix_synapse_federation_enabled: false

# Setting up Hookshot (optional)
matrix_hookshot_enabled: true
#matrix_hookshot_version: 1.5.0
matrix_hookshot_provisioning_enabled: true
matrix_hookshot_provisioning_secret: 'PASSWORD'
#matrix_hookshot_permissions:
#   - actor: "@admin:domain.tld"
#     services:
#       - service: "*"
#         level: admin
matrix_hookshot_gitlab_enabled: false

matrix_dimension_enabled: true
matrix_dimension_admins:
- "@dimension:{{ matrix_domain }}"
- "@USER:{{ matrix_domain }}"
matrix_dimension_access_token: "ATOKEN"

matrix_common_after_systemd_service_start_wait_for_timeout_seconds: 60`

Expected behavior The Hookshot Webhook should work as intended

Matrix Server:

  • OS: Debian 11
  • Architecture amd64

Ansible: If your problem appears to be with Ansible, tell us:

  • where you run Ansible -- Ansible is running on a 2nd Machine with Debian 10
  • what version of Ansible you're running: 2.9.27

Additional context Logfiles from Docker contain the following related to the Webhook: `May 17 15:03:12 debian matrix-nginx-proxy[55071]: 172.18.0.3 - - [17/May/2022:20:03:12 +0000] "OPTIONS /_matrix/media/r0/preview_url?url=https%3A%2F%2Fmatrix.domain.de%2Fhookshot%2Fwebhooks%2F31f0c080-5f81-43a8-bb86-7467900ac216%253C%2Fcode%253E&ts=1652817720000 HTTP/1.0" 204 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36" "x.x.x.x"

May 17 15:03:12 debian matrix-nginx-proxy[55071]: x.x.x.x - - [17/May/2022:20:03:12 +0000] "OPTIONS /_matrix/media/r0/preview_url?url=https%3A%2F%2Fmatrix.domain.de%2Fhookshot%2Fwebhooks%2F31f0c080-5f81-43a8-bb86-7467900ac216%253C%2Fcode%253E&ts=1652817720000 HTTP/2.0" 204 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36" "-"

May 17 15:03:12 debian matrix-nginx-proxy[55071]: 172.18.0.1 - - [17/May/2022:20:03:12 +0000] "GET /hookshot/webhooks/31f0c080-5f81-43a8-bb86-7467900ac216%3C/code%3E HTTP/1.1" 404 181 "-" "Synapse (bot; +https://github.com/matrix-org/synapse)" "-" May 17 15:03:12 debian matrix-synapse[55070]: 2022-05-17 20:03:12,669 - synapse.http.client - 726 - WARNING - GET-463 - Got 404 when downloading https://matrix.domain.de/hookshot/webhooks/31f0c080-5f81-43a8-bb86-7467900ac216%3C/code%3E

May 17 15:03:12 debian matrix-nginx-proxy[55071]: 172.18.0.3 - - [17/May/2022:20:03:12 +0000] "GET /_matrix/media/r0/preview_url?url=https%3A%2F%2Fmatrix.domain.de%2Fhookshot%2Fwebhooks%2F31f0c080-5f81-43a8-bb86-7467900ac216%253C%2Fcode%253E&ts=1652817720000 HTTP/1.0" 502 47 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36" "x.x.x.x"

May 17 15:03:12 debian matrix-nginx-proxy[55071]: x.x.x.x - - [17/May/2022:20:03:12 +0000] "GET /_matrix/media/r0/preview_url?url=https%3A%2F%2Fmatrix.domain.de%2Fhookshot%2Fwebhooks%2F31f0c080-5f81-43a8-bb86-7467900ac216%253C%2Fcode%253E&ts=1652817720000 HTTP/2.0" 502 47 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36" "-"

May 17 15:03:35 debian matrix-nginx-proxy[55071]: x.x.x.x - - [17/May/2022:20:03:35 +0000] "GET /hookshot/webhooks/31f0c080-5f81-43a8-bb86-7467900ac216 HTTP/2.0" 404 159 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36" "-"

May 17 15:04:17 debian matrix-nginx-proxy[55071]: x.x.x.x - - [17/May/2022:20:04:17 +0000] "GET /hookshot/webhooks/31f0c080-5f81-43a8-bb86-7467900ac216 HTTP/2.0" 404 159 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36" "-"`

I think the Issue is: May 17 15:03:12 debian matrix-synapse[55070]: 2022-05-17 20:03:12,669 - synapse.http.client - 726 - WARNING - GET-463 - Got 404 when downloading https://matrix.domain.de/hookshot/webhooks/31f0c080-5f81-43a8-bb86-7467900ac216%3C/code%3E

That the Webhook has this HTML Stuff appending to it "code%3E"

`

EDIT: After talking with the Hookshot developer a bit more, the Issue seems to be with: matrixserver matrix-synapse[34822]: 2022-05-17 14:04:52,684 - synapse.appservice.scheduler - 404 - ERROR - as-sender-matrix-hookshot-1 - Error creating appservice transaction

JustCodeIt4Head avatar May 17 '22 20:05 JustCodeIt4Head