Search code examples
javascriptcube.js

Error Continue wait issue on Cube.js backend


I'm having some trouble connecting to the cube.js backend on AWS serverless and executing the /cubejs-api/v1/load request in the frontend dashboard. I keep getting {"error":"Continue wait"} instead of a result returned. I am following the react-dashboard guide for authentication but deployed using the backend cube.js serverless AWS template. This is what my main cube.js file looks like.:

const AWSHandlers = require('@cubejs-backend/serverless-aws');
const PostgresDriver = require('@cubejs-backend/postgres-driver');
const fs = require("fs");
const jwt = require("jsonwebtoken");
const jwkToPem = require("jwk-to-pem");
const jwks = JSON.parse(fs.readFileSync("jwks.json"));
const _ = require("lodash");

module.exports = new AWSHandlers({
  checkAuth: async (req, auth) => {
    const decoded = jwt.decode(auth, { complete: true });
    const jwk = _.find(jwks.keys, x => x.kid === decoded.header.kid);
    const pem = jwkToPem(jwk);
    req.authInfo = jwt.verify(auth, pem);
  },
  externalDbType: 'postgres',
  externalDriverFactory: () => new PostgresDriver({
    host: process.env.CUBEJS_EXT_DB_HOST,
    database: process.env.CUBEJS_EXT_DB_NAME,
    port: process.env.CUBEJS_EXT_DB_PORT,
    user: process.env.CUBEJS_EXT_DB_USER,
    password: process.env.CUBEJS_EXT_DB_PASS,
  })
});

I didn't have the redis URL set correctly initially and fixed the connection to redis after adding redis:// extension before the url to the serverless.yml file to fix that so I know it's not redis connection issue. I'm assuming there's some other problem.

The cubejs process function has no logs at all. I have setup a NAT gateway and subnets according to the guide on the deployment site so that i have 1 subnet for each zone just for the lambda and they have been added to the new NAT gateway that was created and to the 2 functions so they have internet access.

What could be the issue? Did I configure something wrong or do I need to make changes to something?


Solution

  • @cubejs-backend/serverless uses internet connection to access messaging API as well as Redis inside VPC for managing queue and cache.

    Such continuous Continue wait messages usually mean that there's a problem with internet connection or with Redis connection. If it's Redis you'll usually see timeouts after 5 minutes or so in both cubejs and cubejsProcess functions. If it's internet connection you will never see any logs of query processing in cubejsProcess function.