Mintplex-Labs/anything-llm · error · Error

Error uploading logo.

Error message

Error uploading logo.

What it means

Thrown by uploadLogo in the AnythingLLM frontend when POST /api/system/upload-logo (multipart FormData) responds non-2xx, with the fixed message 'Error uploading logo.'. This is an admin-facing system branding route, so besides the file/storage failures it also rejects non-admin sessions with 403.

Solutions

  1. Make sure you are logged in as an admin (or have been granted the branding permission).
  2. Upload a reasonably sized PNG/JPEG/SVG as accepted by the server.
  3. If a reverse proxy fronts the app, raise its request body limit so the multipart upload is not cut off.
  4. Check server logs and the Network status code for storage/permission errors.

Example fix

// before
const { success, error } = await System.uploadLogo(formData);

// after — gate on role and file size first
if (user.role !== 'admin') return showError('Only admins can change the logo');
if (file.size > MAX_LOGO_BYTES) return showError('Logo file is too large');
const { success, error } = await System.uploadLogo(formData);
Defensive patterns

Strategy: validation

Validate before calling

// run before System.uploadLogo
if (user?.role !== 'admin') throw new Error('Only admins can upload a logo');
if (!(file instanceof File) || !file.type.startsWith('image/')) {
  throw new Error('Logo must be an image file');
}

Try / catch

const { success, error } = await System.uploadLogo(formData);
if (!success) {
  showBrandingError(error); // 'Error uploading logo.' — correlate with Network status
  return;
}

Prevention

When it happens

Trigger: A non-admin (e.g. manager/default user) token calling the route (403); a non-image or oversized logo file; unwritable storage output directory on the server (500); expired session (401).

Common situations: A non-admin account trying to brand the instance; a multi-megabyte PNG logo pushed through a proxy with a small client_max_body_size; storage volume permissions changed after a migration.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@20f6d3546c (2026-08-18). Data as JSON: /api/errors/25fcab37635b11ac. Report an issue: GitHub.

Appendix: source

Thrown at frontend/src/models/system.js:325

      headers: baseHeaders(),
    })
      .then((res) => {
        if (!res.ok) throw new Error("Error uploading pfp.");
        return { success: true, error: null };
      })
      .catch((e) => {
        console.log(e);
        return { success: false, error: e.message };
      });
  },
  uploadLogo: async function (formData) {
    return await fetch(`${API_BASE}/system/upload-logo`, {
      method: "POST",
      body: formData,
      headers: baseHeaders(),
    })
      .then((res) => {
        if (!res.ok) throw new Error("Error uploading logo.");
        return { success: true, error: null };
      })
      .catch((e) => {
        console.log(e);
        return { success: false, error: e.message };
      });
  },
  fetchCustomFooterIcons: async function () {
    const cache = window.localStorage.getItem(this.cacheKeys.footerIcons);
    const { data, lastFetched } = cache
      ? safeJsonParse(cache, { data: [], lastFetched: 0 })
      : { data: [], lastFetched: 0 };

    if (!!data && Date.now() - lastFetched < 3_600_000)
      return { footerData: data, error: null };

    const { footerData, error } = await fetch(
      `${API_BASE}/system/footer-data`,

View on GitHub (pinned to 20f6d3546c)