larksuite/cli · error

exec provider response missing id

Error message

exec provider response missing id %q

What it means

Fails when the exec provider's values map exists but contains no entry for the requested refID. The provider must return a value for every requested reference id; the missing key indicates the provider could not supply that secret without reporting an error.

Solutions

  1. Register the secret under the requested id in the provider, or correct the refID used in bindings
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/binding/secret_resolve_exec.go:227 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04). Data as JSON: /api/errors/b28845c74fd4650a. Report an issue: GitHub.

Appendix: source

Thrown at internal/binding/secret_resolve_exec.go:227

	if resp.ProtocolVersion != 1 {
		return "", fmt.Errorf("exec provider protocolVersion must be 1, got %d", resp.ProtocolVersion)
	}

	if refErr, ok := resp.Errors[refID]; ok {
		msg := refErr.Message
		if msg == "" {
			msg = "unknown error"
		}
		return "", fmt.Errorf("exec provider failed for id %q: %s", refID, msg)
	}

	if resp.Values == nil {
		return "", fmt.Errorf("exec provider response missing 'values'")
	}
	value, ok := resp.Values[refID]
	if !ok {
		return "", fmt.Errorf("exec provider response missing id %q", refID)
	}

	if str, ok := value.(string); ok {
		return str, nil
	}
	if !jsonOnly {
		data, err := json.Marshal(value)
		if err != nil {
			return "", fmt.Errorf("exec provider value for id %q is not JSON-serializable: %w", refID, err)
		}
		return string(data), nil
	}
	return "", fmt.Errorf("exec provider value for id %q is not a string", refID)
}

View on GitHub (pinned to 7fd6ef3c07)