louislam/uptime-kuma · error · Error

proxy not found

Error message

proxy not found

What it means

Thrown by Proxy.save during an update (proxyID provided) when no proxy row matches both proxyID and userID. Ownership is enforced via the AND user_id predicate, mirroring Notification.save; a miss means the proxy does not exist or belongs to another user.

Source

Thrown at server/proxy.js:27

class Proxy {
    static SUPPORTED_PROXY_PROTOCOLS = ["http", "https", "socks", "socks5", "socks5h", "socks4"];

    /**
     * Saves and updates given proxy entity
     * @param {object} proxy Proxy to store
     * @param {number} proxyID ID of proxy to update
     * @param {number} userID ID of user the proxy belongs to
     * @returns {Promise<Bean>} Updated proxy
     */
    static async save(proxy, proxyID, userID) {
        let bean;

        if (proxyID) {
            bean = await R.findOne("proxy", " id = ? AND user_id = ? ", [proxyID, userID]);

            if (!bean) {
                throw new Error("proxy not found");
            }
        } else {
            bean = R.dispense("proxy");
        }

        // Make sure given proxy protocol is supported
        if (!this.SUPPORTED_PROXY_PROTOCOLS.includes(proxy.protocol)) {
            throw new Error(`
                Unsupported proxy protocol "${proxy.protocol}.
                Supported protocols are ${this.SUPPORTED_PROXY_PROTOCOLS.join(", ")}."`);
        }

        // When proxy is default update deactivate old default proxy
        if (proxy.default) {
            await R.exec("UPDATE proxy SET `default` = 0 WHERE `default` = 1");
        }

        bean.user_id = userID;

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Reload the proxy list in the UI to get fresh ids and retry.
  2. Verify the proxy row's user_id matches the logged-in user in the DB.
  3. If the proxy was deleted, create a new one instead of editing the stale id.
  4. Check server logs for the exact (proxyID, userID) pair passed to Proxy.save.
Defensive patterns

Strategy: validation

Validate before calling

// Verify ownership before updating a proxy
async function proxyExistsForUser(proxyID, userID) {
    const bean = await R.findOne("proxy", " id = ? AND user_id = ? ", [proxyID, userID]);
    return bean != null;
}
if (proxyID && !(await proxyExistsForUser(proxyID, userID))) {
    throw new Error("proxy not found");
}

Type guard

/** True when a proxy bean was found for the (id, user) pair. */
function isOwnedProxy(bean) { return bean != null; }

Try / catch

try {
    const bean = await R.findOne("proxy", " id = ? AND user_id = ? ", [proxyID, userID]);
    if (!bean) throw new Error("proxy not found");
    // ...proceed with update
} catch (err) { throw err; }

Prevention

When it happens

Trigger: Updating a proxy that was already deleted, stale proxyID in the client, user_id mismatch from a tampered request, or concurrent deletion.

Common situations: Browser holds a proxyID after the row was removed elsewhere, multi-user instance where one user tries to edit another's proxy, or replayed form submission.

Related errors


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