{"record":{"id":"88fe569cbe9755db","repo":"glanceapp/glance","slug":"creating-application-w","errorCode":null,"errorMessage":"creating application: %w","messagePattern":"creating application: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/main.go","lineNumber":170,"sourceCode":"\tconfigContents, configIncludes, err := parseYAMLIncludes(configPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parsing config: %w\", err)\n\t}\n\n\tstopWatching, err := configFilesWatcher(configPath, configContents, configIncludes, onChange, onErr)\n\tif err == nil {\n\t\tdefer stopWatching()\n\t} else {\n\t\tlog.Printf(\"Error starting file watcher, config file changes will require a manual restart. (%v)\", err)\n\n\t\tconfig, err := newConfigFromYAML(configContents)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"validating config file: %w\", err)\n\t\t}\n\n\t\tapp, err := newApplication(config)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating application: %w\", err)\n\t\t}\n\n\t\tstartServer, _ := app.server()\n\t\tif err := startServer(); err != nil {\n\t\t\treturn fmt.Errorf(\"starting server: %w\", err)\n\t\t}\n\t}\n\n\t<-exitChannel\n\treturn nil\n}\n\nfunc serveUpdateNoticeIfConfigLocationNotMigrated(configPath string) bool {\n\tif !isRunningInsideDockerContainer() {\n\t\treturn false\n\t}\n\n\tif _, err := os.Stat(configPath); err == nil {","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/main.go#L152-L188","documentation":"Startup error wrapping any failure from newApplication(config) in the watcher-less fallback path. This aggregates all application initialization errors: auth setup (secret key, password hashing), theme compilation, page slug validation, widget provider init, and manifest rendering — the chained %w identifies which one.","triggerScenarios":"Any of the glance.go init errors occurring while the file watcher failed to start: bad auth.secret-key, >72-byte passwords, invalid theme colors, reserved page slugs, or manifest template failures.","commonSituations":"Restricted runtime (no inotify) plus a config that trips one of the init validations; first launch of a newly written config where several issues coexist and the first fatal one surfaces here.","solutions":["Read the chained error — it names the init step (auth/theme/pages) and cause","Fix that specific issue using its targeted guidance (secret key format, theme colors, page slugs)","Re-run until newApplication completes; validate config before deploying to watcher-restricted environments"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"null // no single pre-check; instead pre-run the targeted validations (secret key, passwords, theme, slugs) documented for errors 65-73","typeGuard":null,"tryCatchPattern":"Single top-level catch around newApplication that unwraps and dispatches on the init-step prefix (auth/theme/pages/manifest) to the matching fix guidance; exit non-zero.","preventionTips":["Run full config validation before deploying to watcher-restricted hosts","Fix init errors in the order reported; each fix reveals the next","Maintain a staging glance instance to shake out config errors"],"tags":["startup","config","orchestration"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}