Skip to content

Commit e0cb52c

Browse files
authored
fix: Use an unnamed region instead of erroring for DERP (#3810)
1 parent 5f0b137 commit e0cb52c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

coderd/workspaceagents.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,13 @@ func convertWorkspaceAgent(derpMap *tailcfg.DERPMap, coordinator *tailnet.Coordi
701701
}
702702
region, found := derpMap.Regions[regionID]
703703
if !found {
704-
return codersdk.WorkspaceAgent{}, xerrors.Errorf("region %d not found in derpmap", regionID)
704+
// It's possible that a workspace agent is using an old DERPMap
705+
// and reports regions that do not exist. If that's the case,
706+
// report the region as unknown!
707+
region = &tailcfg.DERPRegion{
708+
RegionID: regionID,
709+
RegionName: fmt.Sprintf("Unnamed %d", regionID),
710+
}
705711
}
706712
workspaceAgent.DERPLatency[region.RegionName] = codersdk.DERPRegion{
707713
Preferred: node.PreferredDERP == regionID,

0 commit comments

Comments
 (0)