eyaltoledano/claude-task-master · error · TaskMasterError
MISSING_CONFIGURATION
MISSING_CONFIGURATION
Error message
API storage not fully configured (${missing.join(', ') || 'credentials missing'}). Run: tm auth login, or set the missing field(s). What it means
StorageFactory.create throws a TaskMasterError with code MISSING_CONFIGURATION when storage type 'api' is requested but no API access token is configured and AuthManager has no valid session. API-backed storage cannot authenticate without either an explicit apiAccessToken or a logged-in session.
Source
Thrown at packages/tm-core/src/modules/storage/services/storage-factory.ts:73
const logger = getLogger('StorageFactory');
switch (storageType) {
case 'file':
logger.debug('📁 Using local file storage');
return StorageFactory.createFileStorage(projectPath, config);
case 'api':
if (!StorageFactory.isHamsterAvailable(config)) {
const missing: string[] = [];
if (!config.storage?.apiEndpoint) missing.push('apiEndpoint');
if (!config.storage?.apiAccessToken) missing.push('apiAccessToken');
// Check if authenticated via AuthManager
const authManager = AuthManager.getInstance();
const hasSession = await authManager.hasValidSession();
if (!hasSession) {
throw new TaskMasterError(
`API storage not fully configured (${missing.join(', ') || 'credentials missing'}). Run: tm auth login, or set the missing field(s).`,
ERROR_CODES.MISSING_CONFIGURATION,
{ storageType: 'api', missing }
);
}
// Use auth token from AuthManager
const accessToken = await authManager.getAccessToken();
if (accessToken) {
// Merge with existing storage config, ensuring required fields
const nextStorage: StorageSettings = {
...(config.storage as StorageSettings),
type: 'api',
apiAccessToken: accessToken,
apiEndpoint:
config.storage?.apiEndpoint ||
process.env.TM_BASE_DOMAIN ||
process.env.TM_PUBLIC_BASE_DOMAIN ||
'https://tryhamster.com/api'View on GitHub (pinned to c0c98d367c)
Solutions
- Run `tm auth login` to establish a valid session before creating API storage
- Set storage.apiAccessToken in the storage config to a valid token
- Fix the storage type in config if file storage was intended
- Verify the token/env var is present in CI (secret not injected)
Example fix
// before
const storage = await StorageFactory.createFromStorageConfig({ storageType: 'api' });
// after
const authManager = AuthManager.getInstance();
if (!await authManager.hasValidSession()) {
throw new Error('Run: tm auth login before using API storage');
}
const storage = await StorageFactory.createFromStorageConfig({ storageType: 'api' }); Defensive patterns
Strategy: validation
Validate before calling
const authManager = AuthManager.getInstance();
const hasSession = await authManager.hasValidSession();
const hasToken = Boolean(config.storage?.apiAccessToken);
if (!hasSession && !hasToken) {
throw new Error('API storage requires `tm auth login` or storage.apiAccessToken');
}
const storage = await StorageFactory.createFromStorageConfig(config); Try / catch
try {
const storage = await StorageFactory.createFromStorageConfig(config);
} catch (e) {
if (e instanceof TaskMasterError && e.code === ERROR_CODES.MISSING_CONFIGURATION) {
console.error('API storage not configured:', e.details?.missing);
console.error('Fix: run `tm auth login` or set storage.apiAccessToken');
}
throw e;
} Prevention
- Run `tm auth login` during environment/CI setup
- Prefer file storage unless API storage is explicitly required
- Inject apiAccessToken via CI secrets, not committed config
- Check session validity with AuthManager before constructing storage
When it happens
Trigger: Creating API storage via createFromStorageConfig when config.storage.apiAccessToken is unset AND AuthManager.hasValidSession() returns false — i.e. never ran `tm auth login` and no token in config/env.
Common situations: Fresh machine or CI environment without `tm auth login`; expired/invalidated session; misconfigured storage type set to 'api' when intending file storage; token field name typo in config.
Related errors
- AUTHENTICATION_ERROR
- Azure API key is required
- ${this.name} API key is required
- MFA_VERIFICATION_FAILED
- MCP Provider requires active MCP session
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/94a497cb7605ab68.
Report an issue: GitHub.