{"record":{"id":"7a180277bc1e13c9","repo":"apache/cassandra","slug":"fswriteerror","errorCode":null,"errorMessage":"FSWriteError","messagePattern":"FSWriteError","errorType":"exception","errorClass":"FSWriteError","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/hints/HintsStore.java","lineNumber":366,"sourceCode":"    }\n\n    HintsWriter getWriter()\n    {\n        return hintsWriter;\n    }\n\n    private HintsWriter openWriter()\n    {\n        lastUsedTimestamp = Math.max(currentTimeMillis(), lastUsedTimestamp + 1);\n        HintsDescriptor descriptor = new HintsDescriptor(hostId, lastUsedTimestamp, writerParams);\n\n        try\n        {\n            return HintsWriter.create(hintsDirectory, descriptor);\n        }\n        catch (IOException e)\n        {\n            throw new FSWriteError(e, descriptor.fileName());\n        }\n    }\n\n    void closeWriter()\n    {\n        if (hintsWriter != null)\n        {\n            hintsWriter.close();\n            offerLast(hintsWriter.descriptor());\n            hintsWriter = null;\n            SyncUtil.trySyncDir(hintsDirectory);\n        }\n    }\n\n    void fsyncWriter()\n    {\n        if (hintsWriter != null)\n            hintsWriter.fsync();","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/hints/HintsStore.java#L348-L384","documentation":"FSWriteError thrown by HintsStore.openWriter when HintsWriter.create fails with an IOException while opening/creating a hints file for a new descriptor. Wrapped by getOrOpenWriter whenever a hints writer is needed.","triggerScenarios":"Creating a new hints file in the hints directory fails: directory missing, no write permission, disk full, too many open files, or I/O error on file creation.","commonSituations":"Disk full on the hints volume; hints directory permissions broken after restore/migration; ulimit -n too low (EMFILE); hints directory deleted while node runs.","solutions":["Check disk space on the hints volume (df -h) and free space or relocate hints_directory","Verify the hints directory exists and cassandra can write to it (ls -ld, chown)","Raise the open-file ulimit if the log shows 'Too many open files'","Fix underlying disk I/O errors indicated by the wrapped IOException cause, then restart hint dispatch"],"exampleFix":"# before: openWriter fails\nmkdir -p /var/lib/cassandra/hints\nchown cassandra:cassandra /var/lib/cassandra/hints\nchmod 750 /var/lib/cassandra/hints","handlingStrategy":"try-catch","validationCode":"// precondition check before triggering hint writes\nFile dir = new File(hintsDirectory);\nif (!dir.isDirectory() || !dir.canWrite()) throw new IllegalStateException(\"Hints dir not writable: \" + hintsDirectory);","typeGuard":null,"tryCatchPattern":"try {\n    store.getOrOpenWriter();\n} catch (FSWriteError e) {\n    logger.error(\"Cannot open hints writer for {} : {}\", file, e.getCause());\n    // alert/pause dispatch until storage issue is resolved\n}","preventionTips":["Monitor free space on the hints volume","Set adequate ulimit -n for cassandra user","Verify hints directory ownership/permissions after restores","Alert on FSWriteError in system.log"],"tags":["io","filesystem","hints","write"],"backgroundTag":"file-write-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}