@ -8,15 +8,24 @@ import (
"runtime"
"time"
"tailscale.com/feature/buildfeatures"
"tailscale.com/version"
)
func condRegister ( f func ( ) * Warnable ) * Warnable {
if ! buildfeatures . HasHealth {
return nil
}
return f ( )
}
/ * *
This file contains definitions for the Warnables maintained within this ` health ` package .
* /
// updateAvailableWarnable is a Warnable that warns the user that an update is available.
var updateAvailableWarnable = Register ( & Warnable {
var updateAvailableWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "update-available" ,
Title : "Update available" ,
Severity : SeverityLow ,
@ -27,10 +36,12 @@ var updateAvailableWarnable = Register(&Warnable{
return fmt . Sprintf ( "An update from version %s to %s is available. Run `tailscale update` or `tailscale set --auto-update` to update now." , args [ ArgCurrentVersion ] , args [ ArgAvailableVersion ] )
}
} ,
}
} )
// securityUpdateAvailableWarnable is a Warnable that warns the user that an important security update is available.
var securityUpdateAvailableWarnable = Register ( & Warnable {
var securityUpdateAvailableWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "security-update-available" ,
Title : "Security update available" ,
Severity : SeverityMedium ,
@ -41,48 +52,58 @@ var securityUpdateAvailableWarnable = Register(&Warnable{
return fmt . Sprintf ( "A security update from version %s to %s is available. Run `tailscale update` or `tailscale set --auto-update` to update now." , args [ ArgCurrentVersion ] , args [ ArgAvailableVersion ] )
}
} ,
}
} )
// unstableWarnable is a Warnable that warns the user that they are using an unstable version of Tailscale
// so they won't be surprised by all the issues that may arise.
var unstableWarnable = Register ( & Warnable {
var unstableWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "is-using-unstable-version" ,
Title : "Using an unstable version" ,
Severity : SeverityLow ,
Text : StaticMessage ( "This is an unstable version of Tailscale meant for testing and development purposes. Please report any issues to Tailscale." ) ,
}
} )
// NetworkStatusWarnable is a Warnable that warns the user that the network is down.
var NetworkStatusWarnable = Register ( & Warnable {
var NetworkStatusWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "network-status" ,
Title : "Network down" ,
Severity : SeverityMedium ,
Text : StaticMessage ( "Tailscale cannot connect because the network is down. Check your Internet connection." ) ,
ImpactsConnectivity : true ,
TimeToVisible : 5 * time . Second ,
}
} )
// IPNStateWarnable is a Warnable that warns the user that Tailscale is stopped.
var IPNStateWarnable = Register ( & Warnable {
var IPNStateWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "wantrunning-false" ,
Title : "Tailscale off" ,
Severity : SeverityLow ,
Text : StaticMessage ( "Tailscale is stopped." ) ,
}
} )
// localLogWarnable is a Warnable that warns the user that the local log is misconfigured.
var localLogWarnable = Register ( & Warnable {
var localLogWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "local-log-config-error" ,
Title : "Local log misconfiguration" ,
Severity : SeverityLow ,
Text : func ( args Args ) string {
return fmt . Sprintf ( "The local log is misconfigured: %v" , args [ ArgError ] )
} ,
}
} )
// LoginStateWarnable is a Warnable that warns the user that they are logged out,
// and provides the last login error if available.
var LoginStateWarnable = Register ( & Warnable {
var LoginStateWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "login-state" ,
Title : "Logged out" ,
Severity : SeverityMedium ,
@ -94,10 +115,12 @@ var LoginStateWarnable = Register(&Warnable{
}
} ,
DependsOn : [ ] * Warnable { IPNStateWarnable } ,
}
} )
// notInMapPollWarnable is a Warnable that warns the user that we are using a stale network map.
var notInMapPollWarnable = Register ( & Warnable {
var notInMapPollWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "not-in-map-poll" ,
Title : "Out of sync" ,
Severity : SeverityMedium ,
@ -105,10 +128,12 @@ var notInMapPollWarnable = Register(&Warnable{
Text : StaticMessage ( "Unable to connect to the Tailscale coordination server to synchronize the state of your tailnet. Peer reachability might degrade over time." ) ,
// 8 minutes reflects a maximum maintenance window for the coordination server.
TimeToVisible : 8 * time . Minute ,
}
} )
// noDERPHomeWarnable is a Warnable that warns the user that Tailscale doesn't have a home DERP.
var noDERPHomeWarnable = Register ( & Warnable {
var noDERPHomeWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "no-derp-home" ,
Title : "No home relay server" ,
Severity : SeverityMedium ,
@ -116,10 +141,12 @@ var noDERPHomeWarnable = Register(&Warnable{
Text : StaticMessage ( "Tailscale could not connect to any relay server. Check your Internet connection." ) ,
ImpactsConnectivity : true ,
TimeToVisible : 10 * time . Second ,
}
} )
// noDERPConnectionWarnable is a Warnable that warns the user that Tailscale couldn't connect to a specific DERP server.
var noDERPConnectionWarnable = Register ( & Warnable {
var noDERPConnectionWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "no-derp-connection" ,
Title : "Relay server unavailable" ,
Severity : SeverityMedium ,
@ -143,11 +170,13 @@ var noDERPConnectionWarnable = Register(&Warnable{
} ,
ImpactsConnectivity : true ,
TimeToVisible : 10 * time . Second ,
}
} )
// derpTimeoutWarnable is a Warnable that warns the user that Tailscale hasn't
// heard from the home DERP region for a while.
var derpTimeoutWarnable = Register ( & Warnable {
var derpTimeoutWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "derp-timed-out" ,
Title : "Relay server timed out" ,
Severity : SeverityMedium ,
@ -163,10 +192,12 @@ var derpTimeoutWarnable = Register(&Warnable{
return fmt . Sprintf ( "Tailscale hasn't heard from the home relay server (region ID '%v') in %v. The server might be temporarily unavailable, or your Internet connection might be down." , args [ ArgDERPRegionID ] , args [ ArgDuration ] )
}
} ,
}
} )
// derpRegionErrorWarnable is a Warnable that warns the user that a DERP region is reporting an issue.
var derpRegionErrorWarnable = Register ( & Warnable {
var derpRegionErrorWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "derp-region-error" ,
Title : "Relay server error" ,
Severity : SeverityLow ,
@ -174,20 +205,24 @@ var derpRegionErrorWarnable = Register(&Warnable{
Text : func ( args Args ) string {
return fmt . Sprintf ( "The relay server #%v is reporting an issue: %v" , args [ ArgDERPRegionID ] , args [ ArgError ] )
} ,
}
} )
// noUDP4BindWarnable is a Warnable that warns the user that Tailscale couldn't listen for incoming UDP connections.
var noUDP4BindWarnable = Register ( & Warnable {
var noUDP4BindWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "no-udp4-bind" ,
Title : "NAT traversal setup failure" ,
Severity : SeverityMedium ,
DependsOn : [ ] * Warnable { NetworkStatusWarnable , IPNStateWarnable } ,
Text : StaticMessage ( "Tailscale couldn't listen for incoming UDP connections." ) ,
ImpactsConnectivity : true ,
}
} )
// mapResponseTimeoutWarnable is a Warnable that warns the user that Tailscale hasn't received a network map from the coordination server in a while.
var mapResponseTimeoutWarnable = Register ( & Warnable {
var mapResponseTimeoutWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "mapresponse-timeout" ,
Title : "Network map response timeout" ,
Severity : SeverityMedium ,
@ -195,10 +230,12 @@ var mapResponseTimeoutWarnable = Register(&Warnable{
Text : func ( args Args ) string {
return fmt . Sprintf ( "Tailscale hasn't received a network map from the coordination server in %s." , args [ ArgDuration ] )
} ,
}
} )
// tlsConnectionFailedWarnable is a Warnable that warns the user that Tailscale could not establish an encrypted connection with a server.
var tlsConnectionFailedWarnable = Register ( & Warnable {
var tlsConnectionFailedWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "tls-connection-failed" ,
Title : "Encrypted connection failed" ,
Severity : SeverityMedium ,
@ -206,36 +243,43 @@ var tlsConnectionFailedWarnable = Register(&Warnable{
Text : func ( args Args ) string {
return fmt . Sprintf ( "Tailscale could not establish an encrypted connection with '%q': %v" , args [ ArgServerName ] , args [ ArgError ] )
} ,
}
} )
// magicsockReceiveFuncWarnable is a Warnable that warns the user that one of the Magicsock functions is not running.
var magicsockReceiveFuncWarnable = Register ( & Warnable {
var magicsockReceiveFuncWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "magicsock-receive-func-error" ,
Title : "MagicSock function not running" ,
Severity : SeverityMedium ,
Text : func ( args Args ) string {
return fmt . Sprintf ( "The MagicSock function %s is not running. You might experience connectivity issues." , args [ ArgMagicsockFunctionName ] )
} ,
}
} )
// testWarnable is a Warnable that is used within this package for testing purposes only.
var testWarnable = Register ( & Warnable {
var testWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "test-warnable" ,
Title : "Test warnable" ,
Severity : SeverityLow ,
Text : func ( args Args ) string {
return args [ ArgError ]
} ,
}
} )
// applyDiskConfigWarnable is a Warnable that warns the user that there was an error applying the envknob config stored on disk.
var applyDiskConfigWarnable = Register ( & Warnable {
var applyDiskConfigWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "apply-disk-config" ,
Title : "Could not apply configuration" ,
Severity : SeverityMedium ,
Text : func ( args Args ) string {
return fmt . Sprintf ( "An error occurred applying the Tailscale envknob configuration stored on disk: %v" , args [ ArgError ] )
} ,
}
} )
// warmingUpWarnableDuration is the duration for which the warmingUpWarnable is reported by the backend after the user
@ -245,9 +289,11 @@ const warmingUpWarnableDuration = 5 * time.Second
// warmingUpWarnable is a Warnable that is reported by the backend when it is starting up, for a maximum time of
// warmingUpWarnableDuration. The GUIs use the presence of this Warnable to prevent showing any other warnings until
// the backend is fully started.
var warmingUpWarnable = Register ( & Warnable {
var warmingUpWarnable = condRegister ( func ( ) * Warnable {
return & Warnable {
Code : "warming-up" ,
Title : "Tailscale is starting" ,
Severity : SeverityLow ,
Text : StaticMessage ( "Tailscale is starting. Please wait." ) ,
}
} )