{"record":{"id":"8fd181f15304ad3e","repo":"cube-js/cube","slug":"value-maxage-is-not-valid-for-cubejs-touch-pr","errorCode":null,"errorMessage":"Value \"${maxAge}\" is not valid for CUBEJS_TOUCH_PRE_AGG_CACHE_MAX_AGE. Must be less or equal then CUBEJS_TOUCH_PRE_AGG_TIMEOUT (${touchPreAggregationTimeout}).","messagePattern":"Value \"(.+?)\" is not valid for CUBEJS_TOUCH_PRE_AGG_CACHE_MAX_AGE\\. Must be less or equal then CUBEJS_TOUCH_PRE_AGG_TIMEOUT \\((.+?)\\)\\.","errorType":"validation","errorClass":"InvalidConfiguration","httpStatus":null,"severity":"error","filePath":"packages/cubejs-backend-shared/src/env.ts","lineNumber":776,"sourceCode":"   * Max number of elements\n   */\n  touchPreAggregationCacheMaxCount: (): number => get('CUBEJS_TOUCH_PRE_AGG_CACHE_MAX_COUNT')\n    .default(8192)\n    .asInt(),\n\n  /**\n   * Max cache\n   */\n  touchPreAggregationCacheMaxAge: (): number => {\n    // eslint-disable-next-line no-use-before-define\n    const touchPreAggregationTimeout = getEnv('touchPreAggregationTimeout');\n\n    const maxAge = get('CUBEJS_TOUCH_PRE_AGG_CACHE_MAX_AGE')\n      .default(Math.round(touchPreAggregationTimeout / 2))\n      .asIntPositive();\n\n    if (maxAge > touchPreAggregationTimeout) {\n      throw new InvalidConfiguration(\n        'CUBEJS_TOUCH_PRE_AGG_CACHE_MAX_AGE',\n        maxAge,\n        `Must be less or equal then CUBEJS_TOUCH_PRE_AGG_TIMEOUT (${touchPreAggregationTimeout}).`\n      );\n    }\n\n    return maxAge;\n  },\n\n  /**\n   * Expire time for touch records\n   */\n  touchPreAggregationTimeout: (): number => get('CUBEJS_TOUCH_PRE_AGG_TIMEOUT')\n    .default(60 * 60 * 24)\n    .asIntPositive(),\n\n  /**\n   * Maximum time for exponential backoff for pre-aggs (in seconds)","sourceCodeStart":758,"sourceCodeEnd":794,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-backend-shared/src/env.ts#L758-L794","documentation":"Configuration consistency check in env.ts touchPreAggregationCacheMaxAge: CUBEJS_TOUCH_PRE_AGG_CACHE_MAX_AGE was parsed successfully as a positive int but exceeds CUBEJS_TOUCH_PRE_AGG_TIMEOUT, which is meaningless — the cache max age must be shorter than the touch timeout. Fires when the accessor is first invoked.","triggerScenarios":"Thrown at packages/cubejs-backend-shared/src/env.ts:776 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Lower CUBEJS_TOUCH_PRE_AGG_CACHE_MAX_AGE to a value less than or equal to CUBEJS_TOUCH_PRE_AGG_TIMEOUT.","Alternatively raise CUBEJS_TOUCH_PRE_AGG_TIMEOUT if the larger max age is intended.","Unset CUBEJS_TOUCH_PRE_AGG_CACHE_MAX_AGE to use the default (half the timeout)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}