louislam/uptime-kuma · error · Error

The monitor implementation is incorrect, non-UP error must t

Error message

The monitor implementation is incorrect, non-UP error must throw error inside check()

What it means

A contract check for monitor types registered in monitorTypeList (custom/plugin types). After monitorType.check() runs, if bean.status is not UP and the type did not opt into allowCustomStatus, Uptime Kuma treats this as a programmer error: the contract is to either leave status UP or throw an error inside check(), never silently set DOWN/PENDING.

Source

Thrown at server/model/monitor.js:875

                        this.radiusUsername,
                        this.radiusPassword,
                        this.radiusCalledStationId,
                        this.radiusCallingStationId,
                        this.radiusSecret,
                        port,
                        this.interval * 1000 * 0.4
                    );

                    bean.msg = resp.code;
                    bean.status = UP;
                    bean.ping = dayjs().valueOf() - startTime;
                } else if (this.type in UptimeKumaServer.monitorTypeList) {
                    let startTime = dayjs().valueOf();
                    const monitorType = UptimeKumaServer.monitorTypeList[this.type];
                    await monitorType.check(this, bean, UptimeKumaServer.getInstance());

                    if (!monitorType.allowCustomStatus && bean.status !== UP) {
                        throw new Error(
                            "The monitor implementation is incorrect, non-UP error must throw error inside check()"
                        );
                    }

                    if (bean.ping === undefined || bean.ping === null) {
                        bean.ping = dayjs().valueOf() - startTime;
                    }
                } else if (this.type === "kafka-producer") {
                    let startTime = dayjs().valueOf();

                    bean.msg = await kafkaProducerAsync(
                        JSON.parse(this.kafkaProducerBrokers),
                        this.kafkaProducerTopic,
                        this.kafkaProducerMessage,
                        {
                            allowAutoTopicCreation: this.kafkaProducerAllowAutoTopicCreation,
                            ssl: this.kafkaProducerSsl,
                            clientId: `Uptime-Kuma/${version}`,

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. If you author the monitor type, throw an Error inside check() instead of setting bean.status=DOWN
  2. If the type legitimately needs custom statuses, set allowCustomStatus=true on the monitor type definition
  3. If you only consume the plugin, report the bug or upgrade to a fixed version

Example fix

// before
monitorType.check = (monitor, bean, server) => { bean.status = DOWN; };

// after
monitorType.check = (monitor, bean, server) => { throw new Error("container not running"); };
Defensive patterns

Strategy: validation

Validate before calling

// For monitor-type authors: never set a non-UP status silently in check()
class MyType extends MonitorType {
  async check(monitor, bean, server) {
    const ok = await probe(monitor);
    if (!ok) throw new Error("probe failed"); // throw, do not set bean.status = DOWN
    bean.status = UP;
  }
}

Type guard

// If your type genuinely emits custom statuses, opt in
monitorType.allowCustomStatus = true;

Prevention

When it happens

Trigger: A custom monitor type's check() sets bean.status to DOWN or PENDING without throwing, and the type does not set allowCustomStatus=true.

Common situations: Plugin/monitor-type author forgot to throw; monitor type still under development; incompatible plugin version against this Uptime Kuma release.

Related errors


AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12). Data as JSON: /api/errors/b3865a1cad129758. Report an issue: GitHub.