router-for-me/CLIProxyAPI · error

home plugin status client is unavailable

Error message

home plugin status client is unavailable

What it means

Error "home plugin status client is unavailable" thrown in router-for-me/CLIProxyAPI.

Solutions

  1. Ensure the home client is connected before querying plugin status.
  2. Initialize the plugin status client after home cluster discovery completes.

When it happens

Trigger: Thrown at internal/home/plugin_status.go:24 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15). Data as JSON: /api/errors/a7a39315edb7b64c. Report an issue: GitHub.

Appendix: source

Thrown at internal/home/plugin_status.go:24

	"fmt"
	"strings"
	"time"

	"github.com/router-for-me/CLIProxyAPI/v7/internal/homeplugins"
)

const pluginStatusReportTimeout = 10 * time.Second

// PluginStatusClient defines the interface for pushing plugin status reports.
type PluginStatusClient interface {
	RPushPluginStatus(ctx context.Context, payload []byte) error
}

// ReportPluginStatus marshals the given report, sets NodeID and UpdatedAt,
// and pushes it to the provided client with a timeout.
func ReportPluginStatus(ctx context.Context, client PluginStatusClient, nodeID string, report homeplugins.SyncReport) error {
	if client == nil {
		return fmt.Errorf("home plugin status client is unavailable")
	}
	nodeID = strings.TrimSpace(nodeID)
	if nodeID == "" {
		return fmt.Errorf("home plugin status node id is empty")
	}
	report.NodeID = nodeID
	report.UpdatedAt = time.Now().UTC()
	raw, errMarshal := json.Marshal(report)
	if errMarshal != nil {
		return errMarshal
	}
	if ctx == nil {
		ctx = context.Background()
	}
	reportCtx, cancel := context.WithTimeout(ctx, pluginStatusReportTimeout)
	defer cancel()
	return client.RPushPluginStatus(reportCtx, raw)
}

View on GitHub (pinned to 78f0c4079e)