{"record":{"id":"9eb4d863612a3b49","repo":"sipeed/picoclaw","slug":"pico-client-initial-connect-w","errorCode":null,"errorMessage":"pico_client initial connect: %w","messagePattern":"pico_client initial connect: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/pico/client.go","lineNumber":57,"sourceCode":"\t\treturn nil, fmt.Errorf(\"pico_client url is required\")\n\t}\n\n\tbase := channels.NewBaseChannel(\"pico_client\", cfg, messageBus, bc.AllowFrom)\n\n\treturn &PicoClientChannel{\n\t\tBaseChannel: base,\n\t\tconfig:      cfg,\n\t}, nil\n}\n\n// Start dials the remote server and begins reading.\nfunc (c *PicoClientChannel) Start(ctx context.Context) error {\n\tlogger.InfoC(\"pico_client\", \"Starting Pico Client channel\")\n\tc.ctx, c.cancel = context.WithCancel(ctx)\n\n\tif err := c.dial(); err != nil {\n\t\tc.cancel()\n\t\treturn fmt.Errorf(\"pico_client initial connect: %w\", err)\n\t}\n\n\tc.SetRunning(true)\n\tgo c.reconnectLoop()\n\n\tlogger.InfoCF(\"pico_client\", \"Connected\", map[string]any{\"url\": c.config.URL})\n\treturn nil\n}\n\n// Stop closes the connection.\nfunc (c *PicoClientChannel) Stop(ctx context.Context) error {\n\tlogger.InfoC(\"pico_client\", \"Stopping Pico Client channel\")\n\tc.SetRunning(false)\n\tif c.cancel != nil {\n\t\tc.cancel()\n\t}\n\tc.mu.Lock()\n\tif c.conn != nil {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/pico/client.go#L39-L75","documentation":"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.","triggerScenarios":"Thrown at pkg/channels/pico/client.go:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the pico server URL in the channel config is reachable (curl/nc the host and port)","Check DNS resolution, firewall rules, and TLS certificates on the client host","Inspect the wrapped error to distinguish DNS failure, connection refused, and TLS handshake errors","Fix the connectivity issue and restart the channel so Start can dial again"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}