Failed Authentication #23

Closed
opened 2026-04-11 09:45:32 -07:00 by langestefan · 5 comments
langestefan commented 2026-04-11 09:45:32 -07:00 (Migrated from github.com)

When I try to connect to Kaimon from claude, I frequently get a 'needs authentication' status. Basically this:

Manage MCP servers
  2 servers

    User MCPs (/home/langestefan/.claude.json)
  ❯ kaimon · △ needs authentication

This definitely happens after every update, but I've also seen it at other times.

I do the authentication:

Kaimon MCP Server                                                                                                        │
│                                                                                                                          │
│ Status: △ needs authentication                                                                                           │
│ Auth: ✘ not authenticated                                                                                                │
│ URL: http://localhost:2828/mcp                                                                                           │
│ Config location: /home/langestefan/.claude.json                                                                          │
│                                                                                                                          │
│ ❯ 1. Authenticate                                                                                                        │
│   2. Disable                                         

Which then always errors with:

❯ /mcp                                                                                                                      
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Kaimon MCP Server                                                                                                        │
│                                                                                                                          │
│ Status: △ needs authentication                                                                                           │
│ Auth: ✘ not authenticated                                                                                                │
│ URL: http://localhost:2828/mcp                                                                                           │
│ Config location: /home/langestefan/.claude.json                                                                          │
│                                                                                                                          │
│ Error: SDK auth failed: HTTP 400: Invalid OAuth error response: ZodError: [                                              │
│   {                                                                                                                      │
│     "expected": "string",                                                                                                │
│     "code": "invalid_type",                                                                                              │
│     "path": [                                                                                                            │
│       "error"                                                                                                            │
│     ],                                                                                                                   │
│     "message": "Invalid input: expected string, received object"                                                         │
│   }                                                                                                                      │
│ ]. Raw body: {"error":{"code":-32600,"message":"Invalid Request - missing method field"},"id":0,"jsonrpc":"2.0"}         │
│                                                                                                                          │
│ ❯ 1. Authenticate                                                                                                        │
│   2. Disable                                                                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

The only way to get around this error is by disabling kaimon in claude, then re-enabling it.

When I try to connect to Kaimon from claude, I frequently get a 'needs authentication' status. Basically this: ``` Manage MCP servers 2 servers User MCPs (/home/langestefan/.claude.json) ❯ kaimon · △ needs authentication ``` This definitely happens after every update, but I've also seen it at other times. I do the authentication: ``` Kaimon MCP Server │ │ │ │ Status: △ needs authentication │ │ Auth: ✘ not authenticated │ │ URL: http://localhost:2828/mcp │ │ Config location: /home/langestefan/.claude.json │ │ │ │ ❯ 1. Authenticate │ │ 2. Disable ``` Which then always errors with: ``` ❯ /mcp ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Kaimon MCP Server │ │ │ │ Status: △ needs authentication │ │ Auth: ✘ not authenticated │ │ URL: http://localhost:2828/mcp │ │ Config location: /home/langestefan/.claude.json │ │ │ │ Error: SDK auth failed: HTTP 400: Invalid OAuth error response: ZodError: [ │ │ { │ │ "expected": "string", │ │ "code": "invalid_type", │ │ "path": [ │ │ "error" │ │ ], │ │ "message": "Invalid input: expected string, received object" │ │ } │ │ ]. Raw body: {"error":{"code":-32600,"message":"Invalid Request - missing method field"},"id":0,"jsonrpc":"2.0"} │ │ │ │ ❯ 1. Authenticate │ │ 2. Disable │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` The only way to get around this error is by disabling kaimon in claude, then re-enabling it.
langestefan commented 2026-04-11 10:10:36 -07:00 (Migrated from github.com)

There seems to be a deeper problem. It is constantly asking to authenticate and fails to spawn any sessions.

Kaimon MCP is connected and healthy — server is responsive, but there are currently 0 Julia sessions running.

  Want me to start a session for this project? I can run:

  start_session(project_path="/home/langestefan/Nextcloud/Projects/2026/DiffOpt.jl")

  That will spawn a Julia process, activate the DiffOpt.jl project, and run Pkg.instantiate so it's ready for iterative
  work. Let me know if you'd like me to proceed (the project needs to be on the allowed-projects list).

❯ yes                                                                                                                       

● kaimon - start_session (MCP)(project_path: "/home/langestefan/Nextcloud/Projects/2026/DiffOpt.jl")

  Read 1 file, listed 3 directories (ctrl+o to expand)     
                                                          
● The kaimon MCP server disconnected mid-call — all its session tools are gone and it's back to requiring re-authentication.
   That matches what the server log showed: the Julia subprocess spawned (PID=46337) then died, and it seems to have taken
  the MCP connection with it.                                                                                               
                                                                                                                            
  Status summary:                                                                                                           
  - Connectivity: Works (ping succeeded, server is healthy).                                                                
  - Project access: /home/langestefan/Nextcloud/Projects/2026/DiffOpt.jl is on the allowed-projects list and marked [ready].
  - Session startup: Fails. Kaimon reports Process died and references a log at ~/.cache/kaimon/sessions/DiffOpt.jl.log that
   doesn't actually exist (sessions dir is empty). The server log confirms multiple subprocess spawning (PID=...) entries   
  with no corresponding init success.                                                                                       
  - Side effect: The failed spawn appears to have knocked the MCP connection offline; the kaimon tools have now all         
  disappeared again.                                                                                                        
                                                                                                                            
  This isn't something I can debug from my side — the Julia subprocess is failing silently before it can write any log. A
  few things worth trying on your end:                                                                                      
                                                                                                                          
  1. Reconnect the MCP server (/mcp → reconnect kaimon), then we can retry.                                                 
  2. Check if there's a kaimon launcher log somewhere that captures stderr from the spawned Julia process —               
  ~/.cache/kaimon/server.log only shows subprocess spawning and nothing afterward.                                          
  3. Try starting a session manually the way kaimon does (if you know the command it runs) to see the actual Julia error —
  could be a Manifest issue, a dead juliaup symlink, or similar.                                                            
                                                                                                                          
  Want me to fall back to running Julia via Bash for now, or would you rather sort out the kaimon session issue first?      
                                                                                                                          
✻ Sautéed for 41s                                                                                                           
                                                                                                                          
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯   
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏵⏵ accept edits on (shift+tab to cycle)                                                                                 
There seems to be a deeper problem. It is constantly asking to authenticate and fails to spawn any sessions. ``` Kaimon MCP is connected and healthy — server is responsive, but there are currently 0 Julia sessions running. Want me to start a session for this project? I can run: start_session(project_path="/home/langestefan/Nextcloud/Projects/2026/DiffOpt.jl") That will spawn a Julia process, activate the DiffOpt.jl project, and run Pkg.instantiate so it's ready for iterative work. Let me know if you'd like me to proceed (the project needs to be on the allowed-projects list). ❯ yes ● kaimon - start_session (MCP)(project_path: "/home/langestefan/Nextcloud/Projects/2026/DiffOpt.jl") Read 1 file, listed 3 directories (ctrl+o to expand) ● The kaimon MCP server disconnected mid-call — all its session tools are gone and it's back to requiring re-authentication. That matches what the server log showed: the Julia subprocess spawned (PID=46337) then died, and it seems to have taken the MCP connection with it. Status summary: - Connectivity: Works (ping succeeded, server is healthy). - Project access: /home/langestefan/Nextcloud/Projects/2026/DiffOpt.jl is on the allowed-projects list and marked [ready]. - Session startup: Fails. Kaimon reports Process died and references a log at ~/.cache/kaimon/sessions/DiffOpt.jl.log that doesn't actually exist (sessions dir is empty). The server log confirms multiple subprocess spawning (PID=...) entries with no corresponding init success. - Side effect: The failed spawn appears to have knocked the MCP connection offline; the kaimon tools have now all disappeared again. This isn't something I can debug from my side — the Julia subprocess is failing silently before it can write any log. A few things worth trying on your end: 1. Reconnect the MCP server (/mcp → reconnect kaimon), then we can retry. 2. Check if there's a kaimon launcher log somewhere that captures stderr from the spawned Julia process — ~/.cache/kaimon/server.log only shows subprocess spawning and nothing afterward. 3. Try starting a session manually the way kaimon does (if you know the command it runs) to see the actual Julia error — could be a Manifest issue, a dead juliaup symlink, or similar. Want me to fall back to running Julia via Bash for now, or would you rather sort out the kaimon session issue first? ✻ Sautéed for 41s ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏵⏵ accept edits on (shift+tab to cycle) ```
langestefan commented 2026-04-11 10:12:52 -07:00 (Migrated from github.com)

Probably unrelated, but when I quite kaimon I always get a segfault:

langestefan@fedora:~/Nextcloud/Projects/2026/DiffOpt.jl$ kaimon

[40859] signal 11 (1): Segmentation fault
in expression starting at none:0

After some more testing. Something is breaking every new gate that attempts to start a connection. It then gets into a state where running code will always fail. The only thing that produces a working session is

kaimon - manage_repl (MCP)(command: "restart", session: "a07331c9")
Probably unrelated, but when I quite kaimon I always get a segfault: ``` langestefan@fedora:~/Nextcloud/Projects/2026/DiffOpt.jl$ kaimon [40859] signal 11 (1): Segmentation fault in expression starting at none:0 ``` After some more testing. Something is breaking every new gate that attempts to start a connection. It then gets into a state where running code will always fail. The only thing that produces a working session is ``` kaimon - manage_repl (MCP)(command: "restart", session: "a07331c9") ```
kahliburke commented 2026-04-12 08:35:04 -07:00 (Migrated from github.com)

@langestefan Thanks for the report. What version are you running and what authentication settings? What is in ~/.config/kaimon/config.json? Please make sure you're running the latest release, take a look at the package status for your project and the global environment, run ]status and ]app status.

@langestefan Thanks for the report. What version are you running and what authentication settings? What is in `~/.config/kaimon/config.json`? Please make sure you're running the latest release, take a look at the package status for your project and the global environment, run `]status` and `]app status`.
langestefan commented 2026-04-13 16:24:02 -07:00 (Migrated from github.com)

I did a fresh install and it was still broken.

But I found the problem! At one point I was playing around with Kaimon, and I dev'd a local version of it, that was stuck on an older version. Installing or updating Kaimon did not warn me about or update the old version I still had in my global env. Launching the Kaimon app also didn't warn me that the version of Kaimon I had installed was not compatible with the kaimon app. That's what led to all the garbled output, something must have been updated in the serialization.

So to sum up, user error. But I think it would be good to check that the version of Kaimon.jl that is installed is compatible with the kaimon app. I see it already does a check whether Kaimon.jl is installed at all, but it should probably also check whether the installed version is supported.

I did a fresh install and it was still broken. But I found the problem! At one point I was playing around with Kaimon, and I dev'd a local version of it, that was stuck on an older version. Installing or updating Kaimon did not warn me about or update the old version I still had in my global env. Launching the Kaimon app also didn't warn me that the version of Kaimon I had installed was not compatible with the kaimon app. That's what led to all the garbled output, something must have been updated in the serialization. So to sum up, user error. But I think it would be good to check that the version of Kaimon.jl that is installed is compatible with the kaimon app. I see it already does a check whether Kaimon.jl is installed at all, but it should probably also check whether the installed version is supported.
kahliburke commented 2026-04-14 20:02:51 -07:00 (Migrated from github.com)

@langestefan Ok, good to know, I don't consider it a 'user' error, I of course would like to handle all these edge cases. I do have some code that attempts to get things synced up between the app install and the package installed in the global env. But still room for improvement I see. These sorts of issues seem to me like one of Julia's rough edges, I feel like I frequently run into cases while developing packages where I forgot to remove some 'devved' package and check in the wrong path, or run into errors that boil down to run resolve, or instantiate, or remove the package and add again, or some variation on that theme.

A version compatibility check and error messaging is a good idea, I'll add it as a separate issue.

@langestefan Ok, good to know, I don't consider it a 'user' error, I of course would like to handle all these edge cases. I do have some code that attempts to get things synced up between the app install and the package installed in the global env. But still room for improvement I see. These sorts of issues seem to me like one of Julia's rough edges, I feel like I frequently run into cases while developing packages where I forgot to remove some 'devved' package and check in the wrong path, or run into errors that boil down to run resolve, or instantiate, or remove the package and add again, or some variation on that theme. A version compatibility check and error messaging is a good idea, I'll add it as a separate issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kahliburke/Kaimon.jl#23
No description provided.