Billionmail/BillionMail · error
error creating project configuration: %v
Error message
error creating project configuration: %v
What it means
Create() builds the default ProjectConfig and delegates persistence to SaveProjectConfig; if that save fails (marshal or write error), Create wraps the cause as 'error creating project configuration', so this error always masks an underlying SaveProjectConfig failure.
Source
Thrown at core/internal/service/askai/project.go:176
}
}
var config ProjectConfig = ProjectConfig{
Domain: Domain,
Urls: urls,
ProjectName: "",
Description: "",
Industry: "",
PrimaryLogo: "",
SecondaryLogo: "",
Favicon: "",
Status: true, // Default status is active
KnowledgeBase: []KnowledgeInfo{},
}
err := SaveProjectConfig(Domain, config)
if err != nil {
return fmt.Errorf("error creating project configuration: %v", err)
}
return nil
}
// GetBaseInfo retrieves the base information of a project configuration based on the provided domain.
// It reads the project configuration and returns a ProjectConfig struct containing only the base information.
func GetBaseInfo(Domain string) (ProjectConfig, error) {
config, err := ReadProjectConfig(Domain)
if err != nil {
return ProjectConfig{}, fmt.Errorf("error reading project configuration: %v", err)
}
// Return only the base information
baseInfo := ProjectConfig{
Domain: config.Domain,
Urls: config.Urls,
ProjectName: config.ProjectName,View on GitHub (pinned to fc36c76c05)
Solutions
- Inspect the wrapped inner error text to find the root cause (write vs marshal)
- Fix filesystem permissions/disk space for PRODUCT_CONFIG_PATH before retrying Create
- Ensure the project config directory exists and is writable (check MkdirAll handling)
- Validate that Domain has no illegal path characters that could break the target path
Example fix
// before
if err := askai.Create(domain, urls); err != nil {
return err // opaque
}
// after
if err := askai.Create(domain, urls); err != nil {
log.Errorf("project create failed for %s: %v", domain, err) // wrapped cause inside
return fmt.Errorf("init project %s failed: %w", domain, err)
} Defensive patterns
Strategy: try-catch
Validate before calling
if len(urls) > 3 { return errors.New("max 3 URLs") }
if _, err := os.Stat(productConfigPath); err != nil {
os.MkdirAll(productConfigPath, 0o755)
} Try / catch
if err := askai.Create(domain, urls); err != nil {
var inner = err.Error()
switch {
case strings.Contains(inner, "writing"):
return fmt.Errorf("disk/permission problem creating project: %w", err)
case strings.Contains(inner, "marshalling"):
return fmt.Errorf("config data invalid: %w", err)
default:
return err
}
} Prevention
- Verify PRODUCT_CONFIG_PATH is writable before exposing project-creation endpoints
- Unwrap and log the inner SaveProjectConfig cause for actionable diagnostics
- Validate Domain strings (no path separators or illegal characters) before Create
- Add an integration test that creates and reads back a project on a temp config dir
When it happens
Trigger: Create(Domain, urls) where the underlying SaveProjectConfig fails — json.MarshalIndent error (136), os.WriteFile error (137, e.g. read-only volume or missing directory), or any filesystem fault.
Common situations: Read-only or full config volume during project setup; permission problems in containerized deployments; corrupted ProjectConfig with non-serializable fields; PRODUCT_CONFIG_PATH misconfigured.
Related errors
- project configuration file does not exist: %s
- error saving default footer config file: %v
- error saving footer config file: %v
- error saving default prompt config file: %v
- error reading prompt config file: %v
AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05).
Data as JSON: /api/errors/5e89e95803469572.
Report an issue: GitHub.