{"record":{"id":"0086008a163496b6","repo":"wavetermdev/waveterm","slug":"failed-to-parse-app-id-w","errorCode":null,"errorMessage":"failed to parse app id: %w","messagePattern":"failed to parse app id: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/buildercontroller/buildercontroller.go","lineNumber":196,"sourceCode":"\t\tbc.publishOutputLine(line, false)\n\t})\n\n\tbuildCtx, cancel := context.WithTimeout(context.Background(), 60*time.Second)\n\tgo func() {\n\t\tdefer cancel()\n\t\tdefer func() {\n\t\t\tpanichandler.PanicHandler(fmt.Sprintf(\"buildercontroller[%s].buildAndRun\", bc.builderId), recover())\n\t\t}()\n\t\tbc.buildAndRun(buildCtx, appId, builderEnv, nil)\n\t}()\n\n\treturn nil\n}\n\nfunc (bc *BuilderController) buildAndRun(ctx context.Context, appId string, builderEnv map[string]string, resultCh chan<- *BuildResult) {\n\tappNS, _, err := waveappstore.ParseAppId(appId)\n\tif err != nil {\n\t\tbc.handleBuildError(fmt.Errorf(\"failed to parse app id: %w\", err), resultCh)\n\t\treturn\n\t}\n\n\tappPath, err := waveappstore.GetAppDir(appId)\n\tif err != nil {\n\t\tbc.handleBuildError(fmt.Errorf(\"failed to get app directory: %w\", err), resultCh)\n\t\treturn\n\t}\n\n\tcachePath, err := GetBuilderAppExecutablePath(appPath)\n\tif err != nil {\n\t\tbc.handleBuildError(fmt.Errorf(\"failed to get builder executable path: %w\", err), resultCh)\n\t\treturn\n\t}\n\n\tnodePath := wavebase.GetWaveAppElectronExecPath()\n\tif nodePath == \"\" {\n\t\tbc.handleBuildError(fmt.Errorf(\"electron executable path not set\"), resultCh)","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/buildercontroller/buildercontroller.go#L178-L214","documentation":"The appId string supplied to BuilderController.buildAndRun could not be parsed by waveappstore.ParseAppId, so the app namespace could not be resolved. This aborts the build before any compilation happens and routes the error to handleBuildError.","triggerScenarios":"buildAndRun invoked (via RunBuild/anonymous caller) with a malformed appId that does not match the expected app-id format (e.g. missing namespace separator, empty, or containing invalid characters).","commonSituations":"Stale block metadata pointing at an app id from an older format; hand-edited config; caller passing a block id instead of an app id.","solutions":["Validate the appId format before calling the builder (namespace:name pattern)","Fix the block metadata/config carrying the bad appId","Reinstall/re-create the app to get a correctly formatted id","Check waveappstore.ParseAppId for the exact accepted format"],"exampleFix":"// before\nbc.buildAndRun(ctx, appId, env, resultCh)\n// after\nif _, _, err := waveappstore.ParseAppId(appId); err != nil {\n\tlog.Printf(\"invalid app id: %q\", appId)\n\treturn\n}\nbc.buildAndRun(ctx, appId, env, resultCh)","handlingStrategy":"validation","validationCode":"ns, name, err := waveappstore.ParseAppId(appId)\nif err != nil || ns == \"\" || name == \"\" {\n\t// reject before invoking the builder\n}","typeGuard":"func isValidAppId(appId string) bool {\n\t_, _, err := waveappstore.ParseAppId(appId)\n\treturn err == nil\n}","tryCatchPattern":"resCh := make(chan *BuildResult)\ngo bc.buildAndRun(ctx, appId, env, resCh)\nres := <-resCh\nif res != nil && res.Error != nil && strings.Contains(res.Error.Error(), \"failed to parse app id\") {\n\t// prompt user to fix app id\n}","preventionTips":["Validate app ids at config-load time","Keep metadata migrations current when the id format changes","Never pass block ids where app ids are expected"],"tags":["validation","app-id","builder"],"backgroundTag":"invalid-identifier-format","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}