{"record":{"id":"4ce436528e52b0fa","repo":"apache/flink","slug":"cannot-seek-to-negative-position","errorCode":null,"errorMessage":"Cannot seek to negative position: {}","messagePattern":"Cannot seek to negative position: (.+?)","errorType":"exception","errorClass":"EOFException","httpStatus":null,"severity":"error","filePath":"flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3InputStream.java","lineNumber":257,"sourceCode":"                    exception.addSuppressed(e);\n                }\n                LOG.warn(\"Error closing S3 response stream for {}/{}\", bucketName, key, e);\n            } finally {\n                currentStream = null;\n            }\n        }\n        return exception;\n    }\n\n    @Override\n    public void seek(long desired) throws IOException {\n        lock();\n        try {\n            if (closed) {\n                throw new IOException(\"Stream is closed\");\n            }\n            if (desired < 0) {\n                throw new EOFException(\"Cannot seek to negative position: \" + desired);\n            }\n            if (desired > contentLength) {\n                throw new EOFException(\n                        \"Cannot seek past end of stream: position=\"\n                                + desired\n                                + \", length=\"\n                                + contentLength);\n            }\n\n            nextReadPos = desired;\n        } finally {\n            lock.unlock();\n        }\n    }\n\n    @Override\n    public long getPos() throws IOException {\n        lock();","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/NativeS3InputStream.java#L239-L275","documentation":"Error \"Cannot seek to negative position: {}\" thrown in apache/flink.","triggerScenarios":"Triggered at runtime when the operation fails because: Cannot seek to negative position: the reported value.","commonSituations":"Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Cannot seek to negative position: the reported value.","solutions":["Address the cause reported by the error message: Cannot seek to negative position: the reported value","Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry."],"exampleFix":"Correct the condition described (\"Cannot seek to negative position: the reported value\") and rerun the job or command.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}