{"record":{"id":"39a66aa062a94b94","repo":"appsmithorg/appsmith","slug":"pe-dse-5000","errorCode":"PE-DSE-5000","errorMessage":"Appsmith server has failed to fetch list of buckets from database. Please check if the database credentials are valid and/or you have the required permissions.","messagePattern":"Appsmith server has failed to fetch list of buckets from database\\. Please check if the database credentials are valid and/or you have the required permissions\\.","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java","lineNumber":1110,"sourceCode":"                        List<DatasourceStructure.Table> tableList;\n                        try {\n                            log.debug(Thread.currentThread().getName()\n                                    + \": connection.listBuckets() called for AmazonS3 plugin.\");\n                            tableList = connection.listBuckets().stream()\n                                    /* Get name of each bucket */\n                                    .map(Bucket::getName)\n                                    /* Get command templates and use it to create Table object */\n                                    .map(bucketName -> new DatasourceStructure.Table(\n                                            DatasourceStructure.TableType.BUCKET,\n                                            \"\",\n                                            bucketName,\n                                            new ArrayList<>(),\n                                            new ArrayList<>(),\n                                            getTemplates(bucketName, DEFAULT_FILE_NAME)))\n                                    /* Collect all Table objects in a list */\n                                    .collect(Collectors.toList());\n                        } catch (SdkClientException e) {\n                            throw new AppsmithPluginException(\n                                    AppsmithPluginError.PLUGIN_GET_STRUCTURE_ERROR,\n                                    S3ErrorMessages.LIST_OF_BUCKET_FETCHING_ERROR_MSG,\n                                    e.getMessage());\n                        } catch (IllegalStateException e) {\n                            throw new StaleConnectionException(e.getMessage());\n                        }\n\n                        return new DatasourceStructure(tableList);\n                    })\n                    .subscribeOn(scheduler);\n        }\n\n        private String getOneFileNameOrDefault(AmazonS3 connection, String bucketName, String defaultFileName) {\n            ArrayList<String> listOfFiles;\n            try {\n                listOfFiles = listAllFilesInBucket(connection, bucketName, \"\");\n            } catch (AppsmithPluginException e) {\n                return defaultFileName;","sourceCodeStart":1092,"sourceCodeEnd":1128,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/amazons3Plugin/src/main/java/com/external/plugins/AmazonS3Plugin.java#L1092-L1128","documentation":"Thrown by the datasource getStructure (schema fetch) flow when listing buckets raises SdkClientException (S3ErrorMessages.LIST_OF_BUCKET_FETCHING_ERROR_MSG, code PE-DSE-5000). Appsmith could not call S3 listBuckets, usually because the credentials are invalid, lack s3:ListAllMyBuckets, or the endpoint/region is unreachable.","triggerScenarios":"On the datasource schema/structure refresh, the AWS SDK listBuckets() call throws SdkClientException. Caught and rethrown as a PLUGIN_GET_STRUCTURE_ERROR. The nearby IllegalStateException branch converts to StaleConnectionException, but a hard SdkClientException surfaces this message.","commonSituations":"Wrong access/secret key; key lacks the s3:ListAllMyBuckets action (an IAM policy scoped to a single bucket); endpoint URL malformed for a third-party S3 provider; network/firewall blocking the S3 endpoint; system clock skew breaking SigV4 signing.","solutions":["Re-enter the access key and secret key in the datasource and click 'Test configuration'.","Grant the IAM principal s3:ListAllMyBuckets on '*' (or at minimum the bucket(s) used), plus s3:ListBucket on the target bucket.","Correct the endpoint URL and region for non-AWS providers (Wasabi, DigitalOcean, MinIO, etc.).","Check server-to-S3 network connectivity and NTP/clock sync on the Appsmith host."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// No code-side guard can fully prevent an AWS auth/network failure,\n// but verify the datasource config before refreshing schema:\n// - access/secret key non-empty\n// - endpoint/region correct for the provider\n// Use Appsmith 'Test configuration' to validate before 'Refresh schema'.","typeGuard":null,"tryCatchPattern":"// Treat as a datasource health error: catch on schema refresh, show the user\n// a credentials/permissions hint, and offer a re-test of the datasource.","preventionTips":["Grant s3:ListAllMyBuckets (and s3:ListBucket on targets) to the IAM principal.","Keep server clock synced (NTP) to avoid SigV4 signing failures.","Verify endpoint URL for third-party S3 providers.","Use 'Test configuration' before refreshing schema."],"tags":["java","appsmith","amazon-s3","plugin","aws-sdk","iam-permissions","credentials","schema","network"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}