Repository navigation
Commit 5474409
authored
fix: AI Notebook CH connections need to send pw (#1792)
A user reported that they could not use the Notebooks feature due to a random clickhouse connection failure, pointing to a bad password. https://discord.com/channels/1149498480893640706/1149500035403350036/1473446917198315563
The reason it failed was because we weren't selecting the pw in `mongo` prior to using it in a direct `CH` connection.
Before the fix, the call in `getAIMetadata` omitted the `selectPassword` argument:
`const connection = await getConnectionById(source.team.toString(), connectionId); // connection.password === undefined`
So when the ClickhouseClient was constructed immediately after:
```
const clickhouseClient = new ClickhouseClient({ host: connection.host, username: connection.username, password: connection.password, });
```
`connection.password` was undefined, and the ClickHouse client connected with no password — hence the authentication failure.
The fix just adds `true` so the password is actually fetched from MongoDB and present in connection.password when the client is constructed.1 parent cd2b7a7 commit 5474409
2 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
0 commit comments