{"record":{"id":"8f0d5942a1d150d6","repo":"sipeed/picoclaw","slug":"start-deltachat-rpc-server-s-w","errorCode":null,"errorMessage":"start deltachat-rpc-server (%s): %w","messagePattern":"start deltachat-rpc-server \\((.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/channels/deltachat/rpc.go","lineNumber":72,"sourceCode":"// startRPC spawns the RPC server with DC_ACCOUNTS_PATH pointing at dataDir and\n// begins the background read loop.\nfunc startRPC(serverPath, dataDir string) (*rpcClient, error) {\n\tcmd := exec.Command(serverPath)\n\tcmd.Env = append(cmd.Environ(), \"DC_ACCOUNTS_PATH=\"+dataDir)\n\n\tstdin, err := cmd.StdinPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"deltachat rpc stdin: %w\", err)\n\t}\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"deltachat rpc stdout: %w\", err)\n\t}\n\t// Let the server's logs flow to our stderr for easy diagnostics.\n\tcmd.Stderr = logWriter{}\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn nil, fmt.Errorf(\"start deltachat-rpc-server (%s): %w\", serverPath, err)\n\t}\n\n\tc := &rpcClient{\n\t\tcmd:     cmd,\n\t\tstdin:   stdin,\n\t\tstdout:  stdout,\n\t\tpending: make(map[uint64]chan rpcResponse),\n\t}\n\tgo c.readLoop()\n\treturn c, nil\n}\n\n// readLoop reads newline-delimited responses and dispatches them to waiters.\nfunc (c *rpcClient) readLoop() {\n\treader := bufio.NewReader(c.stdout)\n\tfor {\n\t\tline, err := reader.ReadBytes('\\n')\n\t\tif len(line) > 0 {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/rpc.go#L54-L90","documentation":"cmd.Start() failed for the already-resolved binary path: a fork/exec-level error, not a missing binary (that is caught earlier by resolveServerPath). Typical wrapped causes: permission denied (no execute bit), exec format error (wrong architecture or non-ELF file), or a noexec-mounted filesystem.","triggerScenarios":"exec.Command(serverPath).Start() errors: chmod +x never run on a downloaded release, ARM64 binary on x86_64 (or vice versa), a Mac binary on Linux, or the binary living on a volume mounted noexec.","commonSituations":"Manually downloaded GitHub release assets without chmod; cross-architecture deployment; /tmp or bind-mounted volumes mounted with noexec.","solutions":["chmod +x the binary and confirm with `ls -l`","Download the release matching the host architecture (uname -m)","If on a noexec mount, move the binary to a normal exec path (e.g. /usr/local/bin)","Or reinstall via cargo/package manager, which sets the exec bit correctly"],"exampleFix":"# before\ncurl -L -o /opt/dc/deltachat-rpc-server <release-url>\n# no execute bit -> start fails\n\n# after\ncurl -L -o /usr/local/bin/deltachat-rpc-server <release-url>\nchmod +x /usr/local/bin/deltachat-rpc-server","handlingStrategy":"validation","validationCode":"// Verify the binary is an executable regular file on an exec-allowed mount\nfunc executablePresent(p string) error {\n    info, err := os.Stat(p)\n    if err != nil {\n        return err\n    }\n    if info.IsDir() || info.Mode()&0111 == 0 {\n        return fmt.Errorf(\"%s is not executable (chmod +x)\", p)\n    }\n    return nil\n}","typeGuard":"func isExecFailure(err error) bool {\n    return errors.Is(err, fs.ErrPermission) ||\n        strings.Contains(err.Error(), \"exec format error\")\n}","tryCatchPattern":"if err := ch.Start(ctx); err != nil {\n    var pathErr *fs.PathError\n    if errors.As(err, &pathErr) || strings.Contains(err.Error(), \"exec format error\") {\n        // binary problem: chmod +x, correct architecture, or move off a noexec mount\n    }\n    return err\n}","preventionTips":["chmod +x release binaries in install scripts and verify with test -x","Download the release matching uname -m","Never place the binary on noexec-mounted volumes (/tmp, some bind mounts)"],"tags":["deltachat","installation","exec","os","go"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}