pinpoint-apm/pinpoint · error · IllegalArgumentException
Could not find file.(path:+filePath+)
Error message
Could not find file.(path:+filePath+)
What it means
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.
Source
Thrown at grpc/src/main/java/com/navercorp/pinpoint/grpc/client/config/SslOption.java:130
private Resource toResource(String filePath) {
if (!StringUtils.hasText(filePath)) {
return null;
}
Resource resource = null;
if (filePath.startsWith(CLASSPATH_URL_PREFIX)) {
String path = filePath.substring(CLASSPATH_URL_PREFIX.length());
resource = FileSystemResource.createResource(basePath, path);
} else if (filePath.startsWith(FILE_URL_PREFIX)) {
String path = filePath.substring(FILE_URL_PREFIX.length());
resource = FileSystemResource.createResource(path);
}
if (resource != null && resource.exists()) {
return resource;
}
throw new IllegalArgumentException("Could not find file.(path:" + filePath + ")");
}
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("SslOption{");
sb.append("enable=").append(enable);
sb.append(", providerType='").append(providerType).append('\'');
sb.append(", trustCertResource=").append(trustCertResource);
sb.append('}');
return sb.toString();
}
}
View on GitHub (pinned to 744c3d3075)
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).
Example fix
// before client.ssl.trustCertificateFile.path=conf/trust-cert.pem // after client.ssl.trustCertificateFile.path=/opt/pinpoint/conf/trust-cert.pem
Defensive patterns
Strategy: validation
Validate before calling
java.io.File cert = new File(certPath);
if (!cert.exists() || !cert.canRead()) {
throw new IllegalStateException("Trust cert not accessible: " + cert.getAbsolutePath());
} Try / catch
try {
sslOption = SslOption.create(...);
} catch (IllegalArgumentException e) {
LOG.error("SSL cert path invalid: {}", e.getMessage());
// fall back to plaintext or abort startup
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- can't find SslProvider. value:+providerType
- 'log4j2-agent.xml' not found. agentPath:${profilePath}
- Illegal report period:
- cipherSuites must not be empty
- cipherSuite+ is not safe. Please check this url.(https://htt
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/4a053b02fb6d67bc.
Report an issue: GitHub.