appsmithorg/appsmith · error · AppsmithPluginException
PE-AS3-5000
PE-AS3-5000
Error message
Appsmith server has encountered an unexpected error when fetching file content from AWS S3 server. Please reach out to Appsmith customer support to resolve this.
What it means
S3 plugin error (`AMAZON_S3_QUERY_EXECUTION_FAILED`, PE-AS3-5000) from `getFilenamesFromObjectListing`: the `ObjectListing` passed in is null. The method exists to extract object keys from a list-objects result, and a null listing is treated as an unexpected, unrecoverable state - hence the 'contact support' wording. The message text says 'fetching file content' but the method actually lists file keys.
Source
Thrown at app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java:151
static {
try {
amazonS3ErrorUtils = AmazonS3ErrorUtils.getInstance();
} catch (InstantiationException e) {
throw new RuntimeException(e);
}
}
public S3PluginExecutor() {
this.filterDataService = FilterDataService.getInstance();
}
/*
* - Exception thrown by this method is expected to be handled by the caller.
*/
ArrayList<String> getFilenamesFromObjectListing(ObjectListing objectListing) throws AppsmithPluginException {
if (objectListing == null) {
throw new AppsmithPluginException(
S3PluginError.AMAZON_S3_QUERY_EXECUTION_FAILED,
S3ErrorMessages.FILE_CONTENT_FETCHING_ERROR_MSG);
}
ArrayList<String> result = new ArrayList<>();
List<S3ObjectSummary> objects = objectListing.getObjectSummaries();
for (S3ObjectSummary os : objects) {
result.add(os.getKey());
}
return result;
}
/*
* - Exception thrown by this method is expected to be handled by the caller.
*/
ArrayList<String> listAllFilesInBucket(AmazonS3 connection, String bucketName, String prefix)
throws AppsmithPluginException {View on GitHub (pinned to 8cd9021c24)
Solutions
- Check that the S3 connection and bucket are valid (see error 119) - a broken connection can surface as a null listing downstream.
- If you control the client, ensure `listObjects`/`listNextBatchOfObjects` never return null.
- Report to Appsmith support if this occurs against real AWS S3 with no other symptoms.
Defensive patterns
Strategy: validation
Validate before calling
ObjectListing listing = connection.listObjects(bucketName, prefix);
if (listing == null) {
log.error("S3 listObjects returned null for bucket={}, prefix={}", bucketName, prefix);
return Collections.emptyList(); // or throw a domain-specific error
}
return getFilenamesFromObjectListing(listing); Type guard
private static boolean hasValidListing(ObjectListing listing) {
return listing != null && listing.getObjectSummaries() != null;
} Try / catch
try {
return s3Executor.listAllFilesInBucket(connection, bucketName, prefix);
} catch (AppsmithPluginException e) {
if ("PE-AS3-5000".equals(e.getAppErrorCode())
&& e.getMessage().contains("fetching file content")) {
log.warn("S3 returned null listing for bucket={}, retrying", bucketName);
return s3Executor.listAllFilesInBucket(rebuildConnection(), bucketName, prefix);
}
throw e;
} Prevention
- Null-check the ObjectListing before passing it to getFilenamesFromObjectListing.
- Validate the datasource connection first (error 119) so listing calls have a healthy client.
- If mocking S3 in tests, never return null from listObjects.
When it happens
Trigger: `AmazonS3.listObjects(...)` or `listNextBatchOfObjects(...)` returned null (the AWS SDK normally never returns null here), so the value flowed into `getFilenamesFromObjectListing`.
Common situations: A mocked/stubbed S3 client in tests returning null; an AWS SDK version mismatch where a listing call unexpectedly returns null; a custom S3-compatible provider whose SDK response deviates from AWS.
Related errors
AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12).
Data as JSON: /api/errors/330a9fe00c7e9272.
Report an issue: GitHub.