uptime-kuma icon indicating copy to clipboard operation
uptime-kuma copied to clipboard

Discord notification failing with Docker monitor

Open JesusWithPants opened this issue 2 years ago • 8 comments

⚠️ Please verify that this bug has NOT been raised before.

  • [X] I checked and didn't find similar issue

🛡️ Security Policy

Description

Using docker monitor in conjunction with discord notifications results in error:

2022-12-21T09:55:44.132Z [MONITOR] ERROR: Cannot send notification to BCS INC
Error: Error: AxiosError: Request failed with status code 400 {"embeds":["0"]}
    at Discord.throwGeneralAxiosError (/app/server/notification-providers/notification-provider.js:38:15)
    at Discord.send (/app/server/notification-providers/discord.js:116:18)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Function.sendNotification (/app/server/model/monitor.js:939:21)
    at async beat (/app/server/model/monitor.js:615:25)
    at async Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:658:17)

Most likely cause is undefined value for Failing variable (which I assume is passed on to the Discord)

2022-12-21T09:55:23.928Z [MONITOR] WARN: Monitor #16 'BOT | Docker': Failing: undefined | Interval: 20 seconds | Type: docker | Down Count: 4 | Resend Interval: 5

Notification when container goes back UP works, so this seems to be strictly something with DOWN notifications.

👟 Reproduction steps

  1. Monitor Docker container with Discord notifications enabled
  2. Shut down container
  3. Check UptimeKuma logs

👀 Expected behavior

A Discord message to pop-up once notify gets triggered

😓 Actual Behavior

Errors mentioned above in logs

🐻 Uptime-Kuma Version

1.18.5

💻 Operating System and Arch

Debian 10

🌐 Browser

Google Chrome 108.0.5359.124

🐋 Docker Version

No response

🟩 NodeJS Version

No response

📝 Relevant log output

No response

JesusWithPants avatar Dec 21 '22 10:12 JesusWithPants

I have a similar setup as you have posted; discord messages work fine.

Have you used the correct webhook? When setting up the monitor, there is a test button. Whats the output?

rezzorix avatar Dec 21 '22 10:12 rezzorix

image The Test works fine (as shown in pic), the UP notification works fine, it just fails to notify on DOWN

JesusWithPants avatar Dec 21 '22 10:12 JesusWithPants

Related pr: https://github.com/louislam/uptime-kuma/pull/2393

louislam avatar Dec 21 '22 13:12 louislam

Should be re-opened. Same issue with 1.19.2 version

2022-12-28T11:32:49+02:00 [MONITOR] ERROR: Cannot send notification to BCS INC

Error: Error: AxiosError: Request failed with status code 400 {"embeds":["0"]}

    at Discord.throwGeneralAxiosError (/app/server/notification-providers/notification-provider.js:38:15)

    at Discord.send (/app/server/notification-providers/discord.js:116:18)

    at processTicksAndRejections (node:internal/process/task_queues:96:5)

    at async Function.sendNotification (/app/server/model/monitor.js:1096:21)

    at async beat (/app/server/model/monitor.js:658:21)

    at async Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:726:17)

JesusWithPants avatar Dec 28 '22 09:12 JesusWithPants

Double checked, cannot reproduce.

Please provide more info such as detailed steps, Docker version and Node.js version.

image

louislam avatar Dec 28 '22 10:12 louislam

No real detailed steps:

  1. Set up UptimeKuma to monitor container (in this example named BOTBardolph | Docker)
  2. Shut-down said container
  3. See error as described.

NodeJS is latest alpine docker build, Docker:

root@morpheus:~# docker --version
Docker version 20.10.5+dfsg1, build 55c4c88

It could be something I am doing absolutly wrong, but ive tried recreating the container monitor few times - it still keeps failing as above.

JesusWithPants avatar Dec 28 '22 16:12 JesusWithPants

I'm also having this issue.

Milo123459 avatar Dec 29 '22 23:12 Milo123459

I also have this issue. Discord notifications work for Up status, not work for Down status.

10h30 avatar Dec 30 '22 11:12 10h30

@louislam I see you have pushed a commit that is a possible fix for this issue. How can I test this out? The nightly docker image is out of date.

Milo123459 avatar Jan 01 '23 22:01 Milo123459

@louislam I see you have pushed a commit that is a possible fix for this issue. How can I test this out? The nightly docker image is out of date.

Just updated, you can pull the nightly image again.

louislam avatar Jan 02 '23 05:01 louislam

It works!

Do you know when the next release is going to be pushed to latest?

Milo123459 avatar Jan 02 '23 11:01 Milo123459

It works!

Do you know when the next release is going to be pushed to latest?

Thanks, close as solved.

1.19.3 should be released this week.

louislam avatar Jan 02 '23 11:01 louislam

Confirmed as working now with 1.19.3 , thanks!

JesusWithPants avatar Jan 03 '23 12:01 JesusWithPants

I am not getting a "Down/Up" Discord notification, but the test notification sends successfully. I am on version 1.23.11.

Honorme94 avatar Jan 25 '24 01:01 Honorme94

@Honorme94 This is an issue which has been resolved quite a while ago. Your issue is unlikely to be related => please open a new issue with reproduction steps

CommanderStorm avatar Jan 25 '24 02:01 CommanderStorm