@@ -190,6 +190,14 @@ func (s *Service) actionPreparing(ctx context.Context) actionResult {
190190 s .scope .HetznerBareMetalHost .SetError (infrav1 .PermanentError , msg )
191191 return actionStop {}
192192 }
193+ if errors .Is (err , os .ErrDeadlineExceeded ) {
194+ // If the Hetzner API returns this, we just want to retry later:
195+ // Get "https://robot-ws.your-server.de/server/1234": net/http: TLS handshake timeout
196+ s .scope .Logger .Info ("GetBMServer timed out, will retry later" , "error" , err )
197+ return actionContinue {
198+ delay : 10 * time .Second ,
199+ }
200+ }
193201 return actionError {err : fmt .Errorf ("failed to get bare metal server: %w" , err )}
194202 }
195203
@@ -1413,6 +1421,14 @@ func (s *Service) actionImageInstallingFinished(ctx context.Context, sshClient s
14131421
14141422 // Update name in robot API
14151423 if _ , err := s .scope .RobotClient .SetBMServerName (s .scope .HetznerBareMetalHost .Spec .ServerID , s .scope .Hostname ()); err != nil {
1424+ if errors .Is (err , os .ErrDeadlineExceeded ) {
1425+ // If the Hetzner API returns this, we just want to retry later:
1426+ // Post "https://robot-ws.your-server.de/server/1234": net/http: TLS handshake timeout
1427+ s .scope .Logger .Info ("SetBMServerName timed out, will retry later" , "error" , err )
1428+ return actionContinue {
1429+ delay : 10 * time .Second ,
1430+ }
1431+ }
14161432 record .Warn (s .scope .HetznerBareMetalHost , "SetBMServerNameFailed" , err .Error ())
14171433 s .handleRobotRateLimitExceeded (err , "SetBMServerName" )
14181434 return actionError {err : fmt .Errorf ("failed to update name of host in robot API: %w" , err )}
0 commit comments