appsmithorg/appsmith · error · AppsmithPluginException
PE-FST-5000
PE-FST-5000
Error message
Unable to serialize object of type %s.
What it means
The Firestore plugin's resultToMap serialization helper (FirestorePlugin.java:886-892) throws this when the top-level Firestore query result (isRoot=true) is not one of the recognized types: QuerySnapshot, DocumentReference, Map, or List. The error message includes the actual Java class name via String.format with objResult.getClass().getName(). This is filed under FirestorePluginError.QUERY_EXECUTION_FAILED (PE-FST-5000), indicating a structural mismatch between the Firestore driver's return type and the plugin's serialization logic.
Source
Thrown at app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/plugins/FirestorePlugin.java:887
"path", documentReference.getPath());
} else if (objResult instanceof Map) {
Map<String, Object> resultMap = (Map) objResult;
for (final Map.Entry<String, Object> entry : resultMap.entrySet()) {
resultMap.put(entry.getKey(), resultToMap(entry.getValue(), false));
}
return resultMap;
} else if (objResult instanceof List) {
List<Object> original = (List) objResult;
List<Object> converted = new ArrayList<>();
for (final Object item : original) {
converted.add(resultToMap(item, false));
}
return converted;
} else if (isRoot) {
throw new AppsmithPluginException(
FirestorePluginError.QUERY_EXECUTION_FAILED,
String.format(
FirestoreErrorMessages.OBJECT_SERIALIZATION_FAILED_ERROR_MSG,
objResult.getClass().getName()));
}
return objResult;
}
@Override
public Mono<Firestore> datasourceCreate(DatasourceConfiguration datasourceConfiguration) {
log.debug(Thread.currentThread().getName() + ": datasourceCreate() called for Firestore plugin.");
final DBAuth authentication = (DBAuth) datasourceConfiguration.getAuthentication();
final Set<String> errors = validateDatasource(datasourceConfiguration);
if (!CollectionUtils.isEmpty(errors)) {
return Mono.error(new AppsmithPluginException(
AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR,View on GitHub (pinned to 8cd9021c24)
Solutions
- Check the error message for the %s class name — it tells you exactly which type the serializer could not handle.
- Update the Appsmith Firestore plugin to the latest version, which may add handling for newer SDK return types.
- Simplify the query to return a standard document or collection result rather than a specialized aggregate type.
- If this is reproducible, report the class name to Appsmith support so the resultToMap if-else chain can be extended.
- As a workaround, restructure the query to return a Map or List-shaped result.
Example fix
// The error surfaces the unhandled type, e.g.:
// "Unable to serialize object of type com.google.cloud.firestore.AggregateQuerySnapshot."
// Workaround: use a standard collection query instead of an aggregate:
// before (unhandled aggregate result):
// query.count().get()
// after (standard collection GET):
// db.collection("myCollection").get() Defensive patterns
Strategy: try-catch
Try / catch
// Wrap Firestore plugin calls and catch AppsmithPluginException by error code
try {
const result = await firestoreQuery.run();
} catch (err) {
if (err.code === 'PE-FST-5000' && err.message.includes('Unable to serialize')) {
// The Firestore result type is not handled by the plugin serializer
console.error('Unhandled Firestore result type:', err.message);
// Workaround: use a simpler query that returns standard document/collection results
} else {
throw err;
}
} Prevention
- Keep the Firestore plugin updated to handle newer SDK return types.
- Avoid aggregate or specialized query types that may return non-standard result objects.
- Report the unhandled class name (shown in the error message) to Appsmith support.
When it happens
Trigger: A Firestore operation returns a top-level result object whose Java type is not Map, List, QuerySnapshot, or DocumentReference. This can happen when the Firestore SDK is upgraded and introduces a new return type, when a custom or edge-case query (e.g., aggregate count, batch write) returns a specialized result object, or when the plugin's type-detection chain (lines 860-884) fails to match.
Common situations: 1) Firestore SDK version change introducing new result types not handled by the plugin's if-else chain. 2) Running an aggregation or batch operation whose result wrapper class is not a Map/List/snapshot. 3) Plugin code out of sync with the installed Firestore driver version. 4) A query returning a raw primitive or SDK-internal object at the root level.
Related errors
AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12).
Data as JSON: /api/errors/18cbae2ddaf11356.
Report an issue: GitHub.