Skip to content

Troubleshooting

Kod includes kod doctor for quick local diagnostics:

Terminal window
kod doctor

The command checks:

  • Git availability
  • Client configuration from ~/.kod/config.json
  • Data directory access
  • Repository directory access
  • SSH server configuration
  • HTTP server health
  • API token authentication

If any check fails, kod doctor exits with a non-zero status.

Install Git and confirm it is on your PATH:

Terminal window
git --version

Run kod init and enter the server URL and token:

Terminal window
kod init

You can also override the client configuration for one command:

Terminal window
kod --server https://git.example.com --token kod_your_token repo list

Check that the Kod server is running:

Terminal window
curl http://localhost:3000/health

For production, verify your reverse proxy forwards to the HTTP port configured with KOD_PORT or --port.

Create a new token or check that the existing token has the permissions required for the command:

Terminal window
kod token create alice --username alice --permissions repo:read,repo:write

For collaborator Git access, the token must have a username and that username must be added to the repository.

Data or Repository Directory Is Not Writable

Section titled “Data or Repository Directory Is Not Writable”

Check ownership and permissions for the configured directories:

Terminal window
ls -ld ~/.kod/data ~/.kod/repos

For systemd deployments, make sure the User= in the service can read and write the configured paths.

Confirm the server has SSH enabled and that the client uses the right port:

Terminal window
kod serve --ssh --ssh-port 2222
git clone ssh://[email protected]:2222/my-app.git

Then verify the collaborator setup:

Terminal window
kod repo my-app collaborator list
kod keys list

The SSH key must belong to a username that owns the repository or is listed as a collaborator. Anonymous SSH uses the anonymous username and is read-only.

Inspect delivery history:

Terminal window
kod repo my-app webhook deliveries <webhook-id>

Look at the response status, error, attempt count, and next retry timestamp. After fixing the receiver, retry a failed delivery:

Terminal window
kod repo my-app webhook retry <webhook-id> <delivery-id>