affaan-m/ECC · error · Error

Invalid installState identity: targetRoot must be a non-empt

Error message

Invalid installState identity: targetRoot must be a non-empty string

What it means

Generic guard inside normalizeInstallStateIdentity: identity.targetRoot exists but is not a non-empty string. targetRoot locates the installation on disk and must be a real path string.

Source

Thrown at scripts/lib/state-store/queries.js:362

      ? []
      : installState.operations,
    installedAt: installState.installedAt || new Date().toISOString(),
    sourceVersion: installState.sourceVersion ?? null,
  };
}

function normalizeInstallStateIdentity(identity) {
  if (!identity || typeof identity !== 'object') {
    throw new Error('Invalid installState identity: expected targetId and targetRoot');
  }

  const targetId = identity.targetId;
  const targetRoot = identity.targetRoot;
  if (typeof targetId !== 'string' || targetId.length === 0) {
    throw new Error('Invalid installState identity: targetId must be a non-empty string');
  }
  if (typeof targetRoot !== 'string' || targetRoot.length === 0) {
    throw new Error('Invalid installState identity: targetRoot must be a non-empty string');
  }

  return { targetId, targetRoot };
}

function normalizeGovernanceEventInput(governanceEvent) {
  return {
    id: governanceEvent.id,
    sessionId: governanceEvent.sessionId ?? null,
    eventType: governanceEvent.eventType,
    payload: governanceEvent.payload ?? null,
    resolvedAt: governanceEvent.resolvedAt ?? null,
    resolution: governanceEvent.resolution ?? null,
    createdAt: governanceEvent.createdAt || new Date().toISOString(),
  };
}

function normalizeWorkItemInput(workItem) {

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Provide a value that satisfies the validation: Invalid installState identity: targetRoot must be a non-empty string
  2. Check the calling command or configuration for the reported field and correct it, then retry.
  3. Run the command with --help to review the expected input shape and allowed values.

Example fix

Correct the invalid input so that the following holds: Invalid installState identity: targetRoot must be a non-empty string
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scripts/lib/state-store/queries.js:362 when the library encounters an invalid state.

Common situations: Raised when input validation fails because: Invalid installState identity: targetRoot must be a non-empty string. Typically caused by a missing, malformed, or out-of-range argument or configuration value.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/01ee6618ed9f4b1c. Report an issue: GitHub.