appsmithorg/appsmith · error · AppsmithPluginException

PE-DSE-5003

PE-DSE-5003

Error message

messages are not provided in the configuration

What it means

Thrown inside ChatCommand.createMessages when formData does not contain the MESSAGES key at all. Unlike the earlier argument errors this uses PLUGIN_DATASOURCE_ARGUMENT_ERROR (PE-DSE-5003), signalling the configuration shape is wrong. It fires before any attempt to parse the messages structure.

Source

Thrown at app/server/appsmith-plugins/anthropicPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java:100

                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,
                    String.format(STRING_APPENDER, EXECUTION_FAILURE, MODEL_NOT_SELECTED));
        }
        Float temperature = getTemperatureFromFormData(formData);
        anthropicRequestDTO.setTemperature(temperature);
        anthropicRequestDTO.setModel(model);

        anthropicRequestDTO.setMaxTokens(getMaxTokenFromFormData(formData));
        anthropicRequestDTO.setMessages(createMessages(formData));
        if (formData.containsKey(SYSTEM_PROMPT) && formData.get(SYSTEM_PROMPT) != null) {
            anthropicRequestDTO.setSystem(RequestUtils.extractDataFromFormData(formData, SYSTEM_PROMPT));
        }

        return anthropicRequestDTO;
    }

    private List<Message> createMessages(Map<String, Object> formData) {
        if (!formData.containsKey(MESSAGES)) {
            throw new AppsmithPluginException(
                    AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR,
                    "messages are not provided in the configuration");
        }
        List<Map<String, String>> messageMaps = getMessages((Map<String, Object>) formData.get(MESSAGES));
        if (messageMaps == null) {
            throw new AppsmithPluginException(
                    AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR,
                    "messages are not provided in the configuration correctly");
        }
        List<Message> messages = new ArrayList<>();
        for (Map<String, String> messageMap : messageMaps) {
            if (messageMap != null && messageMap.containsKey(ROLE) && messageMap.containsKey(CONTENT)) {
                Message message = new Message();
                Message.TextContent textContent = new Message.TextContent();
                textContent.setText(messageMap.get(CONTENT));

                message.setRole(CommandUtils.getActualRoleValue(messageMap.get(ROLE)));
                message.setContent(List.of(textContent));

View on GitHub (pinned to 8cd9021c24)

Solutions

  1. Add at least one message (role + content) to the query's messages configuration.
  2. Ensure formData contains the MESSAGES key with a populated list before executing.
  3. Re-save the action from the editor so the messages array is persisted.

Example fix

// before
formData.put("model", "claude-3-5-sonnet"); // no MESSAGES key
// after
formData.put("messages", Map.of("messagesList", List.of(Map.of("role","user","content","Hello"))));
Defensive patterns

Strategy: validation

Validate before calling

// Verify MESSAGES key exists before running
if (!formData.containsKey(MESSAGES)) {
    return errorResult("Add at least one message to the query.");
}

Type guard

boolean hasMessagesKey(Map<String, Object> formData) {
    return formData.containsKey(MESSAGES) && formData.get(MESSAGES) != null;
}

Try / catch

try {
    chatCommand.makeRequestBody(actionConfiguration);
} catch (AppsmithPluginException e) {
    if (e.getAppsmithError() == AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR
            && e.getMessage().contains("messages are not provided")) {
        // prompt user to add messages
    }
}

Prevention

When it happens

Trigger: A Chat query whose formData lacks a 'messages' entry entirely — e.g. only model/system-prompt fields were set, or the messages array was deleted from the configuration.

Common situations: User removed the messages section while editing; a partial formData was supplied via API/import omitting the messages key; the UI wizard did not persist the messages array.

Related errors


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