Open NassimSehdi-Modeo opened 11 months ago
+1, getting this error myself as well. Running Cube in production mode, with separate refresh worker instance. As soon as I switch to dev mode, it builds all the pre-aggregations. @lvauvillier can we please check this out
I setup my cubejs app in gke and everything was working fine until I decided to add pre-aggregations to my schemas. I am getting this error everytime I launch a get request to the api: Error: No pre-aggregation partitions were built yet for the pre-aggregation serving this query and this API instance wasn't set up to build pre-aggregations. Please make sure your refresh worker is configured correctly, running, pre-aggregation tables are built and all pre-aggregation refresh settings like timezone match
Here is the config file I am using: // Cube.js configuration options: https://cube.dev/docs/config // NOTE: third-party dependencies and the use of require(...) are disabled for // CubeCloud users by default. Please contact support if you need them // enabled for your account. You are still allowed to require // @cubejs-backend/*-driver packages.
const path = require("path"); const fs = require("fs");
module.exports = { contextToAppId: ({ securityContext }) =>
CUBEJS_APP_${securityContext.tenant_id}
, repositoryFactory: () => ({ dataSchemaFiles: async () => { const files = await fs.promises.readdir( path.join(process.cwd(), "schema") ); return await Promise.all( files .filter((file) => file.endsWith(".js") || file.endsWith(".yaml")) .map(async (file) => ({ fileName: file, content: await fs.promises.readFile( path.join(process.cwd(), "schema", file), "utf-8" ), })) ); }, }), scheduledRefreshContexts: () => [ { securityContext: { tenant_id: 'modeo', role: '' } }, { securityContext: { tenant_id: 'heelio', role: '' }, }, { securityContext: { tenant_id: 'tmf', role: '' }, } ] };