{"record":{"id":"50b994ac3ad84c35","repo":"immich-app/immich","slug":"errors-unable-to-upload-file","errorCode":null,"errorMessage":"errors.unable_to_upload_file","messagePattern":"errors\\.unable_to_upload_file","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/src/lib/utils/file-uploader.ts","lineNumber":231,"sourceCode":"          };\n        }\n      } catch (error) {\n        console.error(`Error calculating sha1 file=${assetFile.name})`, error);\n      }\n    }\n\n    if (!responseData) {\n      const queryParams = asQueryString(authManager.params);\n\n      uploadAssetsStore.updateItem(deviceAssetId, { message: $t('asset_uploading') });\n      const response = await uploadRequest<AssetMediaResponseDto>({\n        url: getBaseUrl() + '/assets' + (queryParams ? `?${queryParams}` : ''),\n        data: formData,\n        onUploadProgress: (event) => uploadAssetsStore.updateProgress(deviceAssetId, event.loaded, event.total),\n      });\n\n      if (![200, 201].includes(response.status)) {\n        throw new Error($t('errors.unable_to_upload_file'));\n      }\n\n      responseData = response.data;\n    }\n\n    if (responseData.status === AssetMediaStatus.Duplicate) {\n      uploadAssetsStore.track('duplicate');\n    } else {\n      uploadAssetsStore.track('success');\n    }\n\n    if (albumId && !authManager.isSharedLink) {\n      uploadAssetsStore.updateItem(deviceAssetId, { message: $t('asset_adding_to_album') });\n      await addAssetsToAlbums([albumId], [responseData.id], { notify: false });\n      uploadAssetsStore.updateItem(deviceAssetId, { message: $t('asset_added_to_album') });\n    }\n\n    uploadAssetsStore.updateItem(deviceAssetId, {","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/web/src/lib/utils/file-uploader.ts#L213-L249","documentation":"Thrown by the web upload pipeline (file-uploader.ts) when the HTTP response from POST /assets has a status code outside [200,201]. The message is the i18n key 'errors.unable_to_upload_file'. The actual server-side reason is in the response body but is not surfaced in this generic client error.","triggerScenarios":"Browser upload where the server returns 4xx/5xx (e.g. 400 bad request, 413 payload too large, 401 unauthorized, 500 server error) for one of the queued asset files.","commonSituations":"Reverse proxy (nginx/Cloudflare) body-size limit smaller than the uploaded file; expired session/cookie; server disk full or upload folder not writable; network interruption returning a proxy error page; rate limiting.","solutions":["Open the browser DevTools Network tab and inspect the /assets response status and body for the real server error.","Raise the reverse-proxy client_max_body_size / proxy body limit to exceed the largest uploaded file (e.g. 1G+).","Re-authenticate if the session expired; check server logs for the matching request.","Verify server disk space and upload directory permissions."],"exampleFix":"// before — nginx\nclient_max_body_size 100m;\n\n# after\nclient_max_body_size 0;   # or a large value > max upload\nproxy_request_buffering off;","handlingStrategy":"try-catch","validationCode":"// pre-flight: ensure file is readable and within allowed size\nif (file.size > MAX_BYTES) { notify('File too large'); return; }","typeGuard":"const isUploadable = (f: File) => f.size > 0 && f.size <= MAX_BYTES && f.type.startsWith('image/');","tryCatchPattern":"try { await uploadFile(file); }\ncatch (e) { if (e.message === $t('errors.unable_to_upload_file')) { /* inspect last response, retry once */ } else throw e; }","preventionTips":["Raise reverse-proxy client_max_body_size above the largest upload.","Show the server response body to the user for actionable diagnosis.","Retry failed uploads with exponential backoff."],"tags":["upload","web","reverse-proxy","i18n","network"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}