airwallex / k8s-pod-restart-info-collector

Automated troubleshooting of Kubernetes Pods issues. Collect K8s pod restart reasons, logs, and events automatically.
314 stars 45 forks source link

Sending to Slack channel failed with failed to post webhook: Post "https://hooks.slack.com/services/***": x509: certificate is valid for *.github.com... #17

Closed LIRUILONGS closed 1 year ago

LIRUILONGS commented 1 year ago

After the installation was completed, the test encountered this problem.

Sending to Slack channel failed with failed to post webhook: Post "https://hooks.slack.com/services/***": x509: certificate is valid for *.github.com...

I have checked the information, it may be a time zone problem, but there is no way to change the time zone in the devopsairwallex/k8s-pod-restart-info-collector container, and I don't have any permission to enter the container, and I can't install any tools, is there any other solution, or is there an image that can be sudoed?

I0102 03:32:06.934618       1 controller.go:69] Ignore: metallb-system/speaker-6mwfj restartCount: 7714 > 30
I0102 03:32:12.356664       1 controller.go:64] Update: metallb-system/speaker-6mwfj
┌──[root@vms81.liruilongs.github.io]-[~/ansible/hook]
└─$date
2023年 01月 03日 星期二 11:00:37 CST
/ # date -s "22:12:00"
date: can't set date: Operation not permitted
Tue Jan  3 22:12:00 UTC 2023
/ # date
Tue Jan  3 03:12:24 UTC 2023
/ #
/ # apk add -U tzdata
fetch https://mirrors.aliyun.com/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
SSL certificate subject doesn't match host mirrors.aliyun.com
ERROR: https://mirrors.aliyun.com/alpine/v3.15/main: Permission denied
.....
able8 commented 1 year ago

Checked that I can run the apk add command. But the error maybe a network and DNS issue. The request is hooks.slack.com, but got certificate of github.com Post "https://hooks.slack.com/services/***": x509: certificate is valid for *.github.com

You can run the curl https://hooks.slack.com -v to get more information on the request.

/ # apk add -U tzdata
(1/1) Installing tzdata (2022f-r1)
Executing busybox-1.34.1-r7.trigger
OK: 11 MiB in 20 packages
LIRUILONGS commented 1 year ago

@able8 非常感谢解惑 ^_^ ,尝试了很多方法还是不行,我在宿主机上可以调用 webhook , 在 alpine 和其他的 busybox 显示证书问题,没办法解决,我决定使用 shell 脚本的方式

┌──[root@vms81.liruilongs.github.io]-[~]
└─$curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https://hooks.slack.com/services/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
ok