appsmithorg/appsmith · error · AppsmithPluginException

PE-DSE-5003

PE-DSE-5003

Error message

Missing region in datasource.

What it means

In getDynamoDBClientObject(), the datasource authentication (cast to DBAuth) must be non-null and its getDatabaseName() — which stores the AWS region — must be non-empty. If either check fails, throws PLUGIN_DATASOURCE_ARGUMENT_ERROR (PE-DSE-5003). The DynamoDbClient builder requires a Region before it can be constructed.

Source

Thrown at app/server/appsmith-plugins/dynamoPlugin/src/main/java/com/external/plugins/DynamoPlugin.java:642

    private static boolean isUpperCase(String s) {
        for (char c : s.toCharArray()) {
            if (!Character.isUpperCase(c)) {
                return false;
            }
        }
        return true;
    }

    private static DynamoDbClient getDynamoDBClientObject(
            DatasourceConfiguration dsConfig, DynamoDbClientBuilder builder) {
        if (!CollectionUtils.isEmpty(dsConfig.getEndpoints())) {
            final Endpoint endpoint = dsConfig.getEndpoints().get(0);
            builder.endpointOverride(URI.create("http://" + endpoint.getHost() + ":" + endpoint.getPort()));
        }

        final DBAuth authentication = (DBAuth) dsConfig.getAuthentication();
        if (authentication == null || !StringUtils.hasLength(authentication.getDatabaseName())) {
            throw new AppsmithPluginException(
                    AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR, DynamoErrorMessages.MISSING_REGION_ERROR_MSG);
        }

        builder.region(Region.of(authentication.getDatabaseName()));

        builder.credentialsProvider(StaticCredentialsProvider.create(
                AwsBasicCredentials.create(authentication.getUsername(), authentication.getPassword())));

        return builder.build();
    }
}

View on GitHub (pinned to 8cd9021c24)

Solutions

  1. Set the AWS region (e.g. us-east-1, eu-west-1) in the datasource configuration.
  2. If creating the datasource programmatically, set authentication.setDatabaseName("us-east-1") before calling the plugin.
  3. Re-test the datasource after saving the region to confirm the client builds.

Example fix

// before — region missing
DBAuth auth = new DBAuth();
auth.setDatabaseName(""); // region is blank

// after
DBAuth auth = new DBAuth();
auth.setDatabaseName("us-east-1");
Defensive patterns

Strategy: validation

Validate before calling

DBAuth auth = (DBAuth) dsConfig.getAuthentication();
if (auth == null || !StringUtils.hasLength(auth.getDatabaseName())) {
    throw new IllegalArgumentException(
        "AWS region is required in the datasource (stored in authentication.databaseName).");
}
// also validate it is a real region
Region.of(auth.getDatabaseName()); // throws IllegalArgumentException if invalid

Prevention

When it happens

Trigger: A DynamoDB datasource is configured without a region, or its authentication object is null. This fires when the plugin attempts to build the client, which happens during datasource testing and query execution.

Common situations: The Region field was left empty in the datasource configuration form; the datasource was created programmatically without setting the authentication.databaseName; a migration that dropped the region value.

Related errors


AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12). Data as JSON: /api/errors/be1b7d58ad1592b4. Report an issue: GitHub.