mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 23:15:49 +03:00
[GH-ISSUE #427] "Invalid macaroon passed" with Matrix Integration #317
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#317
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @markusressel on GitHub (Sep 11, 2020).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/427
Hi there, great project!
I am using the linuxserver/healthchecks docker container to run a self-hosted instance. While the website itself works great, I struggle to get the Matrix integration to work.
The documentation for this is really sparse, so I had a hard time finding out how to go about this. Here are the steps I took:
I ran
inside the docker container of my matrix (synapse) instance to create a new (non-admin) user to be used by the healthchecks instance.
I retrieved the
access_tokenfor this bot my using a login request and observing the response:I set the environment variables:
MATRIX_ACCESS_TOKEN:REALLY_LONG_STRING_OF_CHARACTERS_AND_NUMBERSMATRIX_HOMESERVER:https://matrix.mydomain.com(not the real domain obviously)MATRIX_USER_ID:@healthchecksio:matrix.mydomain.comThen I restarted the healthchecks docker container, opened my project of choice and the integrations page, clicked on "Add Integration" of the Matrix line. There I was prompted to enter a room id, so I
@healthchecksio:matrix.mydomain.comuserI pasted this room id into the healthchecks website field and clicked on "Save Integration".
Then I received this error:
I did a little bit of research, and according to the Matrix
homeserver.yamlconfig the macaroon is:I tried to comment out the
macaroon_secret_key:line, but the error has not changed. I do not understand why the macaroon is even needed for the healthchecks integration. I guess it has something to do with the way theaccess_tokenis created and validated?Any help would be much appreciated.
@cuu508 commented on GitHub (Sep 18, 2020):
Hi @markusressel, thank you for the detailed report tracing your steps!
Can you check if the access token works if you try to join the room manually, using curl?
https://www.matrix.org/docs/guides/client-server-api#joining-a-room-via-an-alias
(that's more or less what Healthchecks does behind the scenes when you click "Save Integration")
@markusressel commented on GitHub (Sep 20, 2020):
@cuu508 Thx for the response.
I am not sure if I need to login before using this curl command, but I get the same error.
Using this (redacted) command:
I get this response:
@cuu508 commented on GitHub (Sep 21, 2020):
Unfortunately I don't have experience with running my own Matrix instance, and cannot help on that front.
Here's what I did for setting up the credentials for the hosted service (IIRC, was a while ago):
I would assume that the
registerandlogincalls give out similar access tokens, but don't know for sure. I suppose this would be one thing to try: run the login API call, grab the returned access token and try joining a room using that access token.@markusressel commented on GitHub (Sep 22, 2020):
Thats pretty much what I did. As I wrote in the first post, I used the login API to get the access token, after I had created this user using the command line utility provided by matrix (synapse).
I did not try to login to the bot account using some normal client, so it may be that this is necessary for full account activation.
Also, I am still not sure if "bot user" refers to some special kind of user, or simply a normal user that is just used by the healthchecks kinda like a bot. Reading your instructions it seems like it is a normal user like every other, however the wording is confusing to me, because afaik "real" Matrix Bots create their users on their own.
I am also unsure about the encryption support of the healthchecks bot implementation. When creating a new room within Element I've been offered to disable/enable encryption, as well as allowing public access to this room. I have tried to disable encryption, but the result is the same. Since I get the error from the curl command I am pretty sure though that this is not an error in healthchecks, but my synapse configuration. I will investigate this further asap.
@cuu508 commented on GitHub (Sep 29, 2020):
@markusressel did you find a solution for this issue (in the synapse configuration or otherwise)?
@markusressel commented on GitHub (Sep 29, 2020):
I have not had the time to investigate this yet. Bare with me please 😄
EDIT:
Not yet sure what the culprit is, but this suggests something about the token is wrong. Either it is not passed correctly to the Matrix server, or the server rejects it. Since the curl also fails I tend to think its the latter.
@P-Takenaka commented on GitHub (Mar 12, 2021):
I had the same error. I solved the issue by not enclosing my matrix environment variables with quotes in my docker compose file, as in
instead of