{"record":{"id":"17ff5157d26731b7","repo":"Eugeny/tabby","slug":"no-available-file-providers","errorCode":null,"errorMessage":"No available file providers","messagePattern":"No available file providers","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"tabby-core/src/services/fileProviders.service.ts","lineNumber":41,"sourceCode":"            try {\n                return await p.retrieveFile(key)\n            } catch {\n                continue\n            }\n        }\n        throw new Error('Not found')\n    }\n\n    async selectProvider (): Promise<FileProvider> {\n        const providers: FileProvider[] = []\n        await Promise.all(this.fileProviders.map(async p => {\n            if (await p.isAvailable()) {\n                providers.push(p)\n            }\n        }))\n        if (!providers.length) {\n            this.notifications.error(this.translate.instant('Vault master passphrase needs to be set to allow storing secrets'))\n            throw new Error('No available file providers')\n        }\n        if (providers.length === 1) {\n            return providers[0]\n        }\n        return this.selector.show(\n            this.translate.instant('Select file storage'),\n            providers.map(p => ({\n                name: p.name,\n                result: p,\n            })),\n        )\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":55,"githubUrl":"https://github.com/Eugeny/tabby/blob/14e2d60b9b6dee84a53c37f05eefeb803787de04/tabby-core/src/services/fileProviders.service.ts#L23-L55","documentation":"Thrown by `FileProvidersService.selectProvider` when no registered FileProvider reports `isAvailable() === true`. Availability typically requires the vault to be enabled and unlocked (for VaultFileProvider) or the host to support native dialogs (ElectronFileProvider). The user is also shown a notification that the vault master passphrase must be set.","triggerScenarios":"Calling `selectAndStoreFile` while the vault is disabled/locked AND the electron file provider is unavailable (e.g. running outside Electron, or its dialog host missing). Every provider's `isAvailable()` returned false.","commonSituations":"First-run setup with no vault passphrase set; running in a non-Electron host (e.g. web/headless test) where no provider qualifies; vault disabled by the user but a feature still tries to store a secret (e.g. saving an SSH private key).","solutions":["Enable and unlock the vault: set a master passphrase via `VaultService.setEnabled(true, passphrase)` so VaultFileProvider becomes available.","If running in Electron, confirm the ElectronFileProvider is registered and its host window is initialized.","Before calling `selectAndStoreFile`, guard with a pre-check: ensure at least one provider is available and surface a setup prompt if not.","For headless/automated contexts, inject a custom FileProvider that satisfies `isAvailable()` and stores to a known location."],"exampleFix":"// before\nasync selectAndStoreFile (description: string): Promise<string> {\n    return this.selectProvider().then(p => p.selectAndStoreFile(description))\n}\n\n// after - pre-flight check with actionable guidance\nasync selectAndStoreFile (description: string): Promise<string> {\n    const available = (await Promise.all(this.fileProviders.map(p => p.isAvailable()))).some(Boolean)\n    if (!available && !this.vault.isEnabled()) {\n        await this.vault.setEnabled(true, await promptForPassphrase())\n    }\n    return this.selectProvider().then(p => p.selectAndStoreFile(description))\n}","handlingStrategy":"validation","validationCode":"async function ensureProviderAvailable (providers: FileProvider[], vault: VaultService): Promise<void> {\n    const anyAvailable = (await Promise.all(providers.map(p => p.isAvailable()))).some(Boolean)\n    if (!anyAvailable) {\n        if (!vault.isEnabled()) await vault.setEnabled(true, await promptForPassphrase())\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    return await fileProviders.selectAndStoreFile(description)\n} catch (e) {\n    if (e instanceof Error && e.message === 'No available file providers') {\n        await vault.setEnabled(true, await promptForPassphrase())\n        return await fileProviders.selectAndStoreFile(description)  // retry\n    }\n    throw e\n}","preventionTips":["Drive users through vault setup during onboarding so a provider is always available.","Pre-check availability in the UI before enabling 'store secret' buttons.","Register an always-available fallback FileProvider for headless/test environments.","Couple the vault-enable toggle with the UI affordances that depend on it."],"tags":["file-providers","vault","availability","setup","configuration"],"backgroundTag":null,"analyzedSha":"14e2d60b9b6dee84a53c37f05eefeb803787de04","analyzedAt":"2026-08-12T11:46:48.773Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}