Troubleshooting¶
Common issues and solutions when using the Tileverse Range Reader library.
Installation Issues¶
Dependency Conflicts¶
Problem: Maven/Gradle dependency conflicts with AWS, Azure, or Google Cloud SDKs.
Solution: Use the BOM (Bill of Materials) for version alignment:
<dependencyManagement>
<dependencies>
<!-- AWS BOM -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.31.70</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Azure BOM -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-sdk-bom</artifactId>
<version>1.2.28</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Java Version Issues¶
Problem: UnsupportedClassVersionError
or similar Java version errors.
Solution: Ensure you're using Java 17 or higher:
java -version
# Should show version 17 or higher
# Set JAVA_HOME if needed
export JAVA_HOME=/path/to/java17
Missing Module Errors¶
Problem: ClassNotFoundException
for cloud provider classes.
Solution: Include the specific module dependency:
<!-- For S3 support -->
<dependency>
<groupId>io.tileverse.rangereader</groupId>
<artifactId>tileverse-rangereader-s3</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Authentication Issues¶
AWS S3 Authentication¶
Problem: SdkClientException: Unable to load AWS credentials
Solutions:
-
Set environment variables:
-
Create AWS credentials file:
-
Use IAM role (on EC2/ECS):
Problem: S3Exception: Access Denied (Service: S3, Status Code: 403)
Solutions:
-
Check bucket permissions:
-
Verify object exists:
-
Check region:
Azure Blob Storage Authentication¶
Problem: BlobStorageException: AuthenticationFailed
Solutions:
-
Verify connection string:
-
Check SAS token expiration:
-
Test connectivity:
Google Cloud Storage Authentication¶
Problem: GoogleCloudStorageException: 403 Forbidden
Solutions:
-
Set service account key:
-
Test authentication:
-
Check service account permissions:
Performance Issues¶
Slow Read Performance¶
Problem: Range reads are slower than expected.
Solutions:
-
Enable caching:
-
Use disk caching for persistent storage:
High Memory Usage¶
Problem: Application uses too much memory.
Solutions:
-
Use soft references in cache:
-
Limit cache size:
-
Use disk caching instead:
Cache Not Working¶
Problem: Cache statistics show low hit rates.
Solutions:
-
Check cache configuration:
-
Ensure consistent read patterns:
-
Use appropriate read patterns:
// Ensure consistent read patterns to improve cache hits var reader = CachingRangeReader.builder(baseReader) .maximumSize(1000) .build(); // Read in consistent chunks int chunkSize = 64 * 1024; // 64KB chunks for (int i = 0; i < 10; i++) { reader.readRange(i * chunkSize, chunkSize); // Cache-friendly }
Network Issues¶
Connection Timeouts¶
Problem: SocketTimeoutException
or connection timeouts.
Solutions:
-
Increase timeouts:
-
Configure retries:
-
For S3, configure client:
Proxy Configuration¶
Problem: Cannot connect through corporate proxy.
Solutions:
-
Set system properties:
-
Configure AWS SDK proxy:
var proxyConfig = ProxyConfiguration.builder() .endpoint(URI.create("http://proxy.company.com:8080")) .username("proxyuser") .password("proxypass") .build(); var s3Client = S3Client.builder() .overrideConfiguration(ClientOverrideConfiguration.builder() .proxyConfiguration(proxyConfig) .build()) .build();
SSL/TLS Issues¶
Problem: SSL certificate validation errors.
Solutions:
-
For development only - disable SSL verification:
-
Add custom certificate to truststore:
File System Issues¶
File Access Permissions¶
Problem: AccessDeniedException
when reading local files.
Solutions:
-
Check file permissions:
-
Verify file exists:
Disk Cache Issues¶
Problem: Disk cache not working or filling up disk.
Solutions:
-
Check disk space:
-
Configure cache location:
-
Enable cleanup on close:
Debugging Tips¶
Enable Debug Logging¶
// Add to your application startup
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "DEBUG");
System.setProperty("org.slf4j.simpleLogger.log.io.tileverse.rangereader", "DEBUG");
// For AWS SDK
System.setProperty("org.slf4j.simpleLogger.log.software.amazon.awssdk", "DEBUG");
// For Azure SDK
System.setProperty("org.slf4j.simpleLogger.log.com.azure", "DEBUG");
Monitor Cache Performance¶
public void monitorCache(RangeReader reader) {
if (reader instanceof CachingRangeReader cachingReader) {
var stats = cachingReader.getCacheStats();
System.out.println("Cache Statistics:");
System.out.println(" Hit Rate: " + String.format("%.2f%%", stats.hitRate() * 100));
System.out.println(" Requests: " + stats.requestCount());
System.out.println(" Hits: " + stats.hitCount());
System.out.println(" Misses: " + stats.missCount());
System.out.println(" Evictions: " + stats.evictionCount());
System.out.println(" Size: " + stats.estimatedSize());
}
}
Test Connectivity¶
public void testConnectivity(URI uri) {
try {
var reader = createReader(uri);
long size = reader.size();
System.out.println("Successfully connected to " + uri + ", size: " + size);
reader.close();
} catch (Exception e) {
System.err.println("Failed to connect to " + uri + ": " + e.getMessage());
e.printStackTrace();
}
}
Profile Performance¶
public void profileReads(RangeReader reader) {
int numReads = 100;
int blockSize = 64 * 1024;
long startTime = System.nanoTime();
for (int i = 0; i < numReads; i++) {
try {
reader.readRange(i * blockSize, blockSize);
} catch (IOException e) {
System.err.println("Read failed at offset " + (i * blockSize));
}
}
long endTime = System.nanoTime();
double durationMs = (endTime - startTime) / 1_000_000.0;
System.out.println("Read " + numReads + " blocks in " + durationMs + "ms");
System.out.println("Average: " + (durationMs / numReads) + "ms per read");
}
Getting Help¶
If you're still experiencing issues:
- Check the logs for detailed error messages
- Search GitHub issues for similar problems
- Create a minimal reproduction case
- Submit an issue with:
- Library version
- Java version
- Operating system
- Complete error message and stack trace
- Minimal code example
Common Error Messages¶
Error | Likely Cause | Solution |
---|---|---|
ClassNotFoundException | Missing module dependency | Add required module to dependencies |
Access Denied (403) | Authentication/authorization | Check credentials and permissions |
NoSuchFileException | File not found | Verify file/object exists |
SocketTimeoutException | Network timeout | Increase timeout or check connectivity |
OutOfMemoryError | Large cache or buffer usage | Reduce cache size or use disk caching |
UnsupportedClassVersionError | Wrong Java version | Use Java 17 or higher |