{"record":{"id":"ce00af204574d0aa","repo":"Mintplex-Labs/anything-llm","slug":"error-uploading-the-logo","errorCode":null,"errorMessage":"Error uploading the logo.","messagePattern":"Error uploading the logo\\.","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/endpoints/system.js","lineNumber":994,"sourceCode":"      }\n\n      try {\n        const newFilename = await renameLogoFile(request.file.originalname);\n        const existingLogoFilename = await SystemSettings.currentLogoFilename();\n        await removeCustomLogo(existingLogoFilename);\n\n        const { success, error } = await SystemSettings._updateSettings({\n          logo_filename: newFilename,\n        });\n\n        return response.status(success ? 200 : 500).json({\n          message: success\n            ? \"Logo uploaded successfully.\"\n            : error || \"Failed to update with new logo.\",\n        });\n      } catch (error) {\n        console.error(\"Error processing the logo upload:\", error);\n        response.status(500).json({ message: \"Error uploading the logo.\" });\n      }\n    }\n  );\n\n  app.get(\"/system/is-default-logo\", async (_, response) => {\n    try {\n      const currentLogoFilename = await SystemSettings.currentLogoFilename();\n      const isDefaultLogo =\n        !currentLogoFilename || currentLogoFilename === LOGO_FILENAME;\n      response.status(200).json({ isDefaultLogo });\n    } catch (error) {\n      console.error(\"Error processing the logo request:\", error);\n      response.status(500).json({ message: \"Internal server error\" });\n    }\n  });\n\n  app.get(\n    \"/system/remove-logo\",","sourceCodeStart":976,"sourceCodeEnd":1012,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/20f6d3546c1938bfea1ad304f58a592dddcc5948/server/endpoints/system.js#L976-L1012","documentation":"Catch block of POST /system/upload-logo: renaming the logo, removing the old custom logo, or persisting the new logo_filename in SystemSettings threw an exception. The endpoint logs the error and returns this message so the client knows the logo was not replaced.","triggerScenarios":"Thrown at server/endpoints/system.js:980 when the library encounters an invalid state.","commonSituations":"Uploading the custom logo failed while saving or processing the file.","solutions":["Check server logs for the underlying storage error.","Verify the file is a supported image and the storage path is writable, then retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"20f6d3546c1938bfea1ad304f58a592dddcc5948","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}