[GH-ISSUE #635] Slack integration returns 404 #460

Closed
opened 2026-02-25 23:42:32 +03:00 by kerem · 21 comments
Owner

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.

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.
kerem closed this issue 2026-02-25 23:42:32 +03:00
Author
Owner

@cuu508 commented on GitHub (Apr 11, 2022):

Are you seeing this on healthchecks.io or on a self-hosted instance?

<!-- gh-comment-id:1094525999 --> @cuu508 commented on GitHub (Apr 11, 2022): Are you seeing this on healthchecks.io or on a self-hosted instance?
Author
Owner

@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

<!-- gh-comment-id:1094742041 --> @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
Author
Owner

@cuu508 commented on GitHub (Apr 11, 2022):

Which URL is returning 404?

<!-- gh-comment-id:1094777676 --> @cuu508 commented on GitHub (Apr 11, 2022): Which URL is returning 404?
Author
Owner

@Firesphere commented on GitHub (Apr 11, 2022):

/projects/{project-id}/add_slack_btn

<!-- gh-comment-id:1094886232 --> @Firesphere commented on GitHub (Apr 11, 2022): `/projects/{project-id}/add_slack_btn`
Author
Owner

@cuu508 commented on GitHub (Apr 11, 2022):

OK, interesting 😬
Just to make sure, are the steps to reproduce:

  • you are on the "Integrations" page (/projects/{project-id}/integrations/)
  • you click on "Add Integration" next to Slack
  • the browser navigates to /projects/{project-id}/add_slack_btn which returns 404?

What docker image are you using? What Healthchecks version are you using?

<!-- gh-comment-id:1094904774 --> @cuu508 commented on GitHub (Apr 11, 2022): OK, interesting 😬 Just to make sure, are the steps to reproduce: * you are on the "Integrations" page (`/projects/{project-id}/integrations/`) * you click on "Add Integration" next to Slack * the browser navigates to `/projects/{project-id}/add_slack_btn` which returns 404? What docker image are you using? What Healthchecks version are you using?
Author
Owner

@Firesphere commented on GitHub (Apr 11, 2022):

Yes, correct.

Healthchecks 2.0.1

<!-- gh-comment-id:1095596372 --> @Firesphere commented on GitHub (Apr 11, 2022): Yes, correct. Healthchecks 2.0.1
Author
Owner

@Firesphere commented on GitHub (Apr 11, 2022):

My Slack ID and Secret are in the .env file:

SLACK_CLIENT_ID=123456789.1987654321
SLACK_CLIENT_SECRET=6516813516384dcg8464681638
SLACK_ENABLED=True

(Those are not my actual, nor are they valid, credentials, but in my env, they are, of course)

<!-- gh-comment-id:1095615287 --> @Firesphere commented on GitHub (Apr 11, 2022): My Slack ID and Secret are in the `.env` file: ``` SLACK_CLIENT_ID=123456789.1987654321 SLACK_CLIENT_SECRET=6516813516384dcg8464681638 SLACK_ENABLED=True ``` (Those are not my actual, nor are they valid, credentials, but in my env, they are, of course)
Author
Owner

@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)

<!-- gh-comment-id:1095684881 --> @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)`
Author
Owner

@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?

<!-- gh-comment-id:1095687946 --> @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?
Author
Owner

@cuu508 commented on GitHub (Apr 12, 2022):

That is odd indeed. Some more questions:

  • could there be a browser extension interfering somehow? Can you test the same from a different browser with no extensions?
  • when logged in, if you paste your.hostname/projects/47c54b36-1181-4291-8d14-7ab10b416e76/add_slack_btn/ in browser's address bar, does it load?
  • what do you see when you visit your.hostname/integrations/add_slack/?
  • in developer tools, do you see any JS errors?
<!-- gh-comment-id:1096062850 --> @cuu508 commented on GitHub (Apr 12, 2022): That is odd indeed. Some more questions: * could there be a browser extension interfering somehow? Can you test the same from a different browser with no extensions? * when logged in, if you paste `your.hostname/projects/47c54b36-1181-4291-8d14-7ab10b416e76/add_slack_btn/` in browser's address bar, does it load? * what do you see when you visit `your.hostname/integrations/add_slack/`? * in developer tools, do you see any JS errors?
Author
Owner

@Firesphere commented on GitHub (Apr 12, 2022):

  • Copy-pasting the link works
  • An extension... maybe? I'll have to see what I can test tomorrow (it's 9.30 PM here)
  • integrations/add_slack shows an information page about slack
  • Dev tools only shows
None of the “sha512” hashes in the integrity attribute match the content of the subresource.
<!-- gh-comment-id:1096454077 --> @Firesphere commented on GitHub (Apr 12, 2022): - Copy-pasting the link works - An extension... maybe? I'll have to see what I can test tomorrow (it's 9.30 PM here) - `integrations/add_slack` shows an information page about slack - Dev tools only shows ``` None of the “sha512” hashes in the integrity attribute match the content of the subresource. ```
Author
Owner

@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...

<!-- gh-comment-id:1098500219 --> @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...
Author
Owner

@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:

image

<!-- gh-comment-id:1098744063 --> @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: ![image](https://user-images.githubusercontent.com/661859/163324434-32368d1e-06d6-4307-b801-7de90e2c2e73.png)
Author
Owner

@Firesphere commented on GitHub (Apr 17, 2022):

healthchecks-failure
healthchecks-success

Here you go

<!-- gh-comment-id:1100794670 --> @Firesphere commented on GitHub (Apr 17, 2022): ![healthchecks-failure](https://user-images.githubusercontent.com/680570/163698801-7cfab992-863c-45f5-aeb3-3e2820af2008.png) ![healthchecks-success](https://user-images.githubusercontent.com/680570/163698805-486decea-4c70-478a-aebe-0a3823f97e49.png) Here you go
Author
Owner

@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?

<!-- gh-comment-id:1100927217 --> @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?
Author
Owner

@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/

network-healthchecks-docker

<!-- gh-comment-id:1107355220 --> @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/ ![network-healthchecks-docker](https://user-images.githubusercontent.com/31563/164874474-7f053386-c591-4997-b83e-eed809ce649f.PNG)
Author
Owner

@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:

[pid: 12|app: 0|req: 25/95] CLIENT_IP_REMOVED () {36 vars in 1052 bytes} [Sat Apr 23 04:20:44 2022] GET /projects/PROJECT_UUID_REMOVED/add_slack_btn/ => generated 0 bytes in 1423 msecs (HTTP/1.1 404) 8 headers in 265 bytes (2 switches on core 0)

<!-- gh-comment-id:1107356555 --> @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](https://github.com/healthchecks/healthchecks/files/8546106/schambers-healthchecks-io-env.txt) [schambers-healthchecks-io-docker-compose.yml.txt](https://github.com/healthchecks/healthchecks/files/8546108/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: > [pid: 12|app: 0|req: 25/95] CLIENT_IP_REMOVED () {36 vars in 1052 bytes} [Sat Apr 23 04:20:44 2022] GET /projects/PROJECT_UUID_REMOVED/add_slack_btn/ => generated 0 bytes in 1423 msecs (HTTP/1.1 404) 8 headers in 265 bytes (2 switches on core 0)
Author
Owner

@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.

Edit: My gut says it has something to do with the default settings in the .env file.

Yep! If the .env file has the following:

DISCORD_CLIENT_ID=

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:

# DISCORD_CLIENT_ID=
<!-- gh-comment-id:1127598617 --> @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. > Edit: My gut says it has something to do with the default settings in the .env file. Yep! If the .env file has the following: DISCORD_CLIENT_ID= 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: # DISCORD_CLIENT_ID=
Author
Owner

@cuu508 commented on GitHub (May 16, 2022):

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.

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?

<!-- gh-comment-id:1127601857 --> @cuu508 commented on GitHub (May 16, 2022): > 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. 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?
Author
Owner

@Firesphere commented on GitHub (May 16, 2022):

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.

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?

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

<!-- gh-comment-id:1128167262 --> @Firesphere commented on GitHub (May 16, 2022): > > 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. > > 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? 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
Author
Owner

@Firesphere commented on GitHub (May 17, 2022):

Just did a rebuild of the container, all works as it is supposed to. Thanks!

<!-- gh-comment-id:1128692465 --> @Firesphere commented on GitHub (May 17, 2022): Just did a rebuild of the container, all works as it is supposed to. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#460
No description provided.