{"record":{"id":"f45deb195f7e33d4","repo":"Stirling-Tools/Stirling-PDF","slug":"conversion-timed-out","errorCode":null,"errorMessage":"Conversion timed out","messagePattern":"Conversion timed out","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/editor/src/core/tools/pdfTextEditor/PdfTextEditor.tsx","lineNumber":831,"sourceCode":"                : undefined;\n              console.error(\"Poll error details:\", {\n                status,\n                data: isAxiosError(pollError)\n                  ? pollError.response?.data\n                  : undefined,\n                message:\n                  pollError instanceof Error ? pollError.message : undefined,\n              });\n              if (status === 404) {\n                throw new Error(\"Job not found on server\", {\n                  cause: pollError,\n                });\n              }\n            }\n          }\n\n          if (!jobComplete) {\n            throw new Error(\"Conversion timed out\");\n          }\n          if (!parsed) {\n            throw new Error(\"Conversion did not return JSON content\");\n          }\n        } else {\n          const content = await file.text();\n          const docResult = JSON.parse(content) as PdfJsonDocument;\n          parsed = {\n            ...docResult,\n            pages: docResult.pages ?? [],\n          };\n          shouldUseLazyMode = false;\n          pendingJobId = null;\n        }\n\n        setConversionProgress(null);\n\n        if (loadRequestIdRef.current !== requestId) {","sourceCodeStart":813,"sourceCodeEnd":849,"githubUrl":"https://github.com/Stirling-Tools/Stirling-PDF/blob/9ef20dcab80b85041912f045e17a6aea1d08f969/frontend/editor/src/core/tools/pdfTextEditor/PdfTextEditor.tsx#L813-L849","documentation":"Thrown after the polling loop exits (attempts >= maxAttempts, which is 600) without jobComplete becoming true. The job was still running or stuck when the client gave up. With exponential backoff up to 10s per poll and 600 attempts, this represents approximately 30+ minutes of polling before timeout.","triggerScenarios":"The server-side conversion is genuinely stuck (deadlock, infinite loop in LibreOffice). The server is under extreme load and processing is extremely slow. Network issues causing poll responses to be received but job status never advancing.","commonSituations":"Very large or complex PDF with hundreds of pages. Server running on minimal resources (low CPU/RAM). LibreOffice hung on a specific problematic document. Concurrent conversions saturating the server.","solutions":["Check server resource usage (CPU, memory) during conversion — the job may be legitimately slow.","Try a smaller or simpler PDF to rule out document-specific issues.","Increase maxAttempts or make it configurable for enterprise deployments.","Check server logs for the job — it may still be processing after the client gave up."],"exampleFix":"// before\nif (!jobComplete) {\n  throw new Error(\"Conversion timed out\");\n}\n\n// after\nif (!jobComplete) {\n  throw new Error(\n    `Conversion timed out after ${attempts} polling attempts. ` +\n    `The server may be overloaded or the document too large. Try again or use a smaller file.`\n  );\n}","handlingStrategy":"retry","validationCode":"// Check document size and warn about potential timeout\nif (file.size > 50 * 1024 * 1024) {\n  // 50MB+\n  setConversionProgress({ percent: 0, stage: 'processing', message: 'Large document — conversion may take several minutes.' });\n}","typeGuard":null,"tryCatchPattern":"try {\n  parsed = await convertWithPolling(file, requestId);\n} catch (error) {\n  if (error instanceof Error && error.message === 'Conversion timed out') {\n    // Retry once with fresh job\n    parsed = await convertWithPolling(file, requestId);\n  } else {\n    throw error;\n  }\n}","preventionTips":["Scale maxAttempts or pollDelay based on document size.","Check server CPU/memory before starting large conversions.","Show a progress indicator so users know the conversion is still working.","Retry the conversion once automatically before surfacing a timeout error."],"tags":["pdf-text-editor","timeout","job-polling","conversion","performance"],"backgroundTag":null,"analyzedSha":"9ef20dcab80b85041912f045e17a6aea1d08f969","analyzedAt":"2026-08-13T22:11:39.827Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}