{"record":{"id":"65fc328b0878d16a","repo":"cube-js/cube","slug":"the-query-action-action-type-doesn-t-supporte","errorCode":null,"errorMessage":"The '${query.action}' action type doesn't supported.","messagePattern":"The '(.+?)' action type doesn't supported\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-api-gateway/src/gateway.ts","lineNumber":1091,"sourceCode":"            context,\n            <PreAggsSelector>value.selector\n          );\n          if (result.length === 0) {\n            throw new UserError(\n              'A user\\'s selector doesn\\'t match any of the ' +\n              'pre-aggregations defined in the data model.'\n            );\n          }\n          break;\n        case 'get':\n          result = await this.preAggregationsJobsGET(\n            context,\n            <string[]>query.tokens,\n            query.resType,\n          );\n          break;\n        default:\n          throw new Error(`The '${query.action}' action type doesn't supported.`);\n      }\n      this.event(`pre_aggregations_jobs_${query.action}`, {\n        source: req.header('source') || 'unknown',\n      });\n      response(result, { status: 200 });\n    } catch (e: any) {\n      this.handleError({ e, context, query, res: response, requestStarted });\n    }\n  }\n\n  /**\n   * Post pre-aggregations build jobs entry point.\n   */\n  private async preAggregationsJobsPOST(\n    context: RequestContext,\n    selector: PreAggsSelector,\n  ): Promise<string[]> {\n    let jobs: string[] = [];","sourceCodeStart":1073,"sourceCodeEnd":1109,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-api-gateway/src/gateway.ts#L1073-L1109","documentation":"The pre-aggregations jobs endpoint supports exactly two actions: 'post' (queue build jobs) and 'get' (poll job status by tokens). Any other value of `query.action` reaches the switch's `default` branch. Note this is a plain `Error`, not a `UserError` — a quirk, since it is really a client mistake — and it surfaces as an internal-style error response.","triggerScenarios":"POSTing to `/cubejs-system/v1/pre-aggregations/jobs` with an `action` value other than 'post' or 'get' (e.g., 'build', 'refresh', 'POST', 'Post', or a missing action that somehow passed earlier checks). Note: an absent/invalid action usually fails Joi validation first (error 5), so this branch fires mainly when the schema permits the value but the switch doesn't handle it.","commonSituations":"Migrating scripts written against older Cube APIs or docs that used different action names; case-sensitivity mistakes ('POST' vs 'post'); typos like 'post jobs' or 'build'; copying endpoint examples from other Cube endpoints (e.g., the pre-aggregations preview API) into the jobs endpoint.","solutions":["Set `action` to exactly 'post' (queue builds) or 'get' (poll by `tokens`) — lowercase.","If you wanted to trigger a build, use `action: 'post'` with a `selector`; if you wanted status, use `action: 'get'` with `tokens` returned from a previous post.","Check your Cube version's gateway code/docs: the accepted action set is defined by the `switch` in `preAggregationsJobs` and the Joi schema.","If you believe a new action should be supported, it is not — use the pre-aggregations build/preview HTTP endpoints or the orchestration API instead."],"exampleFix":"// before\n{ \"action\": \"BUILD\", \"selector\": { \"cubes\": [\"Events\"] } }\n\n// after\n{ \"action\": \"post\", \"selector\": { \"cubes\": [\"Events\"], \"timezones\": [\"UTC\"] } }","handlingStrategy":"type-guard","validationCode":"const VALID_ACTIONS = ['post', 'get'];\nfunction assertValidAction(body) {\n  if (!VALID_ACTIONS.includes(body?.action)) {\n    throw new Error(`action must be one of ${VALID_ACTIONS.join(', ')}; got ${body?.action}`);\n  }\n}","typeGuard":"function hasSupportedAction(q: unknown): q is { action: 'post' | 'get' } {\n  return !!q && typeof q === 'object' &&\n    ((q as any).action === 'post' || (q as any).action === 'get');\n}","tryCatchPattern":"try {\n  const res = await postPreAggJobs(payload);\n} catch (e) {\n  if (String(e.message).includes(\"action type doesn't supported\")) {\n    console.error(`Unsupported action \"${payload.action}\"; use 'post' or 'get'`);\n  }\n}","preventionTips":["Type the action field as the literal union 'post' | 'get' in client code.","Never construct the action string dynamically or from user input without whitelisting.","Remember the value is case-sensitive and lowercase."],"tags":["rest-api","pre-aggregations","invalid-action","request-format"],"backgroundTag":"unsupported-action-value","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}