Budibase/budibase · error
automationId and appId are required
Error message
automationId and appId are required
What it means
clearAutomationLogErrors in the builder automations store requires both automationId and appId to call the API that clears an automation's log errors. If either is falsy it throws 'automationId and appId are required'. This is a fast-fail argument validation to avoid an API call with an invalid URL.
Source
Thrown at packages/builder/src/stores/builder/automations.ts:1617
page?: string
} = {}) => {
return await API.getAutomationLogs({
automationId,
startDate,
status,
page,
})
},
clearLogErrors: async ({
automationId,
appId,
}: {
automationId: string
appId: string
}) => {
if (!automationId || !appId) {
throw new Error("automationId and appId are required")
}
return await API.clearAutomationLogErrors(automationId, appId)
},
addTestDataToAutomation: (data: any) => {
let newAutomation = cloneDeep(get(selectedAutomation)?.data)
if (!newAutomation) {
return newAutomation
}
newAutomation.testData = {
...newAutomation.testData,
...data,
}
return newAutomation
},
constructBlock: (
type: BlockDefinitionTypes,View on GitHub (pinned to a81a902e9a)
Solutions
- Pass both automationId and appId explicitly when calling clearAutomationLogErrors.
- Gate the UI action until an automation is selected and the app id is available.
- Derive appId from the route/store before invoking instead of relying on optional context.
Example fix
// before
await automationActions.clearAutomationLogErrors({ automationId: selected?._id })
// after
await automationActions.clearAutomationLogErrors({ automationId: selected._id, appId: getAppId() }) Defensive patterns
Strategy: validation
Validate before calling
const id = get(selectedAutomation)?._id
const appId = getAppId()
if (!id || !appId) return // don't call; nothing selected or app context not ready
await automationActions.clearAutomationLogErrors({ automationId: id, appId }) Type guard
const canClearErrors = (p: { automationId?: string; appId?: string }): p is { automationId: string; appId: string } =>
typeof p.automationId === "string" && p.automationId.length > 0 && typeof p.appId === "string" && p.appId.length > 0 Try / catch
try {
await automationActions.clearAutomationLogErrors({ automationId, appId })
} catch (e) {
if (e.message === "automationId and appId are required") {
console.warn("No automation/app selected; skipping clear errors")
return
}
throw e
} Prevention
- Disable clear-errors actions until an automation is selected and the app id is loaded.
- Resolve appId from the route/store at call time rather than optional parameters.
- Add early returns in handlers when selection state is incomplete.
When it happens
Trigger: Invoking automationActions.clearAutomationLogErrors({ automationId, appId }) with either field undefined/empty — e.g. clear-all-errors clicked before an automation is selected, or appId not yet loaded in the route/store context.
Common situations: Calling from a shared component used outside the automations screen; running the action during initial page load before route params resolve; programmatic store use where appId was never passed in.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Source table '${relationship.sourceTable}' not found in data
- Target table '${relationship.targetTable}' not found in data
- Invalid custom REST template
- Query ID or Revision is missing
- Failed to generate a unique name for the row action
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/0c3712990fd1fd6b.
Report an issue: GitHub.