Skip to content

Commit 39d4fe5

Browse files
committed
Fix Sentry noise: rate-limit Steam API, fix headless browser launch, downgrade test logging
Three root causes for spurious Sentry errors: 1. Steam API 429/403: Zero rate limiting on Steam Store API calls meant a single search could fire 65+ unthrottled requests. Added 1 req/sec throttle matching Steam's undocumented limits. 2. Browser launch on headless Linux: Environment.UserInteractive returns true on headless Linux (it's Windows-centric). Now checks for DISPLAY or WAYLAND_DISPLAY before attempting to open a browser. 3. Download client test failures: All test/validation methods logged at Error level, triggering Sentry for expected scenarios (wrong creds, SSL mismatch, server down). Downgraded to Debug since the user gets the validation failure in the UI — these aren't bugs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2b454a7 commit 39d4fe5

File tree

13 files changed

+70
-26
lines changed

13 files changed

+70
-26
lines changed

src/NzbDrone.Core/Download/Clients/Aria2/Aria2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private ValidationFailure TestConnection()
250250
}
251251
catch (Exception ex)
252252
{
253-
_logger.Error(ex, "Failed to test Aria2");
253+
_logger.Debug(ex, "Failed to test Aria2");
254254

255255
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", "Aria2" } }))
256256
{

src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private ValidationFailure TestConnection()
287287
}
288288
catch (WebException ex)
289289
{
290-
_logger.Error(ex, "Unable to test connection");
290+
_logger.Debug(ex, "Unable to test connection");
291291
switch (ex.Status)
292292
{
293293
case WebExceptionStatus.ConnectFailure:
@@ -311,7 +311,7 @@ private ValidationFailure TestConnection()
311311
}
312312
catch (Exception ex)
313313
{
314-
_logger.Error(ex, "Failed to test connection");
314+
_logger.Debug(ex, "Failed to test connection");
315315

316316
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }))
317317
{

src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ protected ValidationFailure TestConnection()
372372
}
373373
catch (WebException ex)
374374
{
375-
_logger.Error(ex, "Unable to connect to Torrent Download Station");
375+
_logger.Debug(ex, "Unable to connect to Torrent Download Station");
376376

377377
if (ex.Status == WebExceptionStatus.ConnectFailure)
378378
{

src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ protected ValidationFailure TestConnection()
274274
}
275275
catch (WebException ex)
276276
{
277-
_logger.Error(ex, "Unable to connect to Usenet Download Station");
277+
_logger.Debug(ex, "Unable to connect to Usenet Download Station");
278278

279279
if (ex.Status == WebExceptionStatus.ConnectFailure)
280280
{

src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private ValidationFailure TestConnection()
172172
}
173173
catch (Exception ex)
174174
{
175-
_logger.Error(ex, "Unable to connect to NZBVortex");
175+
_logger.Debug(ex, "Unable to connect to NZBVortex");
176176

177177
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }))
178178
{
@@ -200,7 +200,7 @@ private ValidationFailure TestApiVersion()
200200
}
201201
catch (Exception ex)
202202
{
203-
_logger.Error(ex, "Unable to connect to NZBVortex");
203+
_logger.Debug(ex, "Unable to connect to NZBVortex");
204204
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }));
205205
}
206206

src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private ValidationFailure TestConnection()
293293
return new ValidationFailure("Username", _localizationService.GetLocalizedString("DownloadClientValidationAuthenticationFailure"));
294294
}
295295

296-
_logger.Error(ex, "Unable to connect to NZBGet");
296+
_logger.Debug(ex, "Unable to connect to NZBGet");
297297
return new ValidationFailure("Host",
298298
_localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect",
299299
new Dictionary<string, object> { { "clientName", Name } }));

src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,15 @@ private ValidationFailure TestConnection()
475475
}
476476
catch (DownloadClientAuthenticationException ex)
477477
{
478-
_logger.Error(ex, ex.Message);
478+
_logger.Debug(ex, ex.Message);
479479
return new NzbDroneValidationFailure("Username", _localizationService.GetLocalizedString("DownloadClientValidationAuthenticationFailure"))
480480
{
481481
DetailedDescription = _localizationService.GetLocalizedString("DownloadClientValidationAuthenticationFailureDetail", new Dictionary<string, object> { { "clientName", Name } })
482482
};
483483
}
484484
catch (WebException ex)
485485
{
486-
_logger.Error(ex, "Unable to connect to qBittorrent");
486+
_logger.Debug(ex, "Unable to connect to qBittorrent");
487487
if (ex.Status == WebExceptionStatus.ConnectFailure)
488488
{
489489
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }))
@@ -496,7 +496,7 @@ private ValidationFailure TestConnection()
496496
}
497497
catch (Exception ex)
498498
{
499-
_logger.Error(ex, "Unable to test qBittorrent");
499+
_logger.Debug(ex, "Unable to test qBittorrent");
500500

501501
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }))
502502
{
@@ -588,7 +588,7 @@ private ValidationFailure TestPrioritySupport()
588588
}
589589
catch (Exception ex)
590590
{
591-
_logger.Error(ex, "Failed to test qBittorrent");
591+
_logger.Debug(ex, "Failed to test qBittorrent");
592592
return new NzbDroneValidationFailure(string.Empty, _localizationService.GetLocalizedString("DownloadClientValidationUnknownException", new Dictionary<string, object> { { "exception", ex.Message } }));
593593
}
594594

@@ -603,7 +603,7 @@ private ValidationFailure TestGetTorrents()
603603
}
604604
catch (Exception ex)
605605
{
606-
_logger.Error(ex, "Failed to get torrents");
606+
_logger.Debug(ex, "Failed to get torrents");
607607
return new NzbDroneValidationFailure(string.Empty, _localizationService.GetLocalizedString("DownloadClientValidationTestTorrents", new Dictionary<string, object> { { "exceptionMessage", ex.Message } }));
608608
}
609609

src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ protected ValidationFailure TestConnection()
304304
}
305305
catch (Exception ex)
306306
{
307-
_logger.Error(ex, "Failed to test");
307+
_logger.Debug(ex, "Failed to test");
308308

309309
return new NzbDroneValidationFailure(string.Empty, _localizationService.GetLocalizedString("DownloadClientValidationUnknownException", new Dictionary<string, object> { { "exception", ex.Message } }));
310310
}

src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private ValidationFailure TestConnection()
265265
}
266266
catch (Exception ex)
267267
{
268-
_logger.Error(ex, "Failed to test rTorrent");
268+
_logger.Debug(ex, "Failed to test rTorrent");
269269

270270
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }))
271271
{

src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ private ValidationFailure TestConnection()
290290
}
291291
catch (WebException ex)
292292
{
293-
_logger.Error(ex, "Unable to connect to uTorrent");
293+
_logger.Debug(ex, "Unable to connect to uTorrent");
294294
if (ex.Status == WebExceptionStatus.ConnectFailure)
295295
{
296296
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }))
@@ -303,7 +303,7 @@ private ValidationFailure TestConnection()
303303
}
304304
catch (Exception ex)
305305
{
306-
_logger.Error(ex, "Failed to test uTorrent");
306+
_logger.Debug(ex, "Failed to test uTorrent");
307307

308308
return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }))
309309
{

0 commit comments

Comments
 (0)