{"record":{"id":"f1343792f86585fa","repo":"tailscale/tailscale","slug":"error-calculating-routes-w","errorCode":null,"errorMessage":"error calculating routes: %w","messagePattern":"error calculating routes: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/k8s-operator/sts.go","lineNumber":1078,"sourceCode":"func tailscaledConfig(stsC *tailscaleSTSConfig, loginUrl string, newAuthkey string, oldSecret *corev1.Secret, hostname string) (tailscaledConfigs, error) {\n\tconf := &ipn.ConfigVAlpha{\n\t\tVersion:             \"alpha0\",\n\t\tAcceptDNS:           \"false\",\n\t\tAcceptRoutes:        \"false\", // AcceptRoutes defaults to true\n\t\tLocked:              \"false\",\n\t\tHostname:            &hostname,\n\t\tNoStatefulFiltering: \"true\", // Explicitly enforce default value, see #14216\n\t\tAppConnector:        &ipn.AppConnectorPrefs{Advertise: false},\n\t}\n\n\tif stsC.LoginServer != \"\" {\n\t\tconf.ServerURL = &stsC.LoginServer\n\t}\n\n\tif stsC.Connector != nil {\n\t\troutes, err := netutil.CalcAdvertiseRoutes(stsC.Connector.routes, stsC.Connector.isExitNode)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error calculating routes: %w\", err)\n\t\t}\n\t\tconf.AdvertiseRoutes = routes\n\t\tif stsC.Connector.isAppConnector {\n\t\t\tconf.AppConnector.Advertise = true\n\t\t}\n\t}\n\tif shouldAcceptRoutes(stsC.ProxyClass) {\n\t\tconf.AcceptRoutes = \"true\"\n\t}\n\n\tif newAuthkey != \"\" {\n\t\tconf.AuthKey = &newAuthkey\n\t} else if !deviceAuthed(oldSecret) {\n\t\tkey, err := authKeyFromSecret(oldSecret)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error retrieving auth key from Secret: %w\", err)\n\t\t}\n\t\tconf.AuthKey = key","sourceCodeStart":1060,"sourceCodeEnd":1096,"githubUrl":"https://github.com/tailscale/tailscale/blob/cfe32b8be6a33f8e24fbc369cbfbf7c729d9e042/cmd/k8s-operator/sts.go#L1060-L1096","documentation":"Error \"error calculating routes: %w\" thrown in tailscale/tailscale.","triggerScenarios":"Thrown at cmd/k8s-operator/sts.go:1078 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-16T03:17:38.424Z"}