livekit/livekit · error
unknown lat and lon for the current region
Error message
unknown lat and lon for the current region
What it means
ErrCurrentRegionUnknownLatLon is returned by selector.NewRegionAwareSelector when the current region has no config entry (currentRC == nil) while other regions are configured (regionaware.go:58). The selector builds a distance matrix between regions and needs the current region's latitude/longitude; if the current region is absent from the regions list, distances cannot be computed.
Source
Thrown at pkg/routing/selector/errors.go:22
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package selector
import "errors"
var (
ErrNoAvailableNodes = errors.New("could not find any available nodes")
ErrCurrentRegionNotSet = errors.New("current region cannot be blank")
ErrCurrentRegionUnknownLatLon = errors.New("unknown lat and lon for the current region")
ErrSortByNotSet = errors.New("sort by option cannot be blank")
ErrAlgorithmNotSet = errors.New("node selector algorithm option cannot be blank")
ErrSortByUnknown = errors.New("unknown sort by option")
ErrAlgorithmUnknown = errors.New("unknown node selector algorithm option")
)
View on GitHub (pinned to ee45c3f0b1)
Solutions
- Add the current region (with correct lat/lon) to the regions configuration so it has an entry
- Fix the region name typo/case mismatch between the node config and the regions list
- Redeploy/restart the node after updating the region configuration
Example fix
// before
regions := []config.RegionConfig{{Name: "us-east-1", Latitude: 39.1, Longitude: -77.3}}
sel, err := selector.NewRegionAwareSelector("us-west-2", regions, sortBy, algo) // unknown region
// after
regions := []config.RegionConfig{
{Name: "us-east-1", Latitude: 39.1, Longitude: -77.3},
{Name: "us-west-2", Latitude: 45.5, Longitude: -122.6},
}
sel, err := selector.NewRegionAwareSelector("us-west-2", regions, sortBy, algo) Defensive patterns
Strategy: validation
Validate before calling
var found bool
for _, rc := range regions {
if rc.Name == currentRegion {
found = true
break
}
}
if !found {
return nil, fmt.Errorf("region %q missing from regions config; add lat/lon entry", currentRegion)
} Prevention
- Ensure every node's region name exactly matches an entry in the shared regions config (watch case/typos)
- Add new regions to the shared config before deploying nodes there
- Keep region lat/lon data in version-controlled config
When it happens
Trigger: Calling NewRegionAwareSelector with a currentRegion name that does not appear in the provided []config.RegionConfig (no lat/lon entry), while len(regions) > 0.
Common situations: Typo in the node's region name so it doesn't match any entry in the regions config list; node deployed to a new region that wasn't added to the shared region map; regions list passed from stale config.
Related errors
- current region cannot be blank
- sort by option cannot be blank
- could not find any available nodes
- egress launcher not found
- unimplemented worker signal
AI-assisted analysis of livekit/livekit@ee45c3f0b1 (2026-09-02).
Data as JSON: /api/errors/7d410b3dadbd8335.
Report an issue: GitHub.