wtfutil/wtf · error

we didn't find the section %s

Error message

we didn't find the section %s

What it means

Returned by findSection after successfully listing a project's sections but finding none whose Name equals the requested sectionName. The match is an exact string comparison, so this error means the configured section does not exist under that name (or with that exact spelling) in the project.

Source

Thrown at modules/asana/client.go:251

func findSection(client *asana.Client, project *asana.Project, sectionName string) (string, error) {
	sectionId := ""

	sections, _, err := project.Sections(client, &asana.Options{
		Limit: 100,
	})
	if err != nil {
		return "", fmt.Errorf("error getting sections: %s", err)
	}

	for _, section := range sections {
		if section.Name == sectionName {
			sectionId = section.ID
			break
		}
	}

	if sectionId == "" {
		return "", fmt.Errorf("we didn't find the section %s", sectionName)
	}

	return sectionId, nil
}

func getTasksFromAsana(client *asana.Client, q *asana.TaskQuery) ([]*asana.Task, bool, error) {
	moreTasks := false

	tasks, np, err := client.QueryTasks(q, &asana.Options{
		Limit: 100,
		Fields: []string{
			"assignee",
			"name",
			"num_subtasks",
			"due_on",
			"completed",
		},
	})

View on GitHub (pinned to bb838c1ccb)

Solutions

  1. List the project's sections (GET /projects/<gid>/sections) and copy the exact section name into your config.
  2. Check for case, whitespace, and emoji differences — matching is exact string equality.
  3. If the section was renamed or deleted, update the config or recreate the section in Asana.
  4. Optionally normalize names (TrimSpace + case-insensitive compare) before calling, or improve findSection to report available section names in the error.

Example fix

// before
if sectionId == "" {
    return "", fmt.Errorf("we didn't find the section %s", sectionName)
}
// after
if sectionId == "" {
    return "", fmt.Errorf("section %q not found in project %s; check exact name", sectionName, project.ID)
}
Defensive patterns

Strategy: validation

Validate before calling

sections, _, err := project.Sections(client, &asana.Options{Limit: 100})
if err != nil {
    return err
}
names := []string{}
for _, s := range sections {
    names = append(names, s.Name)
}
if !slices.Contains(names, configuredSection) {
    return fmt.Errorf("section %q not found; available: %v", configuredSection, names)
}

Type guard

func containsSection(sections []*asana.Section, name string) bool {
    for _, s := range sections {
        if strings.TrimSpace(s.Name) == strings.TrimSpace(name) {
            return true
        }
    }
    return false
}

Try / catch

tasks, err := mod.Fetch(ctx)
if err != nil {
    if strings.Contains(err.Error(), "we didn't find the section") {
        log.Printf("configured section missing; re-list sections and update config: %v", err)
        return nil
    }
    return err
}

Prevention

When it happens

Trigger: fetchTasksFromProjectSections is given a section name that doesn't exactly match any section in the project: typo, different capitalization ('todo' vs 'To Do'), renamed section, trailing whitespace, or emoji/unicode differences in Asana section names.

Common situations: Asana sections renamed by teammates after the config was written; configs copied between projects where section names differ; localization of section names; invisible trailing spaces in the Asana UI.

Related errors


AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03). Data as JSON: /api/errors/a851607bc232132c. Report an issue: GitHub.