Billionmail/BillionMail · error

error getting knowledge base list: %v

Error message

error getting knowledge base list: %v

What it means

After successfully loading the project config, GetBaseInfo calls GetKnowledgeBaseList(Domain) to populate the KnowledgeBase field. If that call fails (directory listing error, unreadable knowledge JSON files), the error is wrapped as 'error getting knowledge base list: %v'. The whole GetBaseInfo call returns empty, so a knowledge-base storage problem blocks base-info retrieval even though the config itself was fine.

Source

Thrown at core/internal/service/askai/project.go:208

	// Return only the base information
	baseInfo := ProjectConfig{
		Domain:        config.Domain,
		Urls:          config.Urls,
		ProjectName:   config.ProjectName,
		Description:   config.Description,
		Industry:      config.Industry,
		PrimaryLogo:   config.PrimaryLogo,
		SecondaryLogo: config.SecondaryLogo,
		Favicon:       config.Favicon,
		UpdateTime:    config.UpdateTime,
		Status:        config.Status,
	}

	// Get the knowledge base list
	// This will populate the KnowledgeBase field in the baseInfo struct.
	baseInfo.KnowledgeBase, err = GetKnowledgeBaseList(Domain)
	if err != nil {
		return ProjectConfig{}, fmt.Errorf("error getting knowledge base list: %v", err)
	}

	return baseInfo, nil
}

// GetProjectStatus retrieves the status of a project configuration based on the provided domain.
// It reads the project configuration and returns a boolean indicating whether the project is active or not.
func GetProjectStatus(Domain string) (bool, bool, error) {
	config, err := ReadProjectConfig(Domain)
	if err != nil {
		return false, false, nil
	}

	// Return the project status
	return config.Status, true, nil
}

// SetProjectStatus updates the status of a project configuration based on the provided domain.

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Check the domain's PRODUCT_CONFIG_PATH/<domain>/knowledge/ directory exists and is readable
  2. Validate each knowledge *.json file parses; remove or repair corrupt files
  3. Call GetKnowledgeBaseList directly with the same domain to see the unwrapped error
  4. Check disk space and directory permissions for the process user
  5. Recreate missing knowledge entries or tolerate an empty list in the caller

Example fix

// before
base, err := askai.GetBaseInfo(domain)
// after
base, err := askai.GetBaseInfo(domain)
if err != nil {
    var listErr error
    _, listErr = askai.GetKnowledgeBaseList(domain)
    log.Printf("base info failed; kb listing: %v", listErr)
    return err
}
Defensive patterns

Strategy: try-catch

Validate before calling

kbDir := fmt.Sprintf(PRODUCT_CONFIG_PATH+"/%s/knowledge", domain)
if fi, err := os.Stat(kbDir); err != nil || !fi.IsDir() {
    os.MkdirAll(kbDir, 0o755)
}

Type guard

func knowledgeDirReadable(domain string) bool {
    f, err := os.Open(fmt.Sprintf(PRODUCT_CONFIG_PATH+"/%s/knowledge", domain))
    if err != nil { return false }
    f.Close()
    return true
}

Try / catch

base, err := askai.GetBaseInfo(domain)
if err != nil && strings.Contains(err.Error(), "knowledge base list") {
    base.KnowledgeBase = nil // degrade gracefully
} else if err != nil {
    return err
}

Prevention

When it happens

Trigger: GetBaseInfo(Domain) where GetKnowledgeBaseList fails: the domain's knowledge/ directory cannot be read, or one of the knowledge JSON files is unreadable/unparsable during listing.

Common situations: knowledge/ subdirectory deleted or never created with wrong permissions; a knowledge file truncated by a failed SaveKnowledgeBase; disk full preventing directory reads; domain path mismatch so listing targets a nonexistent directory.

Related errors


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/67060c0e849f525f. Report an issue: GitHub.