{"action":"created","issue":{"url":"https://api.github.com/repos/gocd/gocd/issues/1202","repository_url":"https://api.github.com/repos/gocd/gocd","labels_url":"https://api.github.com/repos/gocd/gocd/issues/1202/labels{/name}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/1202/comments","events_url":"https://api.github.com/repos/gocd/gocd/issues/1202/events","html_url":"https://github.com/gocd/gocd/issues/1202","id":86292123,"number":1202,"title":"Errors in logs, state change","user":{"login":"mlorenz","id":1653040,"avatar_url":"https://avatars.githubusercontent.com/u/1653040?v=3","gravatar_id":"","url":"https://api.github.com/users/mlorenz","html_url":"https://github.com/mlorenz","followers_url":"https://api.github.com/users/mlorenz/followers","following_url":"https://api.github.com/users/mlorenz/following{/other_user}","gists_url":"https://api.github.com/users/mlorenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mlorenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlorenz/subscriptions","organizations_url":"https://api.github.com/users/mlorenz/orgs","repos_url":"https://api.github.com/users/mlorenz/repos","events_url":"https://api.github.com/users/mlorenz/events{/privacy}","received_events_url":"https://api.github.com/users/mlorenz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/gocd/gocd/milestones/9","html_url":"https://github.com/gocd/gocd/milestones/Release:%20Unknown","labels_url":"https://api.github.com/repos/gocd/gocd/milestones/9/labels","id":1482708,"number":9,"title":"Release: Unknown","description":"These issues need interest from someone (for a contribution to this part of the code). They're unlikely to be picked up by the core team, at this point. Not that they're not important. They're just not prioritized for being picked up any time soon.","creator":{"login":"arvindsv","id":172235,"avatar_url":"https://avatars.githubusercontent.com/u/172235?v=3","gravatar_id":"","url":"https://api.github.com/users/arvindsv","html_url":"https://github.com/arvindsv","followers_url":"https://api.github.com/users/arvindsv/followers","following_url":"https://api.github.com/users/arvindsv/following{/other_user}","gists_url":"https://api.github.com/users/arvindsv/gists{/gist_id}","starred_url":"https://api.github.com/users/arvindsv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arvindsv/subscriptions","organizations_url":"https://api.github.com/users/arvindsv/orgs","repos_url":"https://api.github.com/users/arvindsv/repos","events_url":"https://api.github.com/users/arvindsv/events{/privacy}","received_events_url":"https://api.github.com/users/arvindsv/received_events","type":"User","site_admin":false},"open_issues":377,"closed_issues":110,"state":"open","created_at":"2016-01-04T16:20:50Z","updated_at":"2016-08-18T10:00:16Z","due_on":"2020-01-01T05:00:00Z","closed_at":null},"comments":15,"created_at":"2015-06-08T18:58:44Z","updated_at":"2016-08-23T05:31:23Z","closed_at":null,"body":"Hi there,\r\n\r\nWe're seeing a lot of jobs showing up as failed when they haven't really failed, and then restarting on their own.  The jobs and stages eventually complete but any of these restarts make the build take longer.  It looks as though the Go server (ours is Go Version: 13.1.1) seems to be getting confused about state changes;  I'm including a stack trace as well as the two warning messages that follow it:\r\n````\r\nJobInstanceSqlMapDao:306 - State change for a completed Job is not allowed. Job JobIdentifier[goconfig, 11933, 11933, UpdateGoConfiguration, 1, CopyNewConfiguration, 211844] is currently State=Preparing, Result=Failed`\r\njava.lang.Exception\r\n        at com.thoughtworks.cruise.server.dao.JobInstanceSqlMapDao.logIfJobIsCompleted(JobInstanceSqlMapDao.java:306)\r\n        at com.thoughtworks.cruise.server.dao.JobInstanceSqlMapDao.access$700(JobInstanceSqlMapDao.java:41)\r\n        at com.thoughtworks.cruise.server.dao.JobInstanceSqlMapDao$2.doInTransaction(JobInstanceSqlMapDao.java:280)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionTemplate$2.doInTransaction(TransactionTemplate.java:23)\r\n        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionTemplate.execute(TransactionTemplate.java:19)\r\n        at com.thoughtworks.cruise.server.dao.JobInstanceSqlMapDao.updateStateAndResult(JobInstanceSqlMapDao.java:262)\r\n        at com.thoughtworks.cruise.server.service.JobInstanceService$3.doInTransactionWithoutResult(JobInstanceService.java:151)\r\n        at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionTemplate$2.doInTransaction(TransactionTemplate.java:23)\r\n        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionTemplate.execute(TransactionTemplate.java:19)\r\n        at com.thoughtworks.cruise.server.service.JobInstanceService.internalUpdateJobStateAndResult(JobInstanceService.java:149)\r\n        at com.thoughtworks.cruise.server.service.JobInstanceService.access$000(JobInstanceService.java:42)\r\n        at com.thoughtworks.cruise.server.service.JobInstanceService$1.doInTransactionWithoutResult(JobInstanceService.java:95)\r\n        at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionTemplate$2.doInTransaction(TransactionTemplate.java:23)\r\n        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionTemplate.execute(TransactionTemplate.java:19)\r\n        at com.thoughtworks.cruise.server.service.JobInstanceService.updateStateAndResult(JobInstanceService.java:93)\r\n        at com.thoughtworks.cruise.server.service.ScheduleService$5.doInTransactionWithoutResult(ScheduleService.java:500)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:7)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionCallback.doWithExceptionHandling(TransactionCallback.java:8)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionTemplate$3.doInTransaction(TransactionTemplate.java:37)\r\n        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)\r\n        at com.thoughtworks.cruise.server.transaction.TransactionTemplate.executeWithExceptionHandling(TransactionTemplate.java:33)\r\n        at com.thoughtworks.cruise.server.service.ScheduleService.updateJobStatus(ScheduleService.java:491)\r\n        at com.thoughtworks.cruise.server.service.BuildRepositoryService.updateStatusFromAgent(BuildRepositoryService.java:42)\r\n        at com.thoughtworks.cruise.remote.BuildRepositoryRemoteImpl$1.call(BuildRepositoryRemoteImpl.java:52)\r\n        at com.thoughtworks.cruise.remote.BuildRepositoryRemoteImpl.handleFailuresDuringReporting(BuildRepositoryRemoteImpl.java:90)\r\n        at com.thoughtworks.cruise.remote.BuildRepositoryRemoteImpl.reportCurrentStatus(BuildRepositoryRemoteImpl.java:48)\r\n        at com.thoughtworks.cruise.server.messaging.BuildRepositoryMessageProducer.reportCurrentStatus(BuildRepositoryMessageProducer.java:34)\r\n        at sun.reflect.GeneratedMethodAccessor254.invoke(Unknown Source)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:601)\r\n        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)\r\n        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)\r\n        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)\r\n        at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:77)\r\n        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\r\n        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)\r\n        at com.sun.proxy.$Proxy37.reportCurrentStatus(Unknown Source)\r\n        at sun.reflect.GeneratedMethodAccessor253.invoke(Unknown Source)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:601)\r\n        at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)\r\n        at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)\r\n        at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)\r\n        at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)\r\n        at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:73)\r\n        at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)\r\n        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)\r\n        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)\r\n        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)\r\n        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)\r\n        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)\r\n        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)\r\n        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)\r\n        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)\r\n        at com.thoughtworks.cruise.server.web.i18n.LocaleResolver.doFilter(LocaleResolver.java:26)\r\n        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)\r\n        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)\r\n        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)\r\n        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)\r\n        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)\r\n        at com.thoughtworks.cruise.server.web.FlashLoadingFilter.doFilter(FlashLoadingFilter.java:29)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)\r\n        at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)\r\n        at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)\r\n        at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)\r\n        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)\r\n        at org.springframework.security.ui.x509.X509ProcessingFilter.doFilter(X509ProcessingFilter.java:137)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)\r\n        at com.thoughtworks.cruise.server.web.i18n.LocaleResolver.doFilter(LocaleResolver.java:26)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)\r\n        at com.thoughtworks.cruise.server.security.ArtifactSizeEnforcementFilter.doFilter(ArtifactSizeEnforcementFilter.java:60)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)\r\n        at com.thoughtworks.cruise.server.security.PerformanceLoggingFilter.doFilter(PerformanceLoggingFilter.java:30)\r\n        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)\r\n        at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)\r\n        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)\r\n        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)\r\n        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)\r\n        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)\r\n        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)\r\n        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)\r\n        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)\r\n        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)\r\n        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)\r\n        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)\r\n        at org.mortbay.jetty.Server.handle(Server.java:326)\r\n        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)\r\n        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)\r\n        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)\r\n        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)\r\n        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)\r\n        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)\r\n        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)\r\n\r\nWARN [75@MessageListener for WorkFinder] ScheduleService:585 - [Job Reschedule] Found latest incomplete job for agent Agent..[Job Instance: JobInstance{stageId=85263, name='CopyNewConfiguration', state=Preparing, result=Failed, \t\r\nWARN [75@MessageListener for WorkFinder] ScheduleService:599 - [Job Reschedule] Rescheduling and marking old job as ignored: JobInstance{stageId=85263, name='CopyNewConfiguration', state=Preparing, result=Failed,\r\n````\r\nThere's a related issue at https://github.com/gocd/gocd/issues/24 but that one was closed by the user without any follow up.\r\n\r\nAny ideas of what's going on, and how we can fix it?"},"comment":{"url":"https://api.github.com/repos/gocd/gocd/issues/comments/241630996","html_url":"https://github.com/gocd/gocd/issues/1202#issuecomment-241630996","issue_url":"https://api.github.com/repos/gocd/gocd/issues/1202","id":241630996,"user":{"login":"zabil","id":54427,"avatar_url":"https://avatars.githubusercontent.com/u/54427?v=3","gravatar_id":"","url":"https://api.github.com/users/zabil","html_url":"https://github.com/zabil","followers_url":"https://api.github.com/users/zabil/followers","following_url":"https://api.github.com/users/zabil/following{/other_user}","gists_url":"https://api.github.com/users/zabil/gists{/gist_id}","starred_url":"https://api.github.com/users/zabil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zabil/subscriptions","organizations_url":"https://api.github.com/users/zabil/orgs","repos_url":"https://api.github.com/users/zabil/repos","events_url":"https://api.github.com/users/zabil/events{/privacy}","received_events_url":"https://api.github.com/users/zabil/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T05:31:22Z","updated_at":"2016-08-23T05:31:22Z","body":"@ketan I was talking about this\r\nhttps://github.com/gocd/gocd/issues/1202#issuecomment-241389737\r\n"}}
{"actor":{"display_login":"zabil"}}