{"record":{"id":"4a053b02fb6d67bc","repo":"pinpoint-apm/pinpoint","slug":"could-not-find-file-path-filepath","errorCode":null,"errorMessage":"Could not find file.(path:+filePath+)","messagePattern":"Could not find file\\.\\(path:\\+filePath\\+\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"grpc/src/main/java/com/navercorp/pinpoint/grpc/client/config/SslOption.java","lineNumber":130,"sourceCode":"\n        private Resource toResource(String filePath) {\n            if (!StringUtils.hasText(filePath)) {\n                return null;\n            }\n\n            Resource resource = null;\n            if (filePath.startsWith(CLASSPATH_URL_PREFIX)) {\n                String path = filePath.substring(CLASSPATH_URL_PREFIX.length());\n                resource = FileSystemResource.createResource(basePath, path);\n            } else if (filePath.startsWith(FILE_URL_PREFIX)) {\n                String path = filePath.substring(FILE_URL_PREFIX.length());\n                resource = FileSystemResource.createResource(path);\n            }\n\n            if (resource != null && resource.exists()) {\n                return resource;\n            }\n            throw new IllegalArgumentException(\"Could not find file.(path:\" + filePath + \")\");\n        }\n\n    }\n\n    @Override\n    public String toString() {\n        final StringBuilder sb = new StringBuilder(\"SslOption{\");\n        sb.append(\"enable=\").append(enable);\n        sb.append(\", providerType='\").append(providerType).append('\\'');\n        sb.append(\", trustCertResource=\").append(trustCertResource);\n        sb.append('}');\n        return sb.toString();\n    }\n}\n","sourceCodeStart":112,"sourceCodeEnd":145,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/grpc/src/main/java/com/navercorp/pinpoint/grpc/client/config/SslOption.java#L112-L145","documentation":"SslOption.toResource wraps the configured file path in a FileSystemResource and checks exists(); if the resource cannot be created or does not exist on disk, it throws IllegalArgumentException(\"Could not find file.(path:...)\"). This guard exists because gRPC TLS setup (trust certificate / key material) cannot proceed with a missing file. The path comes from client SSL configuration options.","triggerScenarios":"Calling trustCertResource (via SslOption setup for a gRPC client) with a certificate file path that does not exist, is misspelled, is relative to the wrong working directory, or is unreadable/inaccessible so exists() returns false.","commonSituations":"Typo in the pinpoint client SSL config (client.ssl.trustCertificateFile.path); deploying to a container where the cert was not volume-mounted; relative path resolved against a different CWD than during local testing; file deleted between config time and connection time.","solutions":["Verify the configured path exists with ls/Files.exists and fix the path in the SSL configuration.","Use an absolute path, or confirm the process working directory makes the relative path resolve correctly.","Ensure the certificate file is mounted/copied into the container or host running the Pinpoint agent/collector.","Check file permissions so the process user can read the file (exists/readable)."],"exampleFix":"// before\nclient.ssl.trustCertificateFile.path=conf/trust-cert.pem\n// after\nclient.ssl.trustCertificateFile.path=/opt/pinpoint/conf/trust-cert.pem","handlingStrategy":"validation","validationCode":"java.io.File cert = new File(certPath);\nif (!cert.exists() || !cert.canRead()) {\n    throw new IllegalStateException(\"Trust cert not accessible: \" + cert.getAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":"try {\n    sslOption = SslOption.create(...);\n} catch (IllegalArgumentException e) {\n    LOG.error(\"SSL cert path invalid: {}\", e.getMessage());\n    // fall back to plaintext or abort startup\n}","preventionTips":["Use absolute paths for cert files in production config.","Add a startup preflight that checks all configured SSL file paths exist and are readable.","Verify volumes/mounts in containerized deployments before launch.","Keep cert files in a stable location with correct permissions for the running user."],"tags":["grpc","ssl","file-not-found","configuration"],"backgroundTag":"file-not-found","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}