{"record":{"id":"b971341407877360","repo":"slimtoolkit/slim","slug":"no-project-info","errorCode":null,"errorMessage":"no project info","messagePattern":"no project info","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/master/compose/execution.go","lineNumber":276,"sourceCode":"\t\t\tprojectConfig.Environment = map[string]string{}\n\t\t}\n\n\t\t//host env vars override explicit vars\n\t\tfor _, evar := range os.Environ() {\n\t\t\tparts := strings.SplitN(evar, \"=\", 2)\n\t\t\tif len(parts) == 2 {\n\t\t\t\tprojectConfig.Environment[parts[0]] = parts[1]\n\t\t\t}\n\t\t}\n\t}\n\n\tproject, err := loader.Load(projectConfig, withProjectName(projectName))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif project == nil {\n\t\treturn nil, fmt.Errorf(\"no project info\")\n\t}\n\n\tcv.Project = project\n\n\treturn cv, nil\n}\n\nfunc NewExecution(\n\txc *app.ExecutionContext,\n\tlogger *log.Entry,\n\tapiClient *dockerapi.Client,\n\tcomposeFiles []string,\n\tselectors *ServiceSelectors,\n\tprojectName string,\n\tworkingDir string,\n\tenvVars []string,\n\tenvironmentNoHost bool,\n\tcontainerProbeComposeSvc string,","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/master/compose/execution.go#L258-L294","documentation":"NewConfigInfo loads a compose project via compose-go's loader.Load(projectConfig, ...). If loading succeeds but returns a nil project (no project information), the function returns 'no project info'. This indicates the compose configuration could not yield a usable project object despite no hard load error.","triggerScenarios":"Calling NewExecution/NewConfigInfo with a projectConfig whose contents result in loader.Load returning (nil, nil) — e.g. an empty or effectively empty compose configuration, or a loader path that produced no project definition.","commonSituations":"Pointing the compose loader at a missing/empty docker-compose.yml, a config file with no services, or passing a serialized config blob that was never populated; also occurs when the project name resolution path returns an empty project.","solutions":["Verify the compose file path passed into the config actually exists and is non-empty and defines at least one service","Log/inspect the projectConfig passed to NewConfigInfo before calling it; ensure the loader config (working dir, config files) is populated","Update the compose-go loader library — older versions could return (nil, nil) on edge-case configs; a newer loader returns a proper error instead","Add an explicit nil check upstream so the caller surfaces which input produced the empty project"],"exampleFix":"// before\nloaderConfig := types.ConfigDetails{} // empty\nexe, err := compose.NewExecution(ctx, cli, name, workdir, loaderConfig, ...)\n// after\nloaderConfig := types.ConfigDetails{\n    WorkingDir: workdir,\n    ConfigFiles: []string{filepath.Join(workdir, \"docker-compose.yml\")},\n}\nexe, err := compose.NewExecution(ctx, cli, name, workdir, loaderConfig, ...)","handlingStrategy":"validation","validationCode":"func hasProjectInfo(cfg types.ConfigDetails) error {\n    if len(cfg.ConfigFiles) == 0 {\n        return fmt.Errorf(\"no compose config files provided\")\n    }\n    for _, f := range cfg.ConfigFiles {\n        fi, err := os.Stat(f)\n        if err != nil || fi.IsDir() {\n            return fmt.Errorf(\"compose config %q missing or not a file\", f)\n        }\n        data, _ := os.ReadFile(f)\n        if len(strings.TrimSpace(string(data))) == 0 {\n            return fmt.Errorf(\"compose config %q is empty\", f)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"cv, err := compose.NewConfigInfo(ctx, cli, name, workdir, cfgDetails, opts)\nif err != nil {\n    if strings.Contains(err.Error(), \"no project info\") {\n        return fmt.Errorf(\"compose config at %s produced an empty project: %w\", workdir, err)\n    }\n    return err\n}","preventionTips":["Always pass a valid working dir and at least one existing compose config file in ConfigDetails","Ensure the compose file defines at least one service","Validate the compose file with `docker compose config` before loading programmatically","Keep the compose-go loader up to date to avoid nil,nil returns on edge cases"],"tags":["compose","configuration","docker"],"backgroundTag":"empty-compose-project","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}