ComposioHQ/composio · error · KeyringError

Invalid

Invalid

Error message

service must be a non-empty string

What it means

The cli-keyring Entry constructor rejects an empty service string. The service name identifies which credential namespace to use, so an empty value is invalid (KeyringError kind 'Invalid', param 'service').

Source

Thrown at ts/packages/cli-keyring/src/core/entry.ts:46

  readonly service: string;
  readonly user: string;
  readonly modifiers: EntryModifiers;

  /**
   * Override the store just for this entry (e.g. tests). When `null`,
   * the process-global default store is resolved on every call so that
   * `setDefaultStore` / `unsetDefaultStore` take effect immediately.
   */
  private readonly overrideStore: CredentialStore | null;

  constructor(
    service: string,
    user: string,
    modifiers: EntryModifiers = {},
    overrideStore: CredentialStore | null = null
  ) {
    if (service.length === 0) {
      throw new KeyringError({
        kind: 'Invalid',
        param: 'service',
        reason: 'service must be a non-empty string',
      });
    }
    if (user.length === 0) {
      throw new KeyringError({
        kind: 'Invalid',
        param: 'user',
        reason: 'user must be a non-empty string',
      });
    }
    this.service = service;
    this.user = user;
    this.modifiers = modifiers;
    this.overrideStore = overrideStore;
  }

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Pass a non-empty service identifier (e.g. 'composio-cli')
  2. Default empty config values to a concrete service name before constructing the Entry

Example fix

// before
new Entry(config.service ?? '', user);
// after
new Entry(config.service || 'composio-cli', user);
Defensive patterns

Strategy: validation

Validate before calling

if (!service) throw new TypeError('service required');
new Entry(service, user);

Type guard

const isNonEmpty = (s: unknown): s is string => typeof s === 'string' && s.length > 0;

Try / catch

catch (e) { if (e instanceof KeyringError && e.kind === 'Invalid') { /* fix inputs */ } else throw e; }

Prevention

When it happens

Trigger: Constructing new Entry('', user) or passing a service that is an empty string (e.g. from an unset config value).

Common situations: Defaulting a missing env/config variable to '' and passing it as the service name; refactors that drop the service constant.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/770ffc1177328c24. Report an issue: GitHub.