{"record":{"id":"b81181558d434b4d","repo":"appsmithorg/appsmith","slug":"pe-arg-5000-b81181","errorCode":"PE-ARG-5000","errorMessage":"Appsmith server has encountered an unexpected error when establishing connection with AWS S3 server. Please reach out to Appsmith customer support to resolve this.","messagePattern":"Appsmith server has encountered an unexpected error when establishing connection with AWS S3 server\\. Please reach out to Appsmith customer support to resolve this\\.","errorType":"error_code","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java","lineNumber":171,"sourceCode":"                        S3ErrorMessages.FILE_CONTENT_FETCHING_ERROR_MSG);\n            }\n\n            ArrayList<String> result = new ArrayList<>();\n            List<S3ObjectSummary> objects = objectListing.getObjectSummaries();\n            for (S3ObjectSummary os : objects) {\n                result.add(os.getKey());\n            }\n\n            return result;\n        }\n\n        /*\n         * - Exception thrown by this method is expected to be handled by the caller.\n         */\n        ArrayList<String> listAllFilesInBucket(AmazonS3 connection, String bucketName, String prefix)\n                throws AppsmithPluginException {\n            if (connection == null) {\n                throw new AppsmithPluginException(\n                        AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, S3ErrorMessages.CONNECTIVITY_ERROR_MSG);\n            }\n\n            if (bucketName == null) {\n                /*\n                 * - bucketName is NOT expected to be null at this program point. A null check has been added in the\n                 *  execute function already.\n                 */\n                throw new AppsmithPluginException(\n                        AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, S3ErrorMessages.EMPTY_BUCKET_ERROR_MSG);\n            }\n\n            if (prefix == null) {\n                /*\n                 * - prefix is NOT expected to be null at this program point. A null check has been added in the\n                 *  execute function already.\n                 */\n                throw new AppsmithPluginException(","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java#L153-L189","documentation":"Argument error (`PLUGIN_EXECUTE_ARGUMENT_ERROR`, PE-ARG-5000) from `listAllFilesInBucket`: the `AmazonS3 connection` parameter is null. The connection object is built upstream from the datasource configuration (access key, secret key, region, endpoint), so a null here means connection creation silently failed. Note the message ('connection with AWS S3 server') describes the symptom even though the code classifies it as an argument error.","triggerScenarios":"Calling `listAllFilesInBucket` (directly or via the List Files query action) when `AmazonS3ClientBuilder` could not construct a client from the datasource - typically because credentials, region, or endpoint URL are missing/invalid, or because the S3 driver class failed to load.","commonSituations":"Missing or wrong AWS access/secret key in the datasource; empty region; incorrect endpoint URL for an S3-compatible provider; the S3 driver class not loaded (see `S3_DRIVER_LOADING_ERROR_MSG`); test/degraded environments where credentials were not injected.","solutions":["Open the S3 datasource configuration and verify Access Key, Secret Key, and Region are all set and correct.","If using a custom S3-compatible provider, check the Endpoint URL and the S3 service provider selection.","Use the datasource 'Test' button - it exercises connection creation and surfaces the real underlying error.","Ensure the AWS SDK / S3 driver is on the classpath of the running Appsmith instance."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"AmazonS3 connection = buildS3Client(datasource);\nif (connection == null) {\n    throw new IllegalArgumentException(\n        \"S3 connection could not be created. Check access key, secret key, region, \"\n        + \"and endpoint URL in the datasource configuration.\");\n}\nreturn s3Executor.listAllFilesInBucket(connection, bucketName, prefix);","typeGuard":"private static boolean isUsableS3Client(AmazonS3 client) {\n    if (client == null) return false;\n    try { client.getS3AccountOwner(); return true; }\n    catch (Exception e) { return false; }\n}","tryCatchPattern":null,"preventionTips":["Use the datasource 'Test' action - it constructs the client and surfaces the real failure.","Verify Access Key, Secret Key, Region, and (for custom providers) Endpoint URL are all set.","Ensure the AWS SDK / S3 driver class is loaded by the Appsmith instance."],"tags":["appsmith","s3","aws","connection","datasource-config","credentials"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}