usebruno/bruno · error · Error

collection: ${dirPath} already exists

Error message

collection: ${dirPath} already exists

What it means

Error "collection: ${dirPath} already exists" thrown in usebruno/bruno.

Source

Thrown at packages/bruno-electron/src/ipc/collection.js:268

        const { size, filesCount } = await getCollectionStats(dirPath);
        persistedConfig.size = size;
        persistedConfig.filesCount = filesCount;

        mainWindow.webContents.send('main:collection-opened', dirPath, uid, persistedConfig);
        ipcMain.emit('main:collection-opened', mainWindow, dirPath, uid, persistedConfig);
      } catch (error) {
        return Promise.reject(error);
      }
    }
  );
  // clone collection
  ipcMain.handle(
    'renderer:clone-collection',
    async (event, collectionName, collectionFolderName, collectionLocation, previousPath) => {
      collectionFolderName = sanitizeName(collectionFolderName);
      const dirPath = path.join(collectionLocation, collectionFolderName);
      if (fs.existsSync(dirPath)) {
        throw new Error(`collection: ${dirPath} already exists`);
      }

      if (!validateName(path.basename(dirPath))) {
        throw new Error(`collection: invalid pathname - ${dirPath}`);
      }

      // create dir
      await createDirectory(dirPath);
      const uid = generateUidBasedOnHash(dirPath);
      const format = getCollectionFormat(previousPath);
      let brunoConfig;

      if (format === 'yml') {
        const configFilePath = path.join(previousPath, 'opencollection.yml');
        const content = fs.readFileSync(configFilePath, 'utf8');
        const {
          brunoConfig: parsedBrunoConfig,
          collectionRoot

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Pick a different collection directory path or name.
  2. Remove the existing directory if it is safe.

When it happens

Trigger: Thrown at packages/bruno-electron/src/ipc/collection.js:268 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/90f34a0ea0b247b2. Report an issue: GitHub.