{"record":{"id":"541788b702a1ce81","repo":"ScrapeGraphAI/Scrapegraph-ai","slug":"pdf-parsing-exceeded-timeout-of-self-timeout-sec","errorCode":null,"errorMessage":"PDF parsing exceeded timeout of {self.timeout} seconds","messagePattern":"PDF parsing exceeded timeout of (.+?) seconds","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"scrapegraphai/nodes/fetch_node.py","lineNumber":196,"sourceCode":"\n        Returns:\n        list: A list containing a Document object with the loaded content and metadata.\n        \"\"\"\n\n        if input_type == \"pdf\":\n            from langchain_community.document_loaders import PyPDFLoader\n            loader = PyPDFLoader(source)\n            # PyPDFLoader.load() can be blocking for large PDFs. Run it in a thread and\n            # enforce the configured timeout if provided.\n            if self.timeout is None:\n                return loader.load()\n            else:\n                with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:\n                    future = executor.submit(loader.load)\n                    try:\n                        return future.result(timeout=self.timeout)\n                    except concurrent.futures.TimeoutError:\n                        raise TimeoutError(\n                            f\"PDF parsing exceeded timeout of {self.timeout} seconds\"\n                        )\n        elif input_type == \"csv\":\n            try:\n                import pandas as pd\n            except ImportError:\n                raise ImportError(\n                    \"pandas is not installed. Please install it using `pip install pandas`.\"\n                )\n            return [\n                Document(\n                    page_content=str(pd.read_csv(source)), metadata={\"source\": \"csv\"}\n                )\n            ]\n        elif input_type == \"json\":\n            with open(source, encoding=\"utf-8\") as f:\n                return [\n                    Document(","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/532dfffbf6ee823a6c9cf8cfedc24a93bf026780/scrapegraphai/nodes/fetch_node.py#L178-L214","documentation":"FetchNode.load_file_content runs PDF loading in a single-thread ThreadPoolExecutor and waits with self.timeout seconds; if the loader does not finish in time, future.result raises TimeoutError which is re-raised as this TimeoutError with the configured limit.","triggerScenarios":"Loading a very large or scanned PDF (OCR-heavy) that takes longer than fetch_node's timeout config; a slow/remote filesystem; timeout misconfigured to a small value while the document is hundreds of pages.","commonSituations":"Default timeout too low for big PDFs; network-mounted PDF sources; corrupted PDFs that hang the parser.","solutions":["Increase the timeout in the fetch node config, e.g. node_config={'fetch': {'timeout': 120}} or graph_config['fetch']['timeout']","Pre-process large PDFs (split pages) before feeding them to the graph","If it consistently hangs, verify the PDF is not corrupted (test with pypdf/pdfplumber directly)"],"exampleFix":"# before\ngraph_config = {'fetch': {'timeout': 10}}\n# after\ngraph_config = {'fetch': {'timeout': 120}}","handlingStrategy":"retry","validationCode":"import os\nsize = os.path.getsize(pdf_path)\ntimeout = max(30, size // 100_000)  # scale timeout with file size","typeGuard":null,"tryCatchPattern":"for attempt, timeout in enumerate([30, 90, 300], 1):\n    try:\n        run_graph(fetch_timeout=timeout)\n        break\n    except TimeoutError as e:\n        if f'exceeded timeout of {timeout}' not in str(e) or attempt == 3:\n            raise","preventionTips":["Scale fetch timeout with PDF size","Pre-validate large PDFs outside the graph or split them"],"tags":["scrapegraphai","fetch-node","pdf","timeout"],"backgroundTag":"operation-timed-out","analyzedSha":"532dfffbf6ee823a6c9cf8cfedc24a93bf026780","analyzedAt":"2026-08-28T15:19:38.821Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}