Fission-AI/OpenSpec · error · StoreError

store_setup_path_not_directory

store_setup_path_not_directory

Error message

Store setup path is not a directory: ${storeRoot}

What it means

Thrown by prepareSetupPlan after pathKind reports the resolved setup target exists but is a file or other non-directory. A store root must be a directory (or missing, so it can be created), so an existing file at the path blocks setup.

Solutions

  1. Remove or rename the file occupying the setup path
  2. Choose a different --path that is or can become a directory
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/store/operations.ts:473 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/80e923a19886241e. Report an issue: GitHub.

Appendix: source

Thrown at src/core/store/operations.ts:473

    ...(origin ? { remote: origin } : {}),
  });
}

async function prepareSetupPlan(
  input: Pick<SetupStoreInput, 'id' | 'path' | 'allowInsideGitRepository' | 'remote'>
): Promise<StoreSetupPlan> {
  const id = validateStoreId(input.id ?? '');
  if (input.remote !== undefined && input.remote.length === 0) {
    throw new StoreError('Store remote must not be empty when provided.', 'store_remote_empty', {
      target: 'store.metadata',
      fix: 'Pass a clone URL: --remote <url>.',
    });
  }
  const storeRoot = resolveSetupRoot(id, input.path);
  const kind = await pathKind(storeRoot);

  if (kind === 'file' || kind === 'other') {
    throw new StoreError(
      `Store setup path is not a directory: ${storeRoot}`,
      'store_setup_path_not_directory',
      {
        target: 'store.root',
        fix: 'Choose an empty directory or an existing healthy OpenSpec root.',
      }
    );
  }

  // Stores may be Git-backed, but creating one inside an implementation
  // repo is almost always an accidental nested-repo setup.
  await assertSetupPathIsNotNestedInGitRepo(storeRoot, {
    allowInsideGitRepository: input.allowInsideGitRepository,
  });

  let metadata: Awaited<ReturnType<typeof readStoreMetadataForOperation>> = null;
  let backend: StoreGitBackendConfig | undefined;

View on GitHub (pinned to 6926ccb18a)