{"record":{"id":"a851607bc232132c","repo":"wtfutil/wtf","slug":"we-didn-t-find-the-section-s","errorCode":null,"errorMessage":"we didn't find the section %s","messagePattern":"we didn't find the section (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/asana/client.go","lineNumber":251,"sourceCode":"func findSection(client *asana.Client, project *asana.Project, sectionName string) (string, error) {\n\tsectionId := \"\"\n\n\tsections, _, err := project.Sections(client, &asana.Options{\n\t\tLimit: 100,\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"error getting sections: %s\", err)\n\t}\n\n\tfor _, section := range sections {\n\t\tif section.Name == sectionName {\n\t\t\tsectionId = section.ID\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif sectionId == \"\" {\n\t\treturn \"\", fmt.Errorf(\"we didn't find the section %s\", sectionName)\n\t}\n\n\treturn sectionId, nil\n}\n\nfunc getTasksFromAsana(client *asana.Client, q *asana.TaskQuery) ([]*asana.Task, bool, error) {\n\tmoreTasks := false\n\n\ttasks, np, err := client.QueryTasks(q, &asana.Options{\n\t\tLimit: 100,\n\t\tFields: []string{\n\t\t\t\"assignee\",\n\t\t\t\"name\",\n\t\t\t\"num_subtasks\",\n\t\t\t\"due_on\",\n\t\t\t\"completed\",\n\t\t},\n\t})","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/asana/client.go#L233-L269","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["List the project's sections (GET /projects/<gid>/sections) and copy the exact section name into your config.","Check for case, whitespace, and emoji differences — matching is exact string equality.","If the section was renamed or deleted, update the config or recreate the section in Asana.","Optionally normalize names (TrimSpace + case-insensitive compare) before calling, or improve findSection to report available section names in the error."],"exampleFix":"// before\nif sectionId == \"\" {\n    return \"\", fmt.Errorf(\"we didn't find the section %s\", sectionName)\n}\n// after\nif sectionId == \"\" {\n    return \"\", fmt.Errorf(\"section %q not found in project %s; check exact name\", sectionName, project.ID)\n}","handlingStrategy":"validation","validationCode":"sections, _, err := project.Sections(client, &asana.Options{Limit: 100})\nif err != nil {\n    return err\n}\nnames := []string{}\nfor _, s := range sections {\n    names = append(names, s.Name)\n}\nif !slices.Contains(names, configuredSection) {\n    return fmt.Errorf(\"section %q not found; available: %v\", configuredSection, names)\n}","typeGuard":"func containsSection(sections []*asana.Section, name string) bool {\n    for _, s := range sections {\n        if strings.TrimSpace(s.Name) == strings.TrimSpace(name) {\n            return true\n        }\n    }\n    return false\n}","tryCatchPattern":"tasks, err := mod.Fetch(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"we didn't find the section\") {\n        log.Printf(\"configured section missing; re-list sections and update config: %v\", err)\n        return nil\n    }\n    return err\n}","preventionTips":["Copy section names verbatim from GET /projects/<gid>/sections into config.","Match with TrimSpace/case-insensitive comparison to absorb UI whitespace differences.","Re-validate section names whenever teammates may rename sections.","Fail fast at startup with the list of available sections rather than mid-run."],"tags":["asana","sections","config","not-found"],"backgroundTag":"asana-section-not-found","analyzedSha":"bb838c1ccb0f0f3223690df44afdec663d622881","analyzedAt":"2026-09-03T17:02:45.030Z","contentChangedAt":"2026-09-03T17:02:45.030Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}