louislam/uptime-kuma · info · Error

Password is too weak, please use a stronger password.

Error message

Password is too weak, please use a stronger password.

What it means

Thrown locally by autoGetTelegramChatID (Telegram.vue:195) when the newest entry in Telegram's bot getUpdates response is an update type the handler does not understand. The code only inspects update.channel_post and update.message, so if the most recent update is a callback_query, edited_message, my_chat_member, chat_member, poll, poll_answer, etc., both branches are skipped and the else branch throws. The surrounding try/catch turns it into a toast, so it is a guided user message, not a runtime failure.

Source

Thrown at extra/reset-password.js:50

                throw new Error("user not found, have you installed?");
            }

            console.log("Found user: " + user.username);

            while (true) {
                let password;
                let confirmPassword;

                // When called with "--new-password" argument for unattended modification (e.g. npm run reset-password -- --new_password=secret)
                if ("new-password" in args) {
                    console.log("Using password from argument");
                    console.warn(
                        "\x1b[31m%s\x1b[0m",
                        "Warning: the password might be stored, in plain text, in your shell's history"
                    );
                    password = confirmPassword = args["new-password"] + "";
                    if (passwordStrength(password).value === "Too weak") {
                        throw new Error("Password is too weak, please use a stronger password.");
                    }
                } else {
                    password = await question("New Password: ");
                    if (passwordStrength(password).value === "Too weak") {
                        console.log("Password is too weak, please try again.");
                        continue;
                    }
                    confirmPassword = await question("Confirm New Password: ");
                }

                if (password === confirmPassword) {
                    if (!("dry-run" in args)) {
                        await User.resetPassword(user.id, password);

                        // Reset all sessions by reset jwt secret
                        await initJWTSecret();

                        // Disconnect all other socket clients of the user

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Send a fresh /start or any text to the bot (or post in the target channel where the bot is a member), then click 'Auto Get' so a message/channel_post is the newest update.
  2. Drain the update queue by calling getUpdates with offset set past the last update_id, or delete the active webhook, then retry Auto Get.
  3. Broaden the handler to also read chat.id from edited_message.chat, my_chat_member.chat, and callback_query.message.chat so other update types still resolve an ID.
  4. Iterate res.data.result from newest to oldest and use the first update that exposes any chat object, rather than only the single last entry.

Example fix

// before
if (update.channel_post) {
    this.$parent.notification.telegramChatID = update.channel_post.chat.id;
} else if (update.message) {
    this.$parent.notification.telegramChatID = update.message.chat.id;
} else {
    throw new Error(this.$t("chatIDNotFound"));
}

// after: accept any update shape that carries a chat id
let chatId =
    update.channel_post?.chat.id ??
    update.message?.chat.id ??
    update.edited_message?.chat.id ??
    update.my_chat_member?.chat.id ??
    update.callback_query?.message?.chat.id;

if (chatId != null) {
    this.$parent.notification.telegramChatID = chatId;
} else {
    throw new Error(this.$t("chatIDNotFound"));
}
Defensive patterns

Strategy: type-guard

Validate before calling

// Confirm a token (and a reachable server URL) exist before polling
if (!this.$parent.notification.telegramBotToken || !this.$parent.notification.telegramBotToken.trim()) {
    this.$root.toastError(this.$t("telegramBotTokenRequired"));
    return;
}
if (!this.$parent.notification.telegramServerUrl) {
    this.$root.toastError(this.$t("telegramServerUrlRequired"));
    return;
}

Type guard

// Narrow a Telegram update to one that exposes a chat.id across the common update types
function hasTelegramChatId(update) {
    return Boolean(
        update?.channel_post?.chat?.id ??
        update?.message?.chat?.id ??
        update?.edited_message?.chat?.id ??
        update?.my_chat_member?.chat?.id ??
        update?.callback_query?.message?.chat?.id
    );
}

const update = res.data.result[res.data.result.length - 1];
if (!hasTelegramChatId(update)) {
    throw new Error(this.$t("chatIDNotFound"));
}

Try / catch

try {
    const res = await axios.get(this.telegramGetUpdatesURL("withToken"));
    const update = res.data?.result?.[res.data.result.length - 1];
    if (!hasTelegramChatId(update)) throw new Error(this.$t("chatIDNotFound"));
    this.$parent.notification.telegramChatID =
        update.channel_post?.chat.id ?? update.message?.chat.id;
} catch (error) {
    const msg = error.response
        ? `${this.$t("chatIDNotFound")} (HTTP ${error.response.status})`
        : error.message;
    this.$root.toastError(msg);
}

Prevention

When it happens

Trigger: Clicking 'Auto Get' next to telegram-chat-id after the bot's latest update is not a plain message or channel_post. Typical last-update shapes that trigger this: my_chat_member (bot added/removed as admin), edited_message (user edited a prior text), callback_query (user tapped an inline button), chat_member (member status change), or a poll update. res.data.result is non-empty but the top item has neither .message nor .channel_post.

Common situations: Telegram group adds the bot and emits my_chat_member, which lands above the earlier /start message. A user edits or pins a message, pushing edited_message on top. A prior getUpdates with offset, or an active webhook, has consumed the genuine messages leaving only status updates. Long-lived bots whose update queue drifted into non-message events.

Related errors


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