Skip to content

chore(cubejs): upgrade Cube.js 1.7.30 -> 1.8.16 - #102

Merged
acmeguy merged 2 commits into
mainfrom
chore/cube-1.8.16
Oct 31, 2026
Merged

acmeguy merged 2 commits into
mainfrom
chore/cube-1.8.16

Conversation

@acmeguy

@acmeguy acmeguy commented Oct 31, 2026

Copy link
Copy Markdown

Summary

Upgrades all @cubejs-backend/* from 1.7.30 to 1.8.16 and fixes everything the upgrade breaks or newly exposes.

Breaks fixed

  • Base image → bookworm. Cube ≥1.7.36's x86_64 native module needs glibc 2.34; bullseye has 2.31 (GLIBC_2.32 not found at load). The build now fails fast if @cubejs-backend/native cannot load.
  • Java 8 → 21. The JDBC drivers start the JVM with --add-opens, which Java 8 rejects by segfaulting the process.
  • driverFactory builds drivers with ServerCore.createDriver. Since 1.7.37 drivers ship ESM entry points, and new (await import(pkg)).default() threw "is not a constructor" on every raw-driver route (test connection, get-schema, smart-gen, exports…).
  • loadExport imports QueryType from the api-gateway root. 1.8 renamed the dist enum, and the named import failed at link time, so the server would not start.
  • Postinstall: gate on 1.8.16; drop the ClickHouse String patch (fixed upstream in 1.7.38). The other four patches still apply unchanged.
  • Removed upstream: the Elasticsearch driver (gone since 1.7.0; ES datasources already failed on 1.7.30). The @knowitall Vertica alias is swapped for the official driver.

Security (new exposure from the upgrade)

  • Tenant datasource types duckdb, sqlite, jdbc, databricks-jdbc, cubestore are refused.
    • DuckDB starts loading on bookworm and can read any file on the pod; /proc/self/environ holds JWT_KEY.
    • JDBC starts working on Java 21, and a tenant customClassPath can load the bundled HSQLDB/Derby jars and run Java in our JVM.
    • cubestore is our own store, holding every tenant's pre-aggregations.
    • Only types Cube knows are accepted, so the third-party package lookup by type name never runs. Dev uses only ClickHouse, Postgres and BigQuery.
  • Join aliases (new in 1.8): under row rules, member paths through a model-declared join alias are rejected, because row rules attach to a path's first segment.

Dependency hygiene

  • extract-zip shim removed: nothing in the tree requests it any more.
  • Production npm audit: 97 → 79 findings, criticals 3 → 1, none introduced.

Verification

  • arm64 image: yarn test 727/727; the new tests fail on the old driverFactory/loadExport (is not a constructor, Named export 'QueryType' not found).
  • Local side-by-side, 1.7.30 vs 1.8.16 (with CubeStore 1.8.16) on real ClickHouse/BigQuery/Postgres datasources: 25 datasources, /meta member lists identical.
    • /load: 109 identical results, 0 new-only errors. The 38 queries that fail on both versions are pre-existing model or data errors.
    • The one remaining difference is freshness: the old stack serves a rollup last refreshed 2026-10-22; 1.8.16 had just rebuilt it.
    • CSV and Arrow exports, test, get-schema and the SQL API (row-rule partition filter injected) all match.
  • Refresh worker on 1.8.16: builds rollups. BigQuery "table not found" errors fail only that build; the worker stays up, so the stream patch still holds.
  • Adversarial review (3 lenses + 2 refuters per finding); the confirmed findings are fixed in the second commit.
  • CI on this PR: amd64 build + native load check + test suite.

Deploy notes (dev)

  • Merge order:
    1. cxs2 #2159, so usedPreAggregations in /load is read as an object.
    2. The fraios infra PR, which keeps dev query pods building rollups on demand (Cube 1.7.47+ ignores NODE_ENV=development), keeps query-log values unredacted, and moves CubeStore to 1.8.16.
    3. This PR.
  • Rollup rebuilds: only rollups that count on a ClickHouse cube with a composite primary key rebuild (the cast changes to Nullable(String)); 54/55 sampled rollups keep their table version.

Not in this PR (pre-existing, found during review)

🤖 Generated with Claude Code

acmeguy and others added 2 commits October 31, 2026 08:59
Bumps all @cubejs-backend/* to 1.8.16 and fixes what the upgrade breaks:

- Dockerfile: bookworm base (glibc 2.36). Cube's x86_64 native module needs
  glibc 2.34 since 1.7.36; bullseye has 2.31. Java 21 replaces Java 8, which
  crashed the process on the JDBC drivers' --add-opens. Skip the bundled
  cubestored download (CubeStore runs as its own service), drop the unused
  Simba Databricks jar, and fail the build if the native module cannot load.
- driverFactory: build drivers with Cube's own resolver. Drivers ship ESM
  entry points since 1.7.37, so `new (await import(pkg)).default()` threw
  "is not a constructor" on every raw-driver route.
- driverFactory: refuse duckdb, sqlite and cubestore for tenant datasources.
  The upgrade makes DuckDB load, and it can read any file on the pod
  (/proc/self/environ holds JWT_KEY); cubestore holds every tenant's
  pre-aggregations. Only types Cube knows are accepted.
- loadExport: import QueryType from the api-gateway root; 1.8 renamed the
  dist enum and the named import failed at link time, so the server could
  not start.
- queryRewrite: under row rules, reject member paths through join aliases
  (new in 1.8). Rules attach to a path's first segment, so an aliased cube's
  rules would not apply.
- Drop the Elasticsearch driver (removed upstream in 1.7.0) and swap the
  @knowitall Vertica alias for the official driver.
- Postinstall: gate on 1.8.16; drop the ClickHouse String patch (fixed
  upstream in 1.7.38). The extract-zip shim goes: nothing in the tree
  requests extract-zip any more. Production audit: 97 -> 79 findings,
  criticals 3 -> 1, none introduced.
- Tests: routes link against the installed packages; driverFactory builds
  real drivers and refuses blocked types; join-alias guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- driverFactory: also refuse jdbc and databricks-jdbc. With Java 21 they now
  start, and a tenant-supplied customClassPath/drivername can load the HSQLDB
  or Derby jar bundled in the image and run Java in our JVM. Neither worked
  before (Java 8 crashed on --add-opens), so nothing in use is lost.
- queryRewrite: the join-alias guard keys on the aliases models declare on
  their joins. Keying on "second segment is a known dimension" rejected
  granularity-ordered queries on views and on dimensions inherited through
  `extends`.
- compose: the local query container keeps building missing rollups on demand
  (Cube 1.7.47+ no longer reads NODE_ENV as dev mode).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@acmeguy
acmeguy merged commit 9b72009 into main Oct 31, 2026
3 checks passed
acmeguy added a commit that referenced this pull request Oct 31, 2026
Cube removed its Elasticsearch driver and SQL dialect in 1.7.0, so every
Elasticsearch datasource has failed since the 1.7.30 deploy, and #102 dropped
the package. Database support does not disappear: the 1.6.76 driver and
dialect are vendored as a local package (drivers/elasticsearch, Apache-2.0),
which Cube resolves as `elasticsearch-cubejs-driver` for the type it no
longer ships, with the dialect from the driver's static dialectClass().

Running on Cube 1.8:
- driver on the installed base-driver/shared (the 1.6 package would install
  its old tree, decompress 4 included); Elasticsearch env vars read directly,
  since shared 1.8 dropped their names;
- dialect always on the JS planner (as on 1.6; Tesseract has no
  Elasticsearch templates);
- tablesSchema skips system indices (".geoip_databases" on 7.17 aborted the
  whole listing, so model generation failed);
- prepareDbParams' elasticsearch case is back, without the fall-through into
  the Snowflake case.

Verified against a real Elasticsearch 7.17: test connection, table listing,
grouped measures, day granularity with a date range and filters return the
right rows with CUBEJS_TESSERACT_SQL_PLANNER=true. 750/750 in the image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
acmeguy added a commit that referenced this pull request Oct 31, 2026
Cube removed its Elasticsearch driver and SQL dialect in 1.7.0, so every
Elasticsearch datasource has failed since the 1.7.30 deploy, and #102 dropped
the package. Database support does not disappear: the 1.6.76 driver and
dialect are vendored as a local package (drivers/elasticsearch, Apache-2.0),
which Cube resolves as `elasticsearch-cubejs-driver` for the type it no
longer ships, with the dialect from the driver's static dialectClass().

Running on Cube 1.8:
- driver on the installed base-driver/shared (the 1.6 package would install
  its old tree, decompress 4 included); Elasticsearch env vars read directly,
  since shared 1.8 dropped their names;
- dialect always on the JS planner (as on 1.6; Tesseract has no
  Elasticsearch templates);
- tablesSchema skips system indices (".geoip_databases" on 7.17 aborted the
  whole listing, so model generation failed);
- prepareDbParams' elasticsearch case is back, without the fall-through into
  the Snowflake case.

Verified against a real Elasticsearch 7.17: test connection, table listing,
grouped measures, day granularity with a date range and filters return the
right rows with CUBEJS_TESSERACT_SQL_PLANNER=true. 750/750 in the image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
acmeguy added a commit that referenced this pull request Oct 31, 2026
Cube removed its Elasticsearch driver and SQL dialect in 1.7.0, so every
Elasticsearch datasource has failed since the 1.7.30 deploy, and #102 dropped
the package. Database support does not disappear: the 1.6.76 driver and
dialect are vendored as a local package (drivers/elasticsearch, Apache-2.0),
which Cube resolves as `elasticsearch-cubejs-driver` for the type it no
longer ships, with the dialect from the driver's static dialectClass().

Running on Cube 1.8:
- driver on the installed base-driver/shared (the 1.6 package would install
  its old tree, decompress 4 included); Elasticsearch env vars read directly,
  since shared 1.8 dropped their names;
- dialect always on the JS planner (as on 1.6; Tesseract has no
  Elasticsearch templates);
- tablesSchema skips system indices (".geoip_databases" on 7.17 aborted the
  whole listing, so model generation failed);
- prepareDbParams' elasticsearch case is back, without the fall-through into
  the Snowflake case.

Verified against a real Elasticsearch 7.17: test connection, table listing,
grouped measures, day granularity with a date range and filters return the
right rows with CUBEJS_TESSERACT_SQL_PLANNER=true. 750/750 in the image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant