Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build info upload breaks after plugin upgrade #101

Open
solazs opened this issue Oct 14, 2021 · 1 comment
Open

Build info upload breaks after plugin upgrade #101

solazs opened this issue Oct 14, 2021 · 1 comment

Comments

@solazs
Copy link

solazs commented Oct 14, 2021

Hi,
We have recently upgraded the teamcity plugin from a pretty old version (2.3.1) to the most recent one (2.9.1) and that broke some of our builds.

We upload artifacts and build info from multiple steps during our build e.g. Upload maven modules from one step, then upload an installer (exe) from the next. We have upload build info ticket for both build steps.

The second upload produces a HTTP 500 error:

java.io.IOException: Failed to send build descriptor. 500:  Response message: {
    "errors" : [ {
      "status" : 500,
      "message" : "Could not insert build Build{version='1.0.1', name='<redacted build type>', number='456', type=null, buildAgent=simpleRunner, agent=TeamCity/2021.1.3 (build 92914), started='2021-10-08T10:57:39.056+0200', durationMillis=136618, principal='<redacted user name>', artifactoryPrincipal='teamcity-publisher', artifactoryPluginVersion='2.9.1', url='https://<redacted server name>/viewLog.html?buildId=7249289&buildTypeId=<redacted build type>', parentName='null', parentNumber='null', vcs='[]', vcsRevision='null', vcsUrl='null', parentBuildId='null', licenseControl=null, buildRetention=null, runParameters=null, modules=[org.jfrog.build.api.Module@25c698cb], statuses=null, buildDependencies=[], issues=null, governance=null}"
    } ]
  }
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendBuildInfo(ArtifactoryBuildInfoClient.java:188)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendBuildInfo(ArtifactoryBuildInfoClient.java:267)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention(Utils.java:63)
    at org.jfrog.teamcity.agent.util.BuildInfoUtils.sendBuildAndBuildRetention(BuildInfoUtils.java:55)
    at org.jfrog.teamcity.agent.listener.AgentListenerBuildInfoHelper.runnerFinished(AgentListenerBuildInfoHelper.java:194)
    at org.jfrog.teamcity.agent.ArtifactoryAgentListener.runnerFinished(ArtifactoryAgentListener.java:133)
    at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at jetbrains.buildServer.util.EventDispatcher$3.run(EventDispatcher.java:138)
    at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:76)
    at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:132)
    at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:82)
    at com.sun.proxy.$Proxy7.runnerFinished(Unknown Source)
    at jetbrains.buildServer.agent.impl.buildStages.runnerStages.finish.FireRunnerFinishedFStage.doFinishStage(FireRunnerFinishedFStage.java:31)
    at jetbrains.buildServer.agent.impl.buildStages.RunnerFinishStagesExecutor.runFinishStage(RunnerFinishStagesExecutor.java:32)
    at jetbrains.buildServer.agent.impl.buildStages.RunnerFinishStagesExecutor.doBuildFinishStages(RunnerFinishStagesExecutor.java:23)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.RunnerContextExecutor.safeCallFinishStages(RunnerContextExecutor.java:65)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.RunnerContextExecutor.callRunnerStages(RunnerContextExecutor.java:56)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.StepExecutor.processNextStep(StepExecutor.java:25)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeRunnerStep(ForEachBuildRunnerStage.java:139)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.runStep(ForEachBuildRunnerStage.java:124)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeBuildRunners(ForEachBuildRunnerStage.java:84)
    at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.doBuildStage(ForEachBuildRunnerStage.java:45)
    at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:33)
    at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:24)
    at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:76)
    at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:35)
    at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(BuildStagesExecutor.java:24)
    at jetbrains.buildServer.agent.impl.BuildRunActionImpl.doStages(BuildRunActionImpl.java:81)
    at jetbrains.buildServer.agent.impl.BuildRunActionImpl.runBuild(BuildRunActionImpl.java:57)
    at jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(BuildAgentImpl.java:333)
    at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$200(BuildAgentImpl.java:58)
    at jetbrains.buildServer.agent.impl.BuildAgentImpl$1.run(BuildAgentImpl.java:288)
    at java.lang.Thread.run(Thread.java:745)
  Caused by: java.io.IOException: 500:  Response message: {
    "errors" : [ {
      "status" : 500,
      "message" : "Could not insert build Build{version='1.0.1', name='<redacted build type>', number='456', type=null, buildAgent=simpleRunner, agent=TeamCity/2021.1.3 (build 92914), started='2021-10-08T10:57:39.056+0200', durationMillis=136618, principal='<redacted user name>', artifactoryPrincipal='teamcity-publisher', artifactoryPluginVersion='2.9.1', url='https://<redacted server name>/viewLog.html?buildId=7249289&buildTypeId=<redacted build type>', parentName='null', parentNumber='null', vcs='[]', vcsRevision='null', vcsUrl='null', parentBuildId='null', licenseControl=null, buildRetention=null, runParameters=null, modules=[org.jfrog.build.api.Module@25c698cb], statuses=null, buildDependencies=[], issues=null, governance=null}"
    } ]
  }
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendHttpRequest(ArtifactoryBuildInfoClient.java:314)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendHttpEntityRequest(ArtifactoryBuildInfoClient.java:296)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendBuildInfo(ArtifactoryBuildInfoClient.java:186)
    ... 34 more

Corresponding server-side message:

org.artifactory.storage.StorageException: Could not insert build Build

{version='1.0.1', name='<redacted build type>', number='456', type=null, buildAgent=simpleRunner, agent=TeamCity/2021.1.3 (build 92914), started='2021-10-08T10:57:39.056+0200', durationMillis=136618, principal='<redacted user name>', artifactoryPrincipal='teamcity-publisher', artifactoryPluginVersion='2.9.1', url='https://<redacted server name>/viewLog.html?buildId=7249289&buildTypeId=<redacted build type>', parentName='null', parentNumber='null', vcs='[]', vcsRevision='null', vcsUrl='null', parentBuildId='null', licenseControl=null, buildRetention=null, runParameters=null, modules=[org.jfrog.build.api.Module@25c698cb], statuses=null, buildDependencies=[], issues=null, governance=null}
at org.artifactory.storage.db.build.service.BuildStoreServiceImpl.addBuild(BuildStoreServiceImpl.java:133)
at org.artifactory.build.BuildServiceImpl.addBuild(BuildServiceImpl.java:167)
at sun.reflect.GeneratedMethodAccessor755.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:78)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy197.addBuild(Unknown Source)
at org.artifactory.build.BuildServiceImpl.addBuild(BuildServiceImpl.java:146)
at sun.reflect.GeneratedMethodAccessor754.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:76)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy197.addBuild(Unknown Source)
at org.artifactory.rest.resource.ci.BuildResource.addBuild(BuildResource.java:336)
at sun.reflect.GeneratedMethodAccessor751.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.artifactory.webapp.servlet.RepoFilter.execute(RepoFilter.java:183)
at org.artifactory.webapp.servlet.RepoFilter.doFilter(RepoFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.artifactory.webapp.servlet.AccessFilter.useAuthentication(AccessFilter.java:433)
at org.artifactory.webapp.servlet.AccessFilter.authenticateAndExecute(AccessFilter.java:306)
at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:209)
at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:168)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.artifactory.webapp.servlet.RequestFilter.doFilter(RequestFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.artifactory.webapp.servlet.ArtifactoryCsrfFilter.doFilter(ArtifactoryCsrfFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:164)
at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80)
at org.artifactory.webapp.servlet.SessionFilter.doFilter(SessionFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.artifactory.webapp.servlet.ArtifactoryFilter.doFilter(ArtifactoryFilter.java:121)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:279)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '<redacted build type>-456-1' for key 'builds_name_number_date_idx'
at sun.reflect.GeneratedConstructorAccessor284.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2490)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
at org.jfrog.storage.JdbcHelper.executeUpdate(JdbcHelper.java:216)
at org.artifactory.storage.db.build.dao.BuildsDao.createBuild(BuildsDao.java:66)
at org.artifactory.storage.db.build.service.BuildStoreServiceImpl.addBuild(BuildStoreServiceImpl.java:130)
... 87 common frames omitted

We're using artifactory 6.5.15 rev 60515900 (I know it's ancient, an upgrade is in the pipeline, but the problem is more urgent than that)
and Teamcity 2021.1.3

This issue only appears since we upgraded the plugin to 2.9.1. It looks like the timestamp in the index gets truncated and causes the duplicate error, but we get the same error with a shorter build type, where the timestamp remains intact.

@kohodono
Copy link

+1 we have the same issue ater upgrading to the latest version of plugin.
artifactory.deploy.* properties are not published any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants