Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-aggregations error #38

Open
NassimSehdi-Modeo opened this issue Nov 20, 2023 · 1 comment
Open

Pre-aggregations error #38

NassimSehdi-Modeo opened this issue Nov 20, 2023 · 1 comment

Comments

@NassimSehdi-Modeo
Copy link

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: ''
},
}
]
};

@anshjain18
Copy link

+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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants