{"record":{"id":"e3da5d091af5b704","repo":"appsmithorg/appsmith","slug":"pe-arg-5000-e3da5d","errorCode":"PE-ARG-5000","errorMessage":"Query failed to execute because query is not configured.","messagePattern":"Query failed to execute because query is not configured\\.","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/anthropicPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java","lineNumber":72,"sourceCode":"    @Override\n    public URI createTriggerUri() {\n        return UriComponentsBuilder.fromUriString(CLOUD_SERVICES + MODELS_API)\n                .queryParam(PROVIDER, ANTHROPIC)\n                .queryParam(COMMAND, CHAT_V2)\n                .build()\n                .toUri();\n    }\n\n    @Override\n    public URI createExecutionUri() {\n        return RequestUtils.createUriFromCommand(AnthropicConstants.CHAT);\n    }\n\n    @Override\n    public AnthropicRequestDTO makeRequestBody(ActionConfiguration actionConfiguration) {\n        Map<String, Object> formData = actionConfiguration.getFormData();\n        if (CollectionUtils.isEmpty(formData)) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                    String.format(STRING_APPENDER, EXECUTION_FAILURE, QUERY_NOT_CONFIGURED));\n        }\n\n        AnthropicRequestDTO anthropicRequestDTO = new AnthropicRequestDTO();\n        String model = RequestUtils.extractDataFromFormData(formData, CHAT_MODEL_SELECTOR);\n\n        if (!StringUtils.hasText(model)) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                    String.format(STRING_APPENDER, EXECUTION_FAILURE, MODEL_NOT_SELECTED));\n        }\n        Float temperature = getTemperatureFromFormData(formData);\n        anthropicRequestDTO.setTemperature(temperature);\n        anthropicRequestDTO.setModel(model);\n\n        anthropicRequestDTO.setMaxTokens(getMaxTokenFromFormData(formData));\n        anthropicRequestDTO.setMessages(createMessages(formData));","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/anthropicPlugin/src/main/java/com/external/plugins/commands/ChatCommand.java#L54-L90","documentation":"Thrown by the Anthropic Chat command's makeRequestBody when the action's formData map is null or empty (CollectionUtils.isEmpty). It is the earliest guard in request building: before any field is read the plugin asserts that the query was actually configured. The message is assembled via STRING_APPENDER (\"%s %s\") joining EXECUTION_FAILURE (\"Query failed to execute because\") with QUERY_NOT_CONFIGURED (\"query is not configured.\"). Code PE-ARG-5000 maps to PLUGIN_EXECUTE_ARGUMENT_ERROR.","triggerScenarios":"Calling the Anthropic plugin's Chat command execute path with an ActionConfiguration whose getFormData() returns null or an empty map. This happens when a query/action is saved with no form fields populated, or when the action configuration object is constructed programmatically without formData.","commonSituations":"Creating a new Anthropic chat query in the Appsmith editor and immediately running it without filling any field; importing/migrating an action whose formData was stripped; programmatically triggering an action via API with an incomplete payload.","solutions":["Open the query in the Appsmith editor and fill in at least the model selector and one message before running.","If invoking programmatically, ensure the ActionConfiguration.formData map is populated with the expected keys (model selector, messages).","Check that the action was saved after configuration edits and that no import/migration step dropped formData."],"exampleFix":"// before\nActionConfiguration cfg = new ActionConfiguration();\ncfg.setFormData(null); // or empty map\n// after\nMap<String, Object> formData = new HashMap<>();\nformData.put(\"model\", \"claude-3-5-sonnet\");\nformData.put(\"messages\", List.of(Map.of(\"role\", \"user\", \"content\", \"hi\")));\ncfg.setFormData(formData);","handlingStrategy":"validation","validationCode":"// Before invoking the Chat command, assert formData is populated\nMap<String, Object> formData = actionConfiguration.getFormData();\nif (CollectionUtils.isEmpty(formData)) {\n    // surface a user-facing message instead of triggering PE-ARG-5000\n    throw new IllegalArgumentException(\"Configure the query: formData is empty.\");\n}","typeGuard":"// Java guard: confirm formData is a non-empty map\nboolean isFormDataConfigured(Map<String, Object> formData) {\n    return formData != null && !formData.isEmpty();\n}","tryCatchPattern":"try {\n    AnthropicRequestDTO dto = chatCommand.makeRequestBody(actionConfiguration);\n} catch (AppsmithPluginException e) {\n    if (e.getAppsmithError() == AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR) {\n        // prompt user to configure the query\n    }\n}","preventionTips":["Run a query only after the editor marks all required fields as filled.","When building ActionConfiguration programmatically, always set a non-empty formData.","After import/migration, smoke-test actions to catch stripped formData early."],"tags":["anthropic","appsmith","validation","configuration","chat"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}