Hidden Assumptions in cube

13 assumptions this code never checks · 5 critical · spanning Environment, Shape, Domain, Temporal, Contract, Resource, Scale, Ordering

Every codebase relies on things it never checks. Most of them are routine. CodeSea looked at cube-js/cube and picked out the few most likely to cause trouble. The full list is just below.

Most of what this code assumes is routine. These 3 are the ones most likely to cause trouble here. The rest are minor; they're under "Show everything".

Worth your attention first

System tries to spawn 'mvn' process that doesn't exist, returns null without error indication, falls back to downloading Maven even when system version might be adequate

Worth your attention first

Accessing rows[i][j] could panic with index out of bounds, or return wrong data if column count mismatches between rows

Worth your attention first

Hash collisions increase dramatically if data cardinality exceeds HLL precision bounds, causing severe underestimation of distinct counts in pre-aggregations

Show everything (10 more)
Temporal

Network requests to Cube Cloud complete within default fetch timeout and cloud endpoints remain stable during deployment operations

If this fails: Long-running deployment operations timeout silently, leaving deployments in undefined state with no retry mechanism

packages/cubejs-backend-cloud/src/cloud.ts:request
Contract

Cube schema definitions loaded from separate modules maintain consistent data types and naming conventions across cube_definition, dimension_definition, and measure_definition

If this fails: SQL planning generates invalid queries when schema modules use incompatible types or column references, causing runtime query failures

rust/cubesqlplanner/cubesqlplanner/src/cube_bridge/mod.rs
Resource

Filesystem has write permissions to create POM files in working directory and sufficient disk space for Maven dependency downloads

If this fails: Maven resolution fails silently when POM file creation fails, JDBC drivers never download, database connections fail with cryptic ClassNotFoundException

packages/cubejs-backend-maven/src/maven.ts:generateXml
Environment

CUBE_CLOUD_HOST environment variable contains valid URL with proper protocol, or defaults to https://cubecloud.dev which remains accessible

If this fails: Authentication requests fail with connection errors if environment points to invalid host or default domain becomes unreachable

packages/cubejs-backend-cloud/src/cloud.ts:getDeploymentToken
Scale

Maven version checking logic assumes semantic versioning format 'X.Y.Z' in Maven output and version numbers fit in 32-bit integers

If this fails: Version parsing fails for non-standard Maven builds or future versions with different format, causing incorrect version comparisons

packages/cubejs-backend-maven/src/maven.ts:MINIMAL_VERSION
Ordering

Column positions in IndexMap maintain stable ordering that matches the sequence of columns in the database result set

If this fails: Column data gets mapped to wrong field names when database driver returns columns in different order than expected, corrupting query results

rust/cubeorchestrator/src/query_message_parser.rs:columns_pos
Shape

HTTP request bodies contain properly shaped JSON that matches expected interface structure for SQL queries, GraphQL queries, or REST API calls

If this fails: Request parsing fails unpredictably when client sends malformed requests, causing unhelpful error messages instead of specific validation feedback

packages/cubejs-api-gateway/src/index.ts:TransformDataRequest
Temporal

HLL sketch data structures remain valid throughout their lifecycle and are not accessed concurrently without proper synchronization

If this fails: Concurrent access to HLL sketches during pre-aggregation builds corrupts internal state, producing incorrect distinct count estimates

rust/cubestore/cubehll/src/lib.rs:sketch
Contract

TypeScript compilation produces CommonJS exports in dist/src that maintain expected interface compatibility with require() calls

If this fails: Module loading fails when TypeScript build output changes export format, breaking driver initialization for Athena connections

packages/cubejs-athena-driver/index.js:toExport
Resource

Network bandwidth supports uploading deployment files and node-fetch handles large file streams without memory exhaustion

If this fails: Large deployment uploads consume excessive memory or timeout, failing deployment process without clear indication of resource limits

packages/cubejs-backend-cloud/src/cloud.ts:fetch

See the full structural analysis of cube: the pipeline, data models, and system behavior that put these assumptions in context.

Full analysis of cube-js/cube →

Frequently Asked Questions

What does cube assume that could break in production?

The one most likely to cause trouble: Maven executable is in system PATH and responds to 'mvn --version' command If this fails, System tries to spawn 'mvn' process that doesn't exist, returns null without error indication, falls back to downloading Maven even when system version might be adequate

How many hidden assumptions does cube have?

CodeSea found 13 assumptions cube relies on but never validates, 5 of them critical, spanning Environment, Shape, Domain, Temporal, Contract, Resource, Scale, Ordering. Most are routine — the analysis flags the two or three most likely to actually bite.

What is a hidden assumption?

Something the code depends on but never checks: a data shape, an ordering, an environment condition, a scale limit, or a contract with another service. It holds until the world it runs in changes, then fails silently.