Skip to content

fix: write startup errors to stderr - #14

Merged
cjellick merged 1 commit into
obot-platform:mainfrom
cjellick:startup-errors-to-stderr
Oct 6, 2026
Merged

cjellick merged 1 commit into
obot-platform:mainfrom
cjellick:startup-errors-to-stderr

Conversation

@cjellick

@cjellick cjellick commented Oct 6, 2026

Copy link
Copy Markdown
Member

Problem

main.py prints startup errors to stdout. nanobot reads the server's stdout as the MCP stdio channel, so it can't parse the message as JSON-RPC and drops it. All that shows up in the pod log is:

level=ERROR msg="failed to unmarshal message" error="invalid character 'E' looking for beginning of value"

That's what the WordPress server on our main environment is logging right now, after #13. Its config is missing the WORDPRESS_* values, but the log doesn't say so.

Fix

Print the startup error and the shutdown message to stderr. nanobot already forwards the server's stderr to its own log as mcp stderr.

Testing

I ran the image with no WORDPRESS_* env (the same situation as main) and sent initialize and tools/list:

  • Before: failed to unmarshal message: invalid character 'E' …
  • After: msg="mcp stderr" … line="Error starting WordPress MCP Server: Required environment variable WORDPRESS_SITE is not set"

nanobot reads the server's stdout as the MCP stdio channel, so the
startup error printed there was dropped as an unparseable message and
logged only as: failed to unmarshal message: invalid character 'E'.
On stderr, nanobot logs the actual error.
@cjellick
cjellick requested a review from calvinmclean October 6, 2026 17:05
@cjellick
cjellick merged commit 38579e1 into obot-platform:main Oct 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants