Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-14407

Variables bigger than 255 chars break the plan

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 5.6.0
    • None
    • None
    • None

    Description

      It affected this build: https://confluence-bamboo.internal.atlassian.com/browse/CONFFUNC2-CLUSTPGJ7R

      After we created a variable with 266 characters, it wasn't possible to run any builds anymore. Even master would fail with a "DataIntegrityViolationException".

      Error message:

      Plan 'CONFFUNC2-CLUSTPGN40' could not be started. Hibernate operation: could not insert: [com.atlassian.bamboo.variable.VariableContextSnapshotImpl#692223926]; SQL []; Batch entry 19 insert into VARIABLE_CONTEXT (VARIABLE_KEY, VARIABLE_VALUE, VARIABLE_TYPE, BUILDRESULTSUMMARY_ID, VARIABLE_CONTEXT_ID) values ('batch.common', '-B clean integration-test -pl confluence-build/confluence-test-runner/confluence-multi-test -am -Dacceptance.test.dbname=confluence -Drandomness.on=false -Pextended-acceptance-test,multi,cluster-test,cargo-cluster-node1,cargo-cluster-node2,postgres -Ddisable.studio', 'PLAN', '690686982', '692223926') was aborted. Call getNextException to see the cause.; nested exception is java.sql.BatchUpdateException: Batch entry 19 insert into VARIABLE_CONTEXT (VARIABLE_KEY, VARIABLE_VALUE, VARIABLE_TYPE, BUILDRESULTSUMMARY_ID, VARIABLE_CONTEXT_ID) values ('batch.common', '-B clean integration-test -pl confluence-build/confluence-test-runner/confluence-multi-test -am -Dacceptance.test.dbname=confluence -Drandomness.on=false -Pextended-acceptance-test,multi,cluster-test,cargo-cluster-node1,cargo-cluster-node2,postgres -Ddisable.studio', 'PLAN', '690686982', '692223926') was aborted. Call getNextException to see the cause.
      org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.bamboo.variable.VariableContextSnapshotImpl#692203470]; SQL []; Batch entry 19 insert into VARIABLE_CONTEXT (VARIABLE_KEY, VARIABLE_VALUE, VARIABLE_TYPE, BUILDRESULTSUMMARY_ID, VARIABLE_CONTEXT_ID) values ('batch.common', '-B clean integration-test -pl confluence-build/confluence-test-runner/confluence-multi-test -am -Dacceptance.test.dbname=confluence -Drandomness.on=false -Pextended-acceptance-test,multi,cluster-test,cargo-cluster-node1,cargo-cluster-node2,postgres -Ddisable.studio', 'PLAN', '690686701', '692203470') was aborted.  Call getNextException to see the cause.; nested exception is java.sql.BatchUpdateException: Batch entry 19 insert into VARIABLE_CONTEXT (VARIABLE_KEY, VARIABLE_VALUE, VARIABLE_TYPE, BUILDRESULTSUMMARY_ID, VARIABLE_CONTEXT_ID) values ('batch.common', '-B clean integration-test -pl confluence-build/confluence-test-runner/confluence-multi-test -am -Dacceptance.test.dbname=confluence -Drandomness.on=false -Pextended-acceptance-test,multi,cluster-test,cargo-cluster-node1,cargo-cluster-node2,postgres -Ddisable.studio', 'PLAN', '690686701', '692203470') was aborted.  Call getNextException to see the cause.
      Caused by: java.sql.BatchUpdateException: Batch entry 19 insert into VARIABLE_CONTEXT (VARIABLE_KEY, VARIABLE_VALUE, VARIABLE_TYPE, BUILDRESULTSUMMARY_ID, VARIABLE_CONTEXT_ID) values ('batch.common', '-B clean integration-test -pl confluence-build/confluence-test-runner/confluence-multi-test -am -Dacceptance.test.dbname=confluence -Drandomness.on=false -Pextended-acceptance-test,multi,cluster-test,cargo-cluster-node1,cargo-cluster-node2,postgres -Ddisable.studio', 'PLAN', '690686701', '692203470') was aborted.  Call getNextException to see the cause.
      	at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2569)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1796)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2708)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
      	at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
      	at net.sf.hibernate.impl.BatchingBatcher.addToBatch(BatchingBatcher.java:34)
      	at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:462)
      	at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:436)
      	at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
      	at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2451)
      	at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2437)
      	at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2394)
      	at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2263)
      	at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
      	at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
      	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
      	at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
      	at com.sun.proxy.$Proxy20.commit(Unknown Source)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at com.atlassian.bamboo.author.AuthorCreatorServiceInterceptor.invoke(AuthorCreatorServiceInterceptor.java:45)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.sun.proxy.$Proxy92.create(Unknown Source)
      	at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.createNewChainState(ChainExecutionManagerImpl.java:490)
      	at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.access$000(ChainExecutionManagerImpl.java:100)
      	at com.atlassian.bamboo.chains.ChainExecutionManagerImpl$1.getChainState(ChainExecutionManagerImpl.java:180)
      	at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.tryStartChainState(ChainExecutionManagerImpl.java:262)
      	at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.start(ChainExecutionManagerImpl.java:174)
      	at sun.reflect.GeneratedMethodAccessor2080.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      	at com.sun.proxy.$Proxy97.start(Unknown Source)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$3$2.call(PlanExecutionManagerImpl.java:492)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$3$2.call(PlanExecutionManagerImpl.java:485)
      	at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312)
      	at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.inlineProcessLocks(PlanExecutionLockServiceImpl.java:99)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithInlineProcessLock(PlanExecutionManagerImpl.java:696)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.access$400(PlanExecutionManagerImpl.java:125)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$3.call(PlanExecutionManagerImpl.java:484)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$3.call(PlanExecutionManagerImpl.java:465)
      	at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312)
      	at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:81)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:741)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startConditionalBuild(PlanExecutionManagerImpl.java:464)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:535)
      	at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:552)
      	at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$3.startPlanExecution(NonBlockingPlanExecutionServiceImpl.java:166)
      	at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$3$1.run(NonBlockingPlanExecutionServiceImpl.java:145)
      	at com.atlassian.bamboo.util.CacheAwareness.whileReadingThroughCaches(CacheAwareness.java:85)
      	at com.atlassian.bamboo.util.CacheAwareness.whileReadingThroughCaches(CacheAwareness.java:102)
      	at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$3.call(NonBlockingPlanExecutionServiceImpl.java:148)
      	at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$3.call(NonBlockingPlanExecutionServiceImpl.java:133)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      	at java.lang.Thread.run(Thread.java:744)
      

      Looking at the VARIABLE_CONTEXT database, looks like it needs to be less than 255 chars.

      bamboo_server=# \d VARIABLE_CONTEXT
                    Table "public.variable_context"
              Column        |          Type          | Modifiers 
      -----------------------+------------------------+-----------
      variable_context_id  | bigint                | not null
      variable_key          | character varying(255) | not null
      variable_value        | character varying(255) | 
      variable_type        | character varying(255) | 
      buildresultsummary_id | bigint                | not null
      Indexes:
          "variable_context_pkey" PRIMARY KEY, btree (variable_context_id)
          "var_context_result_idx" btree (buildresultsummary_id)
          "var_ctx_type_idx" btree (variable_type)
      

      What is misleading (as we were able to save the variable, but not run a plan that has it).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              psemeniuk Petro Semeniuk (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: