{"record":{"id":"1913ce1e50bf1bac","repo":"redis/jedis","slug":"s-file-s-does-not-exist","errorCode":null,"errorMessage":"%s file %s does not exist","messagePattern":"(.+?) file (.+?) does not exist","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/SslOptions.java","lineNumber":476,"sourceCode":"     */\n    public SslVerifyMode getSslVerifyMode() {\n        return sslVerifyMode;\n    }\n\n    private static char[] getPassword(char[] chars) {\n        return chars != null ? Arrays.copyOf(chars, chars.length) : null;\n    }\n\n    /**\n     * Assert that {@code file} {@link File#exists() exists}.\n     *\n     * @param keyword file recognizer\n     * @param file\n     * @throws IllegalArgumentException if the file doesn't exist\n     */\n    public static void assertFile(String keyword, File file) {\n        if (!file.exists()) {\n            throw new IllegalArgumentException(String.format(\"%s file %s does not exist\", keyword, file));\n        }\n        if (!file.isFile()) {\n            throw new IllegalArgumentException(String.format(\"%s file %s is not a file\", keyword, file));\n        }\n    }\n\n    /**\n     * Supplier for a {@link InputStream} representing a resource. The resulting {@link InputStream} must be closed by\n     * the calling code.\n     */\n    @FunctionalInterface\n    public interface Resource {\n\n        /**\n         * Create a {@link Resource} that obtains a {@link InputStream} from a {@link URL}.\n         *\n         * @param url the URL to obtain the {@link InputStream} from.\n         * @return a {@link Resource} that opens a connection to the URL and obtains the {@link InputStream} for it.","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/SslOptions.java#L458-L494","documentation":"SslOptions.assertFile validates that a configured SSL material file (e.g. truststore, keystore, cert) exists on disk. The keyword parameter names which file role failed. Thrown as IllegalArgumentException during client builder configuration.","triggerScenarios":"Passing a File path to SslOptions (e.g. trustStoreFile, keyStoreFile, or via builder sslOptions(...)) where the path does not exist on disk at client construction time.","commonSituations":"Typo in path, file only exists on another machine/container, working-directory differences between dev and prod, Docker volume not mounted, relative path resolved against unexpected cwd.","solutions":["Verify the path exists with 'new File(path).exists()' or ls before building the client.","Use absolute paths instead of relative ones.","In containers, ensure the file is mounted/copied into the image or volume.","Check file permissions allow the JVM user to stat the file."],"exampleFix":"// before\nSslOptions.builder().trustStore(new File(\"/etc/ssl/nonexistent.jks\")).build();\n// after\nFile ts = new File(\"/etc/ssl/truststore.jks\");\nif (!ts.exists()) throw new IllegalStateException(\"truststore missing: \" + ts);\nSslOptions.builder().trustStore(ts).build();","handlingStrategy":"validation","validationCode":"File f = new File(path);\nif (!f.exists()) throw new IllegalStateException(\"missing SSL file: \" + path);\nif (!f.isFile()) throw new IllegalStateException(\"not a file: \" + path);","typeGuard":null,"tryCatchPattern":"try {\n  SslOptions opts = SslOptions.builder().trustStore(f).build();\n} catch (IllegalArgumentException e) {\n  log.error(\"SSL config error: {}\", e.getMessage());\n}","preventionTips":["Use absolute paths","Validate files at startup with exists()/isFile()","Ensure files are mounted in containers","Check read permissions for the JVM user"],"tags":["ssl","file-not-found","configuration","jedis"],"backgroundTag":"file-not-found","analyzedSha":"6dac31d4c224fb3257c216f3985340c6f500cdcb","analyzedAt":"2026-09-08T04:55:01.204Z","contentChangedAt":"2026-09-08T04:55:01.204Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}