cube-js / cube-js/cube

I'm encountering a 'connect ETIMEDOUT' error in cubejs backend api

Open
#7,970 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

"Hey everyone,
I'm currently working on integrating Cube.js backend API with MySQL, but I'm encountering a 'connect ETIMEDOUT' error. I'm using Node.js version 16. Any ideas on how to troubleshoot or resolve this issue? Your assistance would be much appreciated. Thanks!"
```
"dependencies": {
"@cubejs-backend/mongobi-driver": "^0.29.0",
"@cubejs-backend/mysql-driver": "^0.29.0",
"@cubejs-backend/server": "^0.29.0"
}
}
```
**here is my graphql code:**
```js
import { formatLockVisibilityConstraintsSql } from './helpers';

cube(`Lock`, {
sql: `SELECT _id, lockId, shortName, timeZone FROM \`Lock\` WHERE (
_id in ('${formatLockVisibilityConstraintsSql(USER_CONTEXT.adminKeys.unsafeValue())}')
)`,
// sql: `SELECT _id, lockId, shortName, _created_at FROM \`Lock\``,

refreshKey: {
sql: `SELECT GREATEST(
(SELECT _created_at FROM \`Lock\` ORDER BY _created_at DESC LIMIT 1),
(SELECT _updated_at FROM \`Lock\` ORDER BY _updated_at DESC LIMIT 1)
)`
},

joins: {
KeyRelationship: {
relationship: `hasMany`,
sql: `CONCAT("Lock$", ${CUBE}.objectId) = ${KeyRelationship}._p_key`
},

// Action: {
// relationship: `hasMany`,
// sql: `CONCAT("Lock$", ${CUBE}.objectId) = ${Action}._p_lock`
// },

// Unlock: {
// relationship: `belongsTo`,
// sql: `CONCAT("Lock$", ${CUBE}.objectId) = ${Unlock}._p_lock`
// }
},

dimensions: {
objectId: {
sql: `${CUBE}.\`_id\``,
shown: false,
type: `string`,
primaryKey: true
},

lockId: {
sql: `${CUBE}.\`lockId\``,
shown: true,
type: `string`,
title: `Lock ID`,
meta: {
columnFlex: .5
}
},

shortName: {
sql: `${CUBE}.\`shortName\``,
shown: true,
type: `string`,
title: `Lock Short Name`
},

displayName: {
sql: `${CUBE}.\`shortName\``,
shown: true,
type: `string`,
title: `Lock Display Name`,
meta: {
linkIfAvailable: `Lock.portalLink`,
}
},

portalLink: {
sql: `CONCAT('/keys/', ${lockId})`,
type: `string`,
format: `link`
},

// timeZone: {
// sql: `${CUBE}.\`timeZone\``,
// shown: true,
// type: `string`,
// title: `Time Zone`
// },
},

preAggregations: {
main: {
external: true,
type: `originalSql`,
indexes: {
main: {
columns: ['_id']
},
// time: {
// columns: ['_created_at']
// }
}
}
}
});
```
![image (1)](https://github.com/cube-js/cube/assets/157453571/f7e79eae-7b6a-4645-aaff-6540ae209a60)

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.