louislam/uptime-kuma · info · Error
user not found, have you installed?
Error message
user not found, have you installed?
What it means
Thrown locally by autoGetBaleChatID (Bale.vue:100) when the Bale bot getUpdates call succeeds but returns an empty result array. With no update entries there is no chat object to read an ID from, so the code cannot auto-fill baleChatID and throws this Error to signal the precondition is unmet. It is caught and displayed as a toast, prompting the user to make the bot receive at least one message first.
Source
Thrown at extra/reset-password.js:32
input: process.stdin,
output: process.stdout,
});
const main = async () => {
if ("dry-run" in args) {
console.log("Dry run mode, no changes will be made.");
}
console.log("Connecting the database");
try {
Database.initDataDir(args);
await Database.connect(false, false, true);
// No need to actually reset the password for testing, just make sure no connection problem. It is ok for now.
if (!process.env.TEST_BACKEND) {
const user = await R.findOne("user");
if (!user) {
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.");View on GitHub (pinned to 6b5ea01557)
Solutions
- Open Bale, start a private chat with the bot (or post once in the target channel where the bot is admin), then click 'Auto Get' again.
- Verify the bot token matches the bot you are messaging - paste it into the baleGetUpdatesURL link shown in the form and confirm the JSON has ok:true with a non-empty result.
- If a webhook is set, remove it via the Bale Bot API deleteWebhook endpoint (or unset it in whatever service set it), then retry getUpdates.
- Strip any leading/trailing whitespace from the pasted token before saving, since a malformed token can yield an unexpected response shape.
Example fix
// before
if (res.data.result.length >= 1) {
// ...extract chat id...
} else {
throw new Error(this.$t("chatIDNotFound"));
}
// after: validate the whole response shape first, give a clearer message
if (!res.data || res.data.ok !== true || !Array.isArray(res.data.result)) {
throw new Error(this.$t("chatIDNotFound"));
}
if (res.data.result.length === 0) {
throw new Error(this.$t("baleNoUpdatesYet"));
} Defensive patterns
Strategy: validation
Validate before calling
// Validate the full response shape BEFORE touching result.length
const res = await axios.get(this.baleGetUpdatesURL("withToken"));
if (!res.data || res.data.ok !== true) {
this.$root.toastError(this.$t("baleTokenInvalid"));
return;
}
if (!Array.isArray(res.data.result) || res.data.result.length === 0) {
this.$root.toastError(this.$t("baleNoUpdatesYet"));
return;
}
// safe to inspect updates here Type guard
// Confirm the getUpdates payload is the expected envelope
function isBaleUpdatesEnvelope(payload) {
return payload != null
&& payload.ok === true
&& Array.isArray(payload.result);
}
if (!isBaleUpdatesEnvelope(res.data)) {
this.$root.toastError(this.$t("chatIDNotFound"));
return;
} Try / catch
try {
const res = await axios.get(this.baleGetUpdatesURL("withToken"));
if (!isBaleUpdatesEnvelope(res.data) || res.data.result.length === 0) {
throw new Error(this.$t("baleNoUpdatesYet"));
}
// ...extract chat id...
} catch (error) {
// Network/4xx/5xx vs empty-result get distinct messages
const msg = error.response
? `${error.message} (HTTP ${error.response.status})`
: error.message;
this.$root.toastError(msg);
} Prevention
- Always message /start to the bot in Bale before invoking Auto Get.
- Open the getUpdates URL shown in the form in a browser first to confirm result is non-empty.
- Do not leave a webhook set on the same bot token you intend to poll with Auto Get.
- Validate the ok flag and that result is an array before checking its length, so an ok:false response does not crash on .length.
When it happens
Trigger: Clicking 'Auto Get' when res.data.result is an empty array (res.data.result.length < 1). This happens when the bot has never received any update, when all updates were already acknowledged via a previous getUpdates call with offset, or when a webhook is currently set on the bot so getUpdates returns nothing (Telegram/Bale Bot API forbids getUpdates while a webhook is active).
Common situations: A newly created Bale bot whose token the user pasted before ever messaging it. A bot with a webhook configured elsewhere (Uptime Kuma's own sender, or another service) so polling returns empty. A token typed for the wrong bot, or trailing whitespace in the token producing an ok:false response whose result field is undefined (then res.data.result.length throws, but when it is a clean empty array this exact branch fires).
Related errors
- user not found, have you installed?
- Invalid db-config.json, it must be an object
- Password is too weak, please use a stronger password.
- SMSEagle API returned error: ${resp.data}
- SMSEagle API returned an empty response
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/f77c5725a7558338.
Report an issue: GitHub.