eyaltoledano/claude-task-master · warning

Warning: Could not fetch tasks from ${failedTags.length} tag

Error message

Warning: Could not fetch tasks from ${failedTags.length} tag(s):

What it means

In list.command.ts getTasksFromAllTags, when listing tasks across all tags, individual tag fetches that throw are collected into failedTags instead of aborting. If any tags failed, this warning lists how many, followed by per-tag name/error lines. The command still returns tasks from the tags that succeeded.

Source

Thrown at apps/cli/src/commands/list.command.ts:434

				// Apply ready filter per-tag to respect tag-scoped dependencies
				// (task IDs may overlap between tags, so we must filter within each tag)
				const tasksToAdd: TaskWithTag[] = options.ready
					? (filterReadyTasks(enrichedTasks) as TaskWithTag[])
					: enrichedTasks;

				allTaggedTasks.push(...tasksToAdd);
			} catch (tagError: unknown) {
				const errorMessage =
					tagError instanceof Error ? tagError.message : String(tagError);
				failedTags.push({ name: tagName, error: errorMessage });
				continue; // Skip this tag but continue with others
			}
		}

		// Warn about failed tags
		if (failedTags.length > 0) {
			console.warn(
				chalk.yellow(
					`\nWarning: Could not fetch tasks from ${failedTags.length} tag(s):`
				)
			);
			failedTags.forEach(({ name, error }) => {
				console.warn(chalk.gray(`  ${name}: ${error}`));
			});
		}

		// If ALL tags failed, throw to surface the issue
		if (
			failedTags.length === tagsResult.tags.length &&
			tagsResult.tags.length > 0
		) {
			throw new Error(
				`Failed to fetch tasks from any tag. First error: ${failedTags[0].error}`
			);
		}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Inspect the per-tag error lines printed after this warning to identify the failing tag.
  2. Repair or restore the failing tag's data (re-create the tag, restore from backup, or fix JSON corruption).
  3. Run taskmaster's validation/repair flow or re-initialize the affected tag.
  4. Delete and recreate the broken tag if its tasks are recoverable or dispensable.
Defensive patterns

Strategy: validation

Validate before calling

// Before listing, sanity-check tag data files
import fs from 'fs';
for (const tag of tags) {
  const p = `.taskmaster/tasks/${tag}.json`;
  if (!fs.existsSync(p)) console.warn(`Tag data missing: ${tag}`);
  else { try { JSON.parse(fs.readFileSync(p, 'utf8')); } catch { console.warn(`Tag data corrupt: ${tag}`); } }
}

Try / catch

try {
  const result = await tmCore.tasks.getTasks({ tag });
} catch (err) {
  failedTags.push({ name: tag, error: err.message }); // mirror the CLI: skip and continue
}

Prevention

When it happens

Trigger: Calling getTasksFromAllTags when one or more tags' underlying storage/files fail to load or parse — e.g. corrupted tag data, missing tag file, or a storage error thrown by tmCore.tasks for a specific tag.

Common situations: Partially corrupted .taskmaster state after a crash; tags created by a different/newer version; filesystem permission issues on specific tag files; concurrent edits corrupting one tag's data.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/e495cdb819829006. Report an issue: GitHub.