JuliusBrussee/caveman · error
postgres: %s must point to a regular file
Error message
postgres: %s must point to a regular file
What it means
Error "postgres: %s must point to a regular file" thrown in JuliusBrussee/caveman.
Source
Thrown at shared/platform/postgresconfig/postgresconfig.go:93
}
return config, nil
}
func caPEMFromEnvironment() (string, error) {
filePath := strings.TrimSpace(os.Getenv(caFileEnvironment))
direct := strings.TrimSpace(os.Getenv(caEnvironment))
if filePath != "" && direct != "" {
return "", fmt.Errorf("postgres: set only %s or %s, not both", caFileEnvironment, caEnvironment)
}
if filePath == "" {
return direct, nil
}
info, err := os.Stat(filePath)
if err != nil {
return "", fmt.Errorf("postgres: %s: %w", caFileEnvironment, err)
}
if !info.Mode().IsRegular() {
return "", fmt.Errorf("postgres: %s must point to a regular file", caFileEnvironment)
}
contents, err := os.ReadFile(filePath)
if err != nil {
return "", fmt.Errorf("postgres: read %s: %w", caFileEnvironment, err)
}
return strings.TrimSpace(string(contents)), nil
}
// NewPool constructs a pool from the hardened configuration.
func NewPool(ctx context.Context, databaseURL string) (*pgxpool.Pool, error) {
config, err := ParsePoolConfig(databaseURL)
if err != nil {
return nil, err
}
return pgxpool.NewWithConfig(ctx, config)
}
// NewRuntimePool constructs a pool and proves the connected login is aView on GitHub (pinned to 27d5a3981a)
Solutions
- Point the variable at a regular file.
When it happens
Trigger: Thrown at shared/platform/postgresconfig/postgresconfig.go:93 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/e4d46530a06e1ab3.
Report an issue: GitHub.