cube-js / cube-js/cube

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

Open
#6,788 5 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

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)](https://github.com/cube-js/cube/assets/132644001/479161f8-236d-4082-9d94-8a8bd1483576)

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.