{"record":{"id":"1b2a7fa612a08805","repo":"yudai/gotty","slug":"failed-to-create-webtty","errorCode":null,"errorMessage":"failed to create webtty","messagePattern":"failed to create webtty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/handlers.go","lineNumber":163,"sourceCode":"\tif server.options.PermitWrite {\n\t\topts = append(opts, webtty.WithPermitWrite())\n\t}\n\tif server.options.EnableReconnect {\n\t\topts = append(opts, webtty.WithReconnect(server.options.ReconnectTime))\n\t}\n\tif server.options.Width > 0 {\n\t\topts = append(opts, webtty.WithFixedColumns(server.options.Width))\n\t}\n\tif server.options.Height > 0 {\n\t\topts = append(opts, webtty.WithFixedRows(server.options.Height))\n\t}\n\tif server.options.Preferences != nil {\n\t\topts = append(opts, webtty.WithMasterPreferences(server.options.Preferences))\n\t}\n\n\ttty, err := webtty.New(&wsWrapper{conn}, slave, opts...)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to create webtty\")\n\t}\n\n\terr = tty.Run(ctx)\n\n\treturn err\n}\n\nfunc (server *Server) handleIndex(w http.ResponseWriter, r *http.Request) {\n\ttitleVars := server.titleVariables(\n\t\t[]string{\"server\", \"master\"},\n\t\tmap[string]map[string]interface{}{\n\t\t\t\"server\": server.options.TitleVariables,\n\t\t\t\"master\": map[string]interface{}{\n\t\t\t\t\"remote_addr\": r.RemoteAddr,\n\t\t\t},\n\t\t},\n\t)\n","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/yudai/gotty/blob/a080c85cbc59226c94c6941ad8c395232d72d517/server/handlers.go#L145-L181","documentation":"Wrapped error from webtty.New: one of the functional options passed when constructing the terminal session (preferences marshaling, title, reconnect, etc.) rejected the configuration, so the WebTTY instance could not be built for this connection.","triggerScenarios":"Thrown at server/handlers.go:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped option error to find which With* option failed","Validate Preferences JSON-marshals at config load time rather than per-connection","Log the option name and offending value to pinpoint misconfiguration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a080c85cbc59226c94c6941ad8c395232d72d517","analyzedAt":"2026-09-02T16:42:38.150Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}