cube-js/cube · error · Error

Python is not supported in fallback build

Error message

Python is not supported in fallback build

What it means

Capability guard in pythonLoadConfig (cubejs-backend-native): raised when Python-based data model configuration is requested while running the fallback (no-native) build, which cannot execute the embedded Python runtime. Sentinel error indicating the feature requires a full native build.

Source

Thrown at packages/cubejs-backend-native/js/index.ts:560

function simplifyExpressRequest(req: ExpressRequest) {
  // Req is a large object, let's simplify it
  // Important: Dont pass circular references
  return {
    url: req.url,
    method: req.method,
    headers: req.headers,
    ip: req.ip,

    // req.securityContext is an extension of request done by api-gateway
    // But its typings currently live in api-gateway package, which has native-backend (this package) as it's dependency
    // TODO extract typings to separate package and drop as any
    ...(Object.hasOwn(req, 'securityContext') ? { securityContext: (req as any).securityContext } : {}),
  };
}

export const pythonLoadConfig = async (content: string, options: { fileName: string }): Promise<PyConfiguration> => {
  if (isFallbackBuild()) {
    throw new Error('Python is not supported in fallback build');
  }

  const native = loadNative();
  const config = await native.pythonLoadConfig(content, options);

  if (config.checkAuth) {
    const nativeCheckAuth = config.checkAuth;
    config.checkAuth = async (req: ExpressRequest, authorization: string) => {
      const nativeResult = await nativeCheckAuth(
        simplifyExpressRequest(req),
        authorization,
      );
      const securityContext = nativeResult?.security_context;
      return {
        ...(securityContext ? { security_context: securityContext } : {})
      };
    };
  }

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Deploy a full native build of cubejs-backend-native for your platform (see README supported architectures).
  2. Remove or disable Python (py) data model usage if the deployment must stay on the fallback build.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/cubejs-backend-native/js/index.ts:560 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/e19ef7e2b0178351. Report an issue: GitHub.