sipeed/picoclaw · error

pico_client initial connect

Error message

pico_client initial connect: %w

What it means

Returned by PicoClientChannel.Start when the first dial to the remote pico server fails. The underlying %w error carries the network/URL failure from c.dial(); the channel cancels its context and never enters the reconnectLoop, so a failed Start means the channel is fully down rather than merely disconnected.

Solutions

  1. Verify the pico server URL in the channel config is reachable (curl/nc the host and port)
  2. Check DNS resolution, firewall rules, and TLS certificates on the client host
  3. Inspect the wrapped error to distinguish DNS failure, connection refused, and TLS handshake errors
  4. Fix the connectivity issue and restart the channel so Start can dial again
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/channels/pico/client.go:57 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/9eb4d863612a3b49. Report an issue: GitHub.

Appendix: source

Thrown at pkg/channels/pico/client.go:57

		return nil, fmt.Errorf("pico_client url is required")
	}

	base := channels.NewBaseChannel("pico_client", cfg, messageBus, bc.AllowFrom)

	return &PicoClientChannel{
		BaseChannel: base,
		config:      cfg,
	}, nil
}

// Start dials the remote server and begins reading.
func (c *PicoClientChannel) Start(ctx context.Context) error {
	logger.InfoC("pico_client", "Starting Pico Client channel")
	c.ctx, c.cancel = context.WithCancel(ctx)

	if err := c.dial(); err != nil {
		c.cancel()
		return fmt.Errorf("pico_client initial connect: %w", err)
	}

	c.SetRunning(true)
	go c.reconnectLoop()

	logger.InfoCF("pico_client", "Connected", map[string]any{"url": c.config.URL})
	return nil
}

// Stop closes the connection.
func (c *PicoClientChannel) Stop(ctx context.Context) error {
	logger.InfoC("pico_client", "Stopping Pico Client channel")
	c.SetRunning(false)
	if c.cancel != nil {
		c.cancel()
	}
	c.mu.Lock()
	if c.conn != nil {

View on GitHub (pinned to 49183d7e8d)