sipeed/picoclaw · error

no media store available

Error message

no media store available

What it means

Guard at the top of WeComChannel.storeRemoteMedia: GetMediaStore returned nil, so there is nowhere to persist the downloaded WeCom media file. The function aborts before making any HTTP request; this is a wiring/configuration gap, not a network failure.

Solutions

  1. Configure a media store on the bot/channel so WeCom media can be persisted
  2. Verify the channel was constructed with media storage enabled
  3. If media persistence is intentionally off, disable media collection flows for WeCom
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/channels/wecom/media.go:281 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/b5be445472e75d37. Report an issue: GitHub.

Appendix: source

Thrown at pkg/channels/wecom/media.go:281

	if ext == "" && contentType != "" {
		if exts, err := mime.ExtensionsByType(contentType); err == nil && len(exts) > 0 {
			ext = strings.ToLower(exts[0])
		}
	}

	if filepath.Ext(filename) == "" && ext != "" {
		filename += ext
	}
	return filename, contentType
}

func (c *WeComChannel) storeRemoteMedia(
	ctx context.Context,
	scope, msgID, resourceURL, aesKey, fallbackExt string,
) (string, error) {
	store := c.GetMediaStore()
	if store == nil {
		return "", fmt.Errorf("no media store available")
	}

	req, err := http.NewRequestWithContext(ctx, http.MethodGet, resourceURL, nil)
	if err != nil {
		return "", fmt.Errorf("create request: %w", err)
	}
	resp, err := c.mediaClient.Do(req)
	if err != nil {
		return "", fmt.Errorf("download media: %w", err)
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return "", fmt.Errorf("download media returned HTTP %d", resp.StatusCode)
	}

	data, err := io.ReadAll(io.LimitReader(resp.Body, wecomOutboundMediaMaxBytes+1))
	if err != nil {
		return "", fmt.Errorf("read media: %w", err)

View on GitHub (pinned to 49183d7e8d)