appsmithorg/appsmith · critical · AppsmithPluginException
PE-PLG-5002
PE-PLG-5002
Error message
Failed to connect to the in memory database. Unable to perform filtering : {} What it means
Thrown by the FilterDataServiceCE constructor when DriverManager.getConnection('jdbc:h2:mem:filterDb;DATABASE_TO_UPPER=FALSE') raises SQLException. FilterDataServiceCE is the in-memory H2 engine used to filter/sort query results client-side; if the H2 driver cannot establish the in-memory connection at construction time, every subsequent filter operation is impossible, so the constructor aborts with PLUGIN_IN_MEMORY_FILTERING_ERROR.
Source
Thrown at app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java:114
DataType.LONG,
DataType.FLOAT,
DataType.DOUBLE,
DataType.BOOLEAN,
DataType.DATE,
DataType.TIME,
DataType.TIMESTAMP),
DataType.DATE, Set.of(),
DataType.TIMESTAMP, Set.of());
public FilterDataServiceCE() {
objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled();
try {
connection = DriverManager.getConnection(URL);
} catch (SQLException e) {
log.error(e.getMessage());
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_IN_MEMORY_FILTERING_ERROR,
"Failed to connect to the in memory database. Unable to perform filtering : " + e.getMessage());
}
}
/**
* This filter method is using the new UQI format.
*
* @param items - data
* @param uqiDataFilterParams - filter conditions to apply on data
* @return filtered data
*/
public ArrayNode filterDataNew(ArrayNode items, UQIDataFilterParams uqiDataFilterParams) {
return this.filterDataNew(items, uqiDataFilterParams, null);
}
public ArrayNode filterDataNew(
ArrayNode items, UQIDataFilterParams uqiDataFilterParams, Map<DataType, DataType> dataTypeConversionMap) {View on GitHub (pinned to 8cd9021c24)
Solutions
- Confirm the H2 dependency is on the classpath (com.h2database:h2) and matches the version Appsmith expects.
- Check server memory - restart the JVM with a larger heap if OOM preceded the failure.
- Inspect the chained SQLException message (it is appended to the error) for the precise H2 failure code.
- If running a custom build, ensure no dependency shading strips the H2 driver META-INF/services entry.
Example fix
// before
try {
connection = DriverManager.getConnection(URL);
} catch (SQLException e) {
log.error(e.getMessage());
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_IN_MEMORY_FILTERING_ERROR,
"Failed to connect to the in memory database. Unable to perform filtering : " + e.getMessage());
}
// after - log full stack and chain the cause
} catch (SQLException e) {
log.error("H2 in-memory connection failed for URL {}", URL, e);
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_IN_MEMORY_FILTERING_ERROR,
"Failed to connect to the in memory database: " + e.getMessage(), e);
} Defensive patterns
Strategy: try-catch
Validate before calling
// Validate the H2 driver is loadable before constructing FilterDataServiceCE
try {
Class.forName("org.h2.Driver");
} catch (ClassNotFoundException e) {
throw new IllegalStateException("H2 JDBC driver missing from classpath; filtering will be unavailable", e);
}
// also verify memory headroom
if (Runtime.getRuntime().freeMemory() < 16L * 1024 * 1024) {
throw new IllegalStateException("Insufficient heap for in-memory H2 filter DB");
} Type guard
public static boolean h2DriverAvailable() {
try {
Class.forName("org.h2.Driver");
return true;
} catch (ClassNotFoundException e) {
return false;
}
} Try / catch
FilterDataServiceCE service;
try {
service = new FilterDataServiceCE();
} catch (AppsmithPluginException e) {
log.error("In-memory filter DB unavailable, filtering disabled", e);
// degrade gracefully: return unfiltered results
service = null;
} Prevention
- Pin the H2 dependency version Appsmith expects.
- Monitor JVM heap; restart under OOM conditions.
- Ensure dependency shading does not strip H2's META-INF/services entry.
When it happens
Trigger: H2 JDBC driver missing from the classpath, the JVM out of memory (the in-memory DB cannot allocate), an H2 version conflict where the URL format is rejected, file-system / tmp issues for H2 shadow files, or another classloader already holding an incompatible H2 instance.
Common situations: Running Appsmith in a container where the H2 dependency was shaded out; OOM conditions under heavy load; a custom Appsmith build that excludes the h2 dependency; JDK upgrade that breaks the bundled H2 driver.
Related errors
AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12).
Data as JSON: /api/errors/03533e2ff0e44594.
Report an issue: GitHub.