{"record":{"id":"3308222e2e2d6c50","repo":"apache/seatunnel","slug":"target-metadata-lookup-failed-for-path-s","errorCode":null,"errorMessage":"Target metadata lookup failed for path=%s","messagePattern":"Target metadata lookup failed for path=(.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/UpdateFileMetadataLoader.java","lineNumber":173,"sourceCode":"        long started = System.nanoTime();\n        IOException failure = null;\n        try {\n            while (completed < requests.size()) {\n                while (submitted < requests.size() && submitted - completed < maxInFlight) {\n                    Request request = requests.get(submitted++);\n                    inFlight.add(\n                            completion.submit(\n                                    () -> {\n                                        int current = active.incrementAndGet();\n                                        peakConcurrency.accumulateAndGet(current, Math::max);\n                                        try {\n                                            return new Lookup(\n                                                    request,\n                                                    target.getFileStatus(request.targetPath));\n                                        } catch (FileNotFoundException ignored) {\n                                            return new Lookup(request, null);\n                                        } catch (IOException e) {\n                                            throw new IOException(\n                                                    \"Target metadata lookup failed for path=\"\n                                                            + mask(new Path(request.targetPath)),\n                                                    e);\n                                        } finally {\n                                            active.decrementAndGet();\n                                        }\n                                    }));\n                    peakInFlight = Math.max(peakInFlight, submitted - completed);\n                }\n                try {\n                    Future<Lookup> completedFuture = completion.take();\n                    inFlight.remove(completedFuture);\n                    Lookup lookup = completedFuture.get();\n                    ordered[lookup.request.order] = lookup.status;\n                    completed++;\n                } catch (InterruptedException e) {\n                    Thread.currentThread().interrupt();\n                    failure = new IOException(\"Interrupted during target_point_lookup\", e);","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/UpdateFileMetadataLoader.java#L155-L191","documentation":"In UpdateFileMetadataLoader.loadPoints, per-path target metadata lookups run concurrently; an IOException from target.getFileStatus (other than FileNotFoundException, which is treated as 'not exists') is rethrown as 'Target metadata lookup failed for path=...'. It indicates a single-file stat call against the target filesystem failed.","triggerScenarios":"getFileStatus on request.targetPath throwing IOException due to transient storage errors, permission problems, throttling, or connectivity failures to the target filesystem.","commonSituations":"Same as bulk listing but for point lookups: S3 throttling under many concurrent stats, HDFS DataNode/NameNode hiccups, expired session tokens during long jobs.","solutions":["Retry the job; these are usually transient storage errors — check the wrapped cause for specifics","Confirm read permissions on the target path for the SeaTunnel process user","Reduce concurrency of point lookups or add backoff if the storage is rate-limiting","Validate target storage credentials/tokens haven't expired mid-run"],"exampleFix":"// before\n// stat calls failing with 503 Slow Down\n// after\n// add retry policy with exponential backoff on the target filesystem client, rerun job","handlingStrategy":"retry","validationCode":"// pre-flight stat on a sample target path\ntry { fs.getFileStatus(sampleTargetPath); }\ncatch (IOException e) { throw new IllegalStateException(\"Target stat probe failed\", e); }","typeGuard":null,"tryCatchPattern":"try {\n    loader.load(requests);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Target metadata lookup failed\")) {\n        retryWithBackoff(e, 3);\n    } else throw e;\n}","preventionTips":["Add client-level retries with exponential backoff for stat/getFileStatus calls","Limit concurrent point lookups to avoid throttling","Check target path read permissions for the job's principal"],"tags":["io","metadata","stat"],"backgroundTag":"file-read-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}