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

Monitor stucks at PENDING

Open karelkryda opened this issue 2 years ago • 3 comments

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

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

🛡️ Security Policy

Description

Today I had an outage on two services that I monitor. Both services were stuck in the PENDING state and did not go to the DOWN state. Truth be told, both services are of the PUSH type. Unfortunately (thankfully) I didn't have an outage on another type of monitor, so I can't say if it's just PUSH.

Screenshot_20220304-223754_Chrome Screenshot_20220304-223738_Chrome

👟 Reproduction steps

  • Create a push monitor
  • Visit URL to make push online
  • Leave the push without activity

👀 Expected behavior

The monitor should go down after 3 failed attempts

😓 Actual Behavior

Monitor remains in pending state

🐻 Uptime-Kuma Version

1.12.1

💻 Operating System and Arch

Debian 11

🌐 Browser

Latest Google Chrome

🐋 Docker Version

20.10.12

🟩 NodeJS Version

No response

📝 Relevant log output

No response

karelkryda avatar Mar 04 '22 22:03 karelkryda

This ticket is closed but related. I have the same issue.

https://github.com/louislam/uptime-kuma/issues/922

TimothyGillespie avatar Mar 10 '22 00:03 TimothyGillespie

@TimothyGillespie I'm not sure if this is exactly the same issue, but ok.

karelkryda avatar Mar 10 '22 05:03 karelkryda

I don't consider this related to Timothy's. I have same issue. Fresh install. Status shows pending for the monitor, rather than up or down. Nothing to do with notifications.

Edit: In my case, it was internal firewall rules blocking the request in a strange way. Figured one out, trying to figure out another. Basically, confirm you can "wget ipaddress/url" from within the Kuma server. If you can't, got a network issue to figure out.

Or in your case, see if you can make a push request(?) manually from within Kuma server. I don't know how to do that, but you probably will.

DPerkunas avatar Jul 18 '22 19:07 DPerkunas

I can confidently say this was fixed with #1627 and #1428.

Back then, the push code looks like this:

                } else if (this.type === "push") {      // Type: Push
                    const time = R.isoDateTime(dayjs.utc().subtract(this.interval, "second"));

                    let heartbeatCount = await R.count("heartbeat", " monitor_id = ? AND time > ? ", [
                        this.id,
                        time
                    ]);

                    debug("heartbeatCount" + heartbeatCount + " " + time);

                    if (heartbeatCount <= 0) {
                        // Fix #922, since previous heartbeat could be inserted by api, it should get from database
                        previousBeat = await Monitor.getPreviousHeartbeat(this.id);

                        throw new Error("No heartbeat in the time window");
                    } else {
                        // No need to insert successful heartbeat for push type, so end here
                        retries = 0;
                        this.heartbeatInterval = setTimeout(beat, beatInterval * 1000);
                        return;
                    }

heartbeatCount only looks for heartbeats since the last regular interval, and doesn't consider retries. The result is that it counted the last PENDING beat, goes to the else branch and retries keep getting reset to 0.

chakflying avatar Jul 30 '23 20:07 chakflying

@chakflying you are missing a call to action in your descriptions:

@karelkryda (only you or Louis can close issues 😉) I believe this issue has been resolved and you can safely close this issue. The fix for this issue is available after 1.16.1

CommanderStorm avatar Jul 30 '23 20:07 CommanderStorm

Alright, I will try to include that and copy your template if you don't mind ;)

chakflying avatar Jul 30 '23 20:07 chakflying

You're probably right. I'm not aware of having dealt with anything like this recently. I'm closing this issue.

karelkryda avatar Jul 30 '23 20:07 karelkryda

In latest version (1.23.3) also many of my services were down but Uptime Kuma stayed "Pending" state for 12 hours and did not send out alerts.

Maybe send alerts also out if "Pending" is more than 60 minutes?

siimots avatar Oct 26 '23 14:10 siimots

You should open a new issue with detailed debugging information, since the original issue is already fixed.

chakflying avatar Oct 26 '23 15:10 chakflying