1

Jenkins connection problems (error 500)

2018-11-20 19:44:01.9062 | WARN | 2018-11-20 19:42:50.8661 | INFO | EventLogger | 8 | {"e":"App.Running","p":{"Modules":1,"ModuleStats":[{"Type":"jenkins"}],"PollingPeriod":"00:01:00","UpTime":"00:01:00","ClientId":"b55065cb2d74410aa3a7fac4e879404d","Os":"Windows"}}
2018-11-20 19:43:50.3466 | INFO | EventLogger | 4 | {"e":"Jenkins.EditConnectionSettings","p":null}
2018-11-20 19:44:00.9994 | INFO | EventLogger | 14 | {"e":"Jenkins.UpdatingSettings","p":{"CredentialsType":"Anonymous"}}
2018-11-20 19:44:01.1144 | DEBUG | JenkinsAdapter | 14 | 50db | Configuring adapter for 'http://localhost:8080/jenkins'
2018-11-20 19:44:01.1517 | DEBUG | ConfigurationManager | 14 | Saving settings: Web.Services.ServerSettings
2018-11-20 19:44:01.2121 | INFO | EventLogger | 8 | {"e":"Builds.EditBuildSettings","p":{"ModuleType":"jenkins"}}
2018-11-20 19:44:01.2121 | DEBUG | ConfigurationManager | 19 | Web proxy not configured.
2018-11-20 19:44:01.8834 | INFO | EventLogger | 19 | {"e":"Builds.EditMonitoringSettings","p":{"ModuleType":"jenkins"}}
2018-11-20 19:44:01.8834 | DEBUG | ServerManager | 19 | 50db | Updating monitoring settings from server
2018-11-20 19:44:01.9062 | WARN | Asp.Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware | 19 | 0 An unhandled exception has occurred while executing the request System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 ().
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Web.Services.Jenkins.JenkinsAdapter.EnsureResponseSuccess(HttpResponseMessage response) in C:\build\1\_work\2\s\Desktop\LocalWeb\Services\Jenkins\JenkinsAdapter.cs:line 823
at Web.Services.Jenkins.JenkinsAdapter.ApiGet[T](String uri, JenkinsConnectionSettings settings) in C:\build\1\_work\2\s\Desktop\LocalWeb\Services\Jenkins\JenkinsAdapter.cs:line 809
at Web.Services.Jenkins.JenkinsAdapter.GetMetadata(CancellationToken cancellationToken) in C:\build\1\_work\2\s\Desktop\LocalWeb\Services\Jenkins\JenkinsAdapter.cs:line 93
at Web.Services.Builds.ServerAdapterPoller.UpdateServerMetadata() in C:\build\1\_work\2\s\Desktop\LocalWeb\Services\Builds\ServerAdapterPoller.cs:line 274
at Web.Services.Builds.ServerAdapterPoller.GetMetadata(CancellationToken cancellationToken) in C:\build\1\_work\2\s\Desktop\LocalWeb\Services\Builds\ServerAdapterPoller.cs:line 104
at Web.Services.ServerManager.UpdateMonitoringSettingsFromServer() in C:\build\1\_work\2\s\Desktop\LocalWeb\Services\ServerManager.cs:line 197
at Web.Services.ServerManager.GetMonitoringSettings() in C:\build\1\_work\2\s\Desktop\LocalWeb\Services\ServerManager.cs:line 188
at Web.Controllers.ServersController.GetMonitoringSettings(Guid instanceId) in C:\build\1\_work\2\s\Desktop\LocalWeb\Controllers\ServersController.cs:line 133
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context)
at Catlight.Service.Common.ApiErrorHandlingMiddleware.Invoke(HttpContext context) in C:\build\1\_work\2\s\Catlight.Service.Common\ApiErrorHandlingMiddleware.cs:line 49
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

1 reply

Jenkins returned HTTP 400 error code (bad request).

What version of Jenkins do you have?

To troubleshoot this further, you can go to edit menu / settings / advanced,  check "Enable extended logging", and try to add connection again. Jenkins response will be capture in a NetworkLog.txt file. It can contain a more detailed message from Jenkins about the cause of the problem.