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

Maven tasks fail to run when repository isolation is enabled in the executable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 7.1.1
    • 7.0.4
    • Maven
    • None

      Issue Summary

      After upgrading Bamboo to 7.0, All the Maven tasks (whose corresponding Maven executables are enabled with repository isolation option) are failing with the below error.

      Steps to Reproduce

      1. Define a Maven 3.x executable in Bamboo 6.x
      2. Enable repository isolation for one of the Maven executables
      3. Add a Maven 3.x task and choose this executable.
      4. Run and confirm this Maven task is running
      5. Upgrade Bamboo to 7.0.4
      6. Run the same plan

      Expected Results

      Maven 3.x task runs without any errors.

      Actual Results

      The below exception is thrown in the build log:

      simple	25-May-2020 14:59:57	Starting task 'Compile pom-web' of type 'com.atlassian.bamboo.plugins.maven:task.builder.mvn3'
      error	25-May-2020 14:59:57	Error occurred while running Task 'Compile pom' of type com.atlassian.bamboo.plugins.maven:task.builder.mvn3.
      error	25-May-2020 14:59:57	com.atlassian.bamboo.task.TaskException: Failed to execute task
      ...
      ...
      error	25-May-2020 14:59:57		at com.atlassian.bamboo.plugins.maven.task.Maven3BuildTask.execute(Maven3BuildTask.java:72)
      error	25-May-2020 14:59:57		... 16 more
      error	25-May-2020 14:59:57	Caused by: com.thoughtworks.xstream.converters.ConversionException: 
      error	25-May-2020 14:59:57	---- Debugging information ----
      error	25-May-2020 14:59:57	cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
      error	25-May-2020 14:59:57	cause-message       : org.apache.commons.logging.LogFactory$Log4jLog
      error	25-May-2020 14:59:57	class               : org.apache.commons.configuration.XMLConfiguration$XMLFileConfigurationDelegate
      error	25-May-2020 14:59:57	required-type       : org.apache.commons.configuration.XMLConfiguration$XMLFileConfigurationDelegate
      error	25-May-2020 14:59:57	converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
      error	25-May-2020 14:59:57	path                : /com.atlassian.bamboo.ww2.actions.build.admin.create.CustomizedXMLConfiguration/delegate/log
      error	25-May-2020 14:59:57	line number         : 63
      error	25-May-2020 14:59:57	class[1]            : com.atlassian.bamboo.ww2.actions.build.admin.create.CustomizedXMLConfiguration
      error	25-May-2020 14:59:57	required-type[1]    : com.atlassian.bamboo.ww2.actions.build.admin.create.CustomizedXMLConfiguration
      error	25-May-2020 14:59:57	version             : not available
      error	25-May-2020 14:59:57	-------------------------------
      error	25-May-2020 14:59:57		at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:77)
      error	25-May-2020 14:59:57		at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
      error	25-May-2020 14:59:57		at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
      error	25-May-2020 14:59:57		at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:499)
      

      Workaround

      1. Stop Bamboo.
      2.  Backup the database.
      3. Run the below delete query
        DELETE FROM BANDANA
        WHERE BANDANA_KEY LIKE 'com.atlassian.bamboo.capability.DefaultCapabilityConfigurationManager:%' and serialized_data like '%Log4jLog%';
        
      4. Start Bamboo
      5. Navigate to this Maven executable and enable the "Local Repository Isolation" box (this would have been disabled as a result of running the above query).

      Validation

      1. Run the below select query to confirm it's in the bandana table:
        SELECT * FROM BANDANA WHERE BANDANA_KEY LIKE 'com.atlassian.bamboo.capability.DefaultCapabilityConfigurationManager:%' and serialized_data like '%org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog%'

              Unassigned Unassigned
              jinbasekaran Jeyanthan I (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: