mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-26 07:25:51 +03:00
[GH-ISSUE #635] Slack integration returns 404 #460
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#460
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 @Firesphere on GitHub (Apr 11, 2022).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/635
When clicking the button to add a Slack integration, a 404 is returned.
@cuu508 commented on GitHub (Apr 11, 2022):
Are you seeing this on healthchecks.io or on a self-hosted instance?
@Firesphere commented on GitHub (Apr 11, 2022):
This is on a self-hosted test, Docker container.
I've entered the slack Client ID and Secret in the
.env, but I can't seem to find anything in the logs that would indicate what's going wrong@cuu508 commented on GitHub (Apr 11, 2022):
Which URL is returning 404?
@Firesphere commented on GitHub (Apr 11, 2022):
/projects/{project-id}/add_slack_btn@cuu508 commented on GitHub (Apr 11, 2022):
OK, interesting 😬
Just to make sure, are the steps to reproduce:
/projects/{project-id}/integrations/)/projects/{project-id}/add_slack_btnwhich returns 404?What docker image are you using? What Healthchecks version are you using?
@Firesphere commented on GitHub (Apr 11, 2022):
Yes, correct.
Healthchecks 2.0.1
@Firesphere commented on GitHub (Apr 11, 2022):
My Slack ID and Secret are in the
.envfile:(Those are not my actual, nor are they valid, credentials, but in my env, they are, of course)
@Firesphere commented on GitHub (Apr 11, 2022):
This is the error in the logs when I don't run docker as a daemon:
docker-web-1 | [pid: 11|app: 0|req: 4/11] 172.19.0.1 () {60 vars in 1543 bytes} [Mon Apr 11 23:19:03 2022] GET /projects/47c54b36-1181-4291-8d14-7ab10b416e76/add_slack_btn/ => generated 0 bytes in 20 msecs (HTTP/1.1 404) 8 headers in 265 bytes (1 switches on core 0)@Firesphere commented on GitHub (Apr 11, 2022):
Update!
A workaround that does work, surprisingly, is opening the link with middle-click (open in new tab). By doing that, everything seems to work just fine.
Which... is odd, but maybe a lead?
@cuu508 commented on GitHub (Apr 12, 2022):
That is odd indeed. Some more questions:
your.hostname/projects/47c54b36-1181-4291-8d14-7ab10b416e76/add_slack_btn/in browser's address bar, does it load?your.hostname/integrations/add_slack/?@Firesphere commented on GitHub (Apr 12, 2022):
integrations/add_slackshows an information page about slack@Firesphere commented on GitHub (Apr 13, 2022):
Hmmm, turns out that none of the integrations work... Although I got Slack to work, all others give a white page error 404 as well...
Might be something to do with the routing?
update
So, it all works when I don't run the docker container in daemon mode...
@cuu508 commented on GitHub (Apr 14, 2022):
Please make screenshots of Chrome Developer Tools showing 1) a successful and 2) a 404 request, showing all request and response headers. Like so:
@Firesphere commented on GitHub (Apr 17, 2022):
Here you go
@cuu508 commented on GitHub (Apr 17, 2022):
Thanks for all the information!
Unfortunately I still have no clue what precisely is going wrong, but my hunch is that your browser is hitting several instances of the Healthchecks app running with different configuration. For example, if you have multiple load balanced web servers, perhaps one of the servers has old configuration.
Can you reproduce the issue if you run the Docker image locally, on localhost:8000 with no Cloudflare in the mix?
If yes, can you make a minimal reproducible example (a Dockerfile and a command to run it) that demonstrates the issue?
@schambers commented on GitHub (Apr 23, 2022):
I am also experiencing the same issue after installing on a local docker host. Here are screenshots of network in chrome dev tools:
Many of the integrations do this (slack, discord, pushover) although some seem to work fine (microsoft teams, email)
Please let me know if I can provide any more details. I'm hosting healthchecks on a docker host and am maintaing the docker containers via portainer. I started the docker container according to the directions here: https://healthchecks.io/docs/self_hosted_docker/
@schambers commented on GitHub (Apr 23, 2022):
Just saw your previous comment. Attached is the docker-compose.yml that I'm using to start up healthchecks web/db containers on my docker host and my env file (with sensitive settings removed with "redacted")
schambers-healthchecks-io-env.txt
schambers-healthchecks-io-docker-compose.yml.txt
Edit: My gut says it has something to do with the default settings in the .env file. I noticed I left several properties as "http://localhost" even though I'm accessing healthchecks container via IP address. This probably is a red herring. I updated all of these to IP address and there's no change
Edit 2: If it helps, here's the console log from the docker container when clicking on one of the missing integrations:
@cuu508 commented on GitHub (May 16, 2022):
I finally managed to reproduce this one as well. I used the default .env.example file and ran the docker container.
Yep! If the .env file has the following:
Then settings.py will read it in as "" (empty string). But in the "Integrations" page, when deciding whether to show the Discord integration, we test if DISCORD_CLIENT_ID is None.
I just fixed the code to treat both empty strings and None values as "unconfigured, do not show it in the list of available integrations".
As a workaround until next release, in the .env file, you can comment out (or remove altogether) the settings with empty values:
@cuu508 commented on GitHub (May 16, 2022):
PS. I'm still not sure how this can happen. Some integration types, for example webhooks, don't need any configuration and are always available. @Firesphere perhaps you were clicking on different integration types, and the ones you opened with a middle click happened to be the always-working ones?
@Firesphere commented on GitHub (May 16, 2022):
I'm not sure, because I did get the Slack integration working. Even on a brand new Virtualbox Ubuntu 22.04, then setting up docker inside that, this issue occurs
@Firesphere commented on GitHub (May 17, 2022):
Just did a rebuild of the container, all works as it is supposed to. Thanks!