{"record":{"id":"403b83c785227a00","repo":"tailscale/tailscale","slug":"error-marshalling-tailscaled-config-w","errorCode":null,"errorMessage":"error marshalling tailscaled config: %w","messagePattern":"error marshalling tailscaled config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/k8s-operator/sts.go","lineNumber":448,"sourceCode":"\n\t\t\tauthKey, err = newAuthKey(ctx, tsClient, tags)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\tconfigs, err := tailscaledConfig(stsC, tsClient.LoginURL(), authKey, orig, hostname)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error creating tailscaled config: %w\", err)\n\t\t}\n\n\t\tlatest := tailcfg.CapabilityVersion(-1)\n\t\tvar latestConfig ipn.ConfigVAlpha\n\t\tfor key, val := range configs {\n\t\t\tfn := tsoperator.TailscaledConfigFileName(key)\n\t\t\tb, err := json.Marshal(val)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error marshalling tailscaled config: %w\", err)\n\t\t\t}\n\n\t\t\tmak.Set(&secret.StringData, fn, string(b))\n\t\t\tif key > latest {\n\t\t\t\tlatest = key\n\t\t\t\tlatestConfig = val\n\t\t\t}\n\t\t}\n\n\t\tif stsC.ServeConfig != nil {\n\t\t\tj, err := json.Marshal(stsC.ServeConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tmak.Set(&secret.StringData, \"serve-config\", string(j))\n\t\t}\n","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/tailscale/tailscale/blob/cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042/cmd/k8s-operator/sts.go#L430-L466","documentation":"Error \"error marshalling tailscaled config: %w\" thrown in tailscale/tailscale.","triggerScenarios":"Thrown at cmd/k8s-operator/sts.go:448 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042","analyzedAt":"2026-08-15T19:58:31.583Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}