I'm encountering a 'connect ETIMEDOUT' error in cubejs backend api
- 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']
// }
}
}
}
});
```

Contributor guide
Assessment
This issue has not been assessed yet.