[Diagnostic] NetBox MCP tools return JSON parsing error #120

Closed
opened 2026-01-23 20:56:20 +00:00 by lmiranda · 1 comment
Owner

Diagnostic Report

Generated: 2026-01-23T20:48:00Z
Command Tested: /cmdb-assistant:cmdb-device
Reporter: Claude Code via /debug-report

Summary

NetBox MCP tools (dcim_list_devices, dcim_list_sites) are failing with:

Error: Expecting value: line 8 column 1 (char 7)

Key Findings

  • NetBox API works via direct curl calls
  • NetBox container is healthy (Up 31 hours)
  • Credentials configured at ~/.config/claude/netbox.env
  • MCP server appears to have JSON parsing issue

Hypothesis

Python json.JSONDecodeError - MCP server receiving empty or non-JSON response. Possible causes:

  1. SSL/TLS verification failing (curl uses -k)
  2. MCP server connection timeout
  3. Response handling bug in netbox_client.py

Suggested Investigation

  1. Check mcp_server/netbox_client.py - _handle_response() method
  2. Check SSL verification settings in config.py
  3. Review MCP server logs

Workaround

Direct curl API calls worked - created devices, interfaces, IPs successfully.


Generated by /debug-report

## Diagnostic Report **Generated**: 2026-01-23T20:48:00Z **Command Tested**: `/cmdb-assistant:cmdb-device` **Reporter**: Claude Code via /debug-report ## Summary NetBox MCP tools (`dcim_list_devices`, `dcim_list_sites`) are failing with: ``` Error: Expecting value: line 8 column 1 (char 7) ``` ## Key Findings - NetBox API works via direct curl calls - NetBox container is healthy (Up 31 hours) - Credentials configured at `~/.config/claude/netbox.env` - MCP server appears to have JSON parsing issue ## Hypothesis Python `json.JSONDecodeError` - MCP server receiving empty or non-JSON response. Possible causes: 1. SSL/TLS verification failing (curl uses `-k`) 2. MCP server connection timeout 3. Response handling bug in `netbox_client.py` ## Suggested Investigation 1. Check `mcp_server/netbox_client.py` - `_handle_response()` method 2. Check SSL verification settings in `config.py` 3. Review MCP server logs ## Workaround Direct curl API calls worked - created devices, interfaces, IPs successfully. --- *Generated by /debug-report*
Author
Owner

Investigation Complete

Finding: Issue cannot be reproduced - NetBox MCP tools work correctly in current testing.

Root Cause Analysis:
The error "Expecting value: line 8 column 1 (char 7)" indicates the MCP server received an empty or near-empty response during that session. This was likely a transient issue caused by:

  • Network timeout during API call
  • MCP server startup race condition
  • Session-specific initialization issue

Fix Proposed: PR #121

Added diagnostic error handling to netbox_client.py that will:

  • Log HTTP status code when JSON parsing fails
  • Log response content length
  • Show preview of actual content received (first 200 bytes)
  • Provide more informative error message to user

This won't prevent transient issues but will provide much better diagnostic information if they recur.

Next Steps:

  1. Review and merge PR #121
  2. Run /debug-report if issue recurs to capture new diagnostic info
  3. Report back here with any new occurrences
## Investigation Complete **Finding:** Issue cannot be reproduced - NetBox MCP tools work correctly in current testing. **Root Cause Analysis:** The error `"Expecting value: line 8 column 1 (char 7)"` indicates the MCP server received an empty or near-empty response during that session. This was likely a transient issue caused by: - Network timeout during API call - MCP server startup race condition - Session-specific initialization issue **Fix Proposed:** PR #121 Added diagnostic error handling to `netbox_client.py` that will: - Log HTTP status code when JSON parsing fails - Log response content length - Show preview of actual content received (first 200 bytes) - Provide more informative error message to user This won't prevent transient issues but will provide much better diagnostic information if they recur. **Next Steps:** 1. Review and merge PR #121 2. Run `/debug-report` if issue recurs to capture new diagnostic info 3. Report back here with any new occurrences
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#120