ch-ui: Error: Connection failed (Invalid or missing ClickHouse credentials)
Environment
Docker
How did you encounter the bug?
Hi team,
I am able to access my DB with the clickhouse client without any problems, but I’m running into this error when opening ch-ui: Connection failed. Credentials have been cleared.
In the dev console, I can see this:
Invalid or missing ClickHouse credentials:
{
"customPath": "",
"password": "",
"requestTimeout": 30000,
"url": "",
"useAdvanced": false,
"username": ""
}
I double-checked that the VITE_CLICKHOUSE_URL, VITE_CLICKHOUSE_USER, and VITE_CLICKHOUSE_PASS in the docker-compose.yml file are correct.
While researching a solution, I saw that another user had the same problem but never got an answer: https://www.reddit.com/r/Clickhouse/comments/1hrt2z0/update_chui_opensource_clickhouse_query_interface/
Could you please help?
What did you expect?
I was expecting to be able to log in
Actual Result
I cannot log in
Browser
Safari
Browser Version
Version 18.4 (20621.1.15.11.8)
Version
REPOSITORY TAG IMAGE ID CREATED SIZE
ghcr.io/caioricciuti/ch-ui latest 81f1fb13fdee 6 days ago 193MB
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 26 (2 by maintainers)
Ideally, I’d have wanted some feedback from the participants pinged above to confirm that for Clickhouse Server images 23.8+ (unlike in the case of @Jaeminst) they wrongfully mounted(empty) the config directories.
That said, I’d say that we explored a lot of cases and the issue can be closed; if they come back with feedback later we can reopen the issue or they can refer to this issue when they open a new one. @caioricciuti
Thanks for your reply.
Still same error. Btw I was able to connect with small Vite project and Clickhouse js.
I’ve tested in my local environment, and it appears to be a CORS issue. The clickhouse-server docker image version 23.8 is blocked by CORS, but when using the latest image, no errors occur and everything works as expected. The recommended solution is to upgrade to a clickhouse-server latest version.
Hey all! I’ll take a look on this issue… special thanks to @condrove10 for the participation, this is awesome!
I think this requires a bit more investigation from @caioricciuti; I’m not able to reproduce your error using the latest image of the container, can you tell me if you use a fork of this repo and eventually the commit hash? @iankressin
I was able to trace it back to: https://github.com/caioricciuti/ch-ui/blob/87f54228edaf8e564a0f6c7203e78d47b2435bd4/src/store/index.ts#L96 => https://github.com/caioricciuti/ch-ui/blame/f48c94bb6e2865808f3c69d010dfb1da81a4ace0/src/store/index.ts#L175
If you’re unsure or you don’t have SSL enabled;
NetworktabCH-UIinstanceI replicated what I think it’s your use case; you should see the response status of the API call to the HTTP API endpoint of your Clickhouse instance. @iankressin
In case one container has to connect to another container that exposes a TCP/HTTP endpoint with TLS/SSL you have to add the Root CA to the CA store of the client container image:
This is how I’ve setup mine:
And have my Root CA in my client machine CA store:
I suppose you use some reverse proxy with SSL/TLS (like Traefik) ? @iankressin
In that case you have to add your CA to your store. For example on Linux(Ubuntu/Debian):
this way your browser adds to its store the certificate and you good to go! @mbUSC