-
Notifications
You must be signed in to change notification settings - Fork 61
dbhub sometimes crashed when mcp client (dify, cursor) started to use it run SQL #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you please paste the screenshot showing how dbhub is configured in dify and which command triggers the crash? The log suggests the dbhub docker container started successfully. Other than that, the pasted log doesn't reveal any useful clue. |
I got exactly same error. The mcp server crashed and service stopped running. Here is the response from dify agent: I run dbhub like this: npx @bytebase/dbhub --readonly --transport sse --port 16605 --dsn "mysql://root:mypwd@127.0.0.1:3306/mydb" & and mcp server setting in dify: It was working perfectly for the past two days, and now all of a sudden I'm getting this error tonight. |
@zhengyi73 just to confirm the network topology:
You seem to have dbhub and mysql running on the same host. One possibility is dbhub somehow OOMed. How much memories that you have allocated for the host machine? "SELECT * FROM obs_order_info ORDER BY create_time DESC LIMIT 1", does this query works fine before and suddenly returns 500? I am trying to understand if it's the particular problem with this query.
|
Dify is self-hosted and running on same server with dbhub. MySQL is exposed to the server using Frp. The server has 256G memory, it is not very likely to run OOM. It has 4xA100, 40G each. I am using Qwen3 32B. It seems working fine now after rebooting. The following is the schema of obs_order_info, which has around 1000 rows. |
@zhengyi73 thanks for the info. Do you mean |
yes |
我在测试中也遇到同样的问题,容器报错如下: 页面在执行工具: {"mcp_sse_call_tool": "Error calling MCP Server tool: server_name - MCP Server connection failed: [Errno 111] Connection refused"} |
Same here when cursor starts using MCP via sse
|
Running dbhub in docker and use Dify to test the MCP. However the docker instance got corrupted in each test.
Could you please advise what may cause the error below? Thank you so much!
=====
Successfully connected to MySQL database
Using transport: sse
Transport source: command line argument
| __ | _ | | | | | |
| | | | |) | || |_ | |_
| | | | _ <| _ | | | | '_ \
| || | |) | | | | || | |_) |
|_/|/|| ||_,|_./
v0.4.0 - Universal Database MCP Server
Port source: command line argument
DBHub server listening at http://localhost:8080
Connect to MCP server at http://localhost:8080/sse
Client connected 608594b2-fe14-4c5c-a0e4-c482f093d279
Client Message 608594b2-fe14-4c5c-a0e4-c482f093d279
Client Message 608594b2-fe14-4c5c-a0e4-c482f093d279
Client Message 608594b2-fe14-4c5c-a0e4-c482f093d279
Client Disconnected 608594b2-fe14-4c5c-a0e4-c482f093d279
Client Message 608594b2-fe14-4c5c-a0e4-c482f093d279
file:///app/node_modules/.pnpm/@modelcontextprotocol+sdk@1.6.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js:53
throw new Error(message);
^
Error: SSE connection not established
at SSEServerTransport.handlePostMessage (file:///app/node_modules/.pnpm/@modelcontextprotocol+sdk@1.6.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sse.js:53:19)
at file:///app/dist/index.js:3257:25
at Layer.handle [as handle_request] (/app/node_modules/.pnpm/express@4.21.2/node_modules/express/lib/router/layer.js:95:5)
at next (/app/node_modules/.pnpm/express@4.21.2/node_modules/express/lib/router/route.js:149:13)
at Route.dispatch (/app/node_modules/.pnpm/express@4.21.2/node_modules/express/lib/router/route.js:119:3)
at Layer.handle [as handle_request] (/app/node_modules/.pnpm/express@4.21.2/node_modules/express/lib/router/layer.js:95:5)
at /app/node_modules/.pnpm/express@4.21.2/node_modules/express/lib/router/index.js:284:15
at Function.process_params (/app/node_modules/.pnpm/express@4.21.2/node_modules/express/lib/router/index.js:346:12)
at next (/app/node_modules/.pnpm/express@4.21.2/node_modules/express/lib/router/index.js:280:10)
at expressInit (/app/node_modules/.pnpm/express@4.21.2/node_modules/express/lib/middleware/init.js:40:5)
Node.js v22.15.0
The text was updated successfully, but these errors were encountered: