cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
18.02k stars 1.78k forks source link

Error during upload of pre-aggregation: No such file or directory (os error 2) #6788

Open vishalemids opened 1 year ago

vishalemids commented 1 year ago

I am using Pre-Aggregations with CubeCore (@cubejs-client/core: "^0.33.12"). FrontEnd: Angular

Problem: I am getting an error when I run my code with pre-aggregation (external: true). Its working fine with (external: false)

Error Message:

Error: Error during upload of dev_pre_aggregations.accounts_main_g4ftyje0_qybpynmr_1iaacui-0.csv.gz create table: CREATE TABLE dev_pre_aggregations.accounts_main_g4ftyje0_qybpynmr_1iaacui (accounts__id int, accounts__name varchar(255), accounts__created_at_day timestamp, accounts__count bigint): Internal: No such file or directory (os error 2)

My Pre-Aggregation looks like:

preAggregations: {
    main: {
      refresh_key: {
        every: "10 seconds",
      },
      external: true,
      measures: [accounts.count],
      dimensions: [accounts.name, accounts.id],
      timeDimension: accounts.created_at,
      granularity: `day`,
    },
  }

Complete Account Cube Code:

cube(`accounts`, {
  sql_table: `public.accounts`,
  data_source: `default`,
  joins: {
    business_units: {
      sql: `${CUBE}.business_unit_id = ${business_units}.id`,
      relationship: `many_to_one`,
    },
  },
  measures: {
    count: {
      type: `count`,
    },
  },
  dimensions: {
    id: {
      sql: `id`,
      type: `number`,
      primary_key: true,
    },
    name: {
      sql: `name`,
      type: `string`,
    },
    created_at: {
      sql: `created_at`,
      type: `time`,
    },
    updated_at: {
      sql: `updated_at`,
      type: `time`,
    },
  },
  preAggregations: {
    main: {
      refresh_key: {
        every: "10 seconds",
      },
      external: true,
      measures: [accounts.count],
      dimensions: [accounts.name, accounts.id],
      timeDimension: accounts.created_at,
      granularity: `day`,
    },
  },
});

When I run my code. I am able to see that it is creating csv.gz files in the temp-uploads folder inside CubeStore. But after that I get the error 'No Such file or directory' which is mentioned above. Uploads folder is empty.

image (1)

I am stuck on this issue since quite a while. I tried to put this query on slack but have not got any reply, its been more than a week now. Posting it here hoping to get resolution of this problem.

Thanks for all the help.

paveltiunov commented 1 year ago

@vishalemids Is it an intermittent error or persistent and happens all the time?

vishalemids commented 1 year ago

All the time. @paveltiunov

prochj51 commented 1 year ago

Same here #6765

paveltiunov commented 1 year ago

Your Cube Store cluster is misconfigured

vishalemids commented 1 year ago

Can you point me in direction of how to rectify that? Where exactly is it misconfigured?