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

Source Code Checkout Task - Bamboo Remote Agent - Git VCS - Submodules - SSH private key not used for sub-modules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • None
    • Repository (Git)
    • None

    Description

      Consider the following:

      • Plan with a single git Source Repository:
        • Use submodules check box ticked.
        • Authentication Type SSH private key.
      • BitBucket git repos representing the parent git repository and all sub-modules; each with the corresponding SSH public key for the private key used in the Plan's Source Repository. These repositories are also have read privileges for any member of the group atlassian-staff in BitBucket.

      When the build is executed on a Build agent which doesn't have a local SSH private key, the build will fail on the first submodule update:

      java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Checkout to revision ca17aab070816756a288f339fb7b14c001d3453d has failed.command /usr/bin/git submodule update --init --recursive failed with code 1. Working directory was [/opt/bamboora/bamboo-agent-home/xml-data/build-dir/PERFENGPUPPET-ROLES-JOB1]., stderr:
      Submodule 'modules/apparmor' (git@bitbucket.org:pdzwart_atlassian/puppet-module-apparmor.git) registered for path 'modules/apparmor'
      Submodule 'modules/apt' (git@bitbucket.org:pdzwart_atlassian/puppet-module-apt.git) registered for path 'modules/apt'
      Submodule 'modules/apt_listchanges' (git@bitbucket.org:pdzwart_atlassian/puppet-module-apt_listchanges.git) registered for path 'modules/apt_listchanges'
      Submodule 'modules/bamboo' (git@bitbucket.org:pdzwart_atlassian/puppet-module-bamboo.git) registered for path 'modules/bamboo'
      Submodule 'modules/bind' (git@bitbucket.org:pdzwart_atlassian/puppet-module-bind.git) registered for path 'modules/bind'
      Submodule 'modules/collectd' (git@bitbucket.org:pdzwart_atlassian/puppet-module-collectd.git) registered for path 'modules/collectd'
      Submodule 'modules/daemontools' (git@bitbucket.org:pdzwart_atlassian/puppet-module-daemontools.git) registered for path 'modules/daemontools'
      Submodule 'modules/debian_pxeboot' (git@bitbucket.org:pdzwart_atlassian/puppet-module-debian_pxeboot.git) registered for path 'modules/debian_pxeboot'
      Submodule 'modules/dhcp_client' (git@bitbucket.org:pdzwart_atlassian/puppet-module-dhcp_client.git) registered for path 'modules/dhcp_client'
      Submodule 'modules/harstorage' (git@bitbucket.org:pdzwart_atlassian/puppet-module-harstorage.git) registered for path 'modules/harstorage'
      Submodule 'modules/isc_dhcp' (git@bitbucket.org:pdzwart_atlassian/puppet-module-isc_dhcp.git) registered for path 'modules/isc_dhcp'
      Submodule 'modules/java' (git@bitbucket.org:pdzwart_atlassian/puppet-module-java.git) registered for path 'modules/java'
      Submodule 'modules/koto' (git@bitbucket.org:pdzwart_atlassian/puppet-module-koto.git) registered for path 'modules/koto'
      Submodule 'modules/ldap_client' (git@bitbucket.org:pdzwart_atlassian/puppet-module-ldap_client.git) registered for path 'modules/ldap_client'
      Submodule 'modules/lldpd' (git@bitbucket.org:pdzwart_atlassian/puppet-module-lldpd.git) registered for path 'modules/lldpd'
      Submodule 'modules/maven' (git@bitbucket.org:pdzwart_atlassian/puppet-module-maven.git) registered for path 'modules/maven'
      Submodule 'modules/mysql' (git@bitbucket.org:pdzwart_atlassian/puppet-module-mysql.git) registered for path 'modules/mysql'
      Submodule 'modules/network' (git@bitbucket.org:pdzwart_atlassian/puppet-module-network.git) registered for path 'modules/network'
      Submodule 'modules/nfs_kernel_server' (git@bitbucket.org:pdzwart_atlassian/puppet-module-nfs_kernel_server.git) registered for path 'modules/nfs_kernel_server'
      Submodule 'modules/ntp' (git@bitbucket.org:pdzwart_atlassian/puppet-module-ntp.git) registered for path 'modules/ntp'
      Submodule 'modules/openldap' (git@bitbucket.org:pdzwart_atlassian/puppet-module-openldap.git) registered for path 'modules/openldap'
      Submodule 'modules/pam_limits' (git@bitbucket.org:pdzwart_atlassian/puppet-module-pam_limits.git) registered for path 'modules/pam_limits'
      Submodule 'modules/perfeng' (git@bitbucket.org:pdzwart_atlassian/puppet-module-perfeng) registered for path 'modules/perfeng'
      Submodule 'modules/postgresql' (git@bitbucket.org:pdzwart_atlassian/puppet-module-postgresql.git) registered for path 'modules/postgresql'
      Submodule 'modules/puppet' (git@bitbucket.org:pdzwart_atlassian/puppet-module-puppet.git) registered for path 'modules/puppet'
      Submodule 'modules/r' (git@bitbucket.org:pdzwart_atlassian/puppet-module-r.git) registered for path 'modules/r'
      Submodule 'modules/resolv' (git@bitbucket.org:pdzwart_atlassian/puppet-module-resolv.git) registered for path 'modules/resolv'
      Submodule 'modules/roles' (git@bitbucket.org:pdzwart_atlassian/puppet-module-roles.git) registered for path 'modules/roles'
      Submodule 'modules/rsyslog' (git@bitbucket.org:pdzwart_atlassian/puppet-module-rsyslog.git) registered for path 'modules/rsyslog'
      Submodule 'modules/sbt' (git@bitbucket.org:pdzwart_atlassian/puppet-module-sbt.git) registered for path 'modules/sbt'
      Submodule 'modules/soke' (git@bitbucket.org:pdzwart_atlassian/puppet-module-soke.git) registered for path 'modules/soke'
      Submodule 'modules/squid' (git@bitbucket.org:pdzwart_atlassian/puppet-module-squid.git) registered for path 'modules/squid'
      Submodule 'modules/ssh' (git@bitbucket.org:pdzwart_atlassian/puppet-module-ssh.git) registered for path 'modules/ssh'
      Submodule 'modules/stdlib' (git@bitbucket.org:pdzwart_atlassian/puppet-module-stdlib.git) registered for path 'modules/stdlib'
      Submodule 'modules/sudo' (git@bitbucket.org:pdzwart_atlassian/puppet-module-sudo.git) registered for path 'modules/sudo'
      Submodule 'modules/sysctl' (git@bitbucket.org:pdzwart_atlassian/puppet-module-sysctl.git) registered for path 'modules/sysctl'
      Submodule 'modules/tftpd' (git@bitbucket.org:pdzwart_atlassian/puppet-module-tftpd.git) registered for path 'modules/tftpd'
      Submodule 'modules/vagrant' (git@bitbucket.org:pdzwart_atlassian/puppet-module-vagrant.git) registered for path 'modules/vagrant'
      Submodule 'modules/virtualbox' (git@bitbucket.org:pdzwart_atlassian/puppet-module-virtualbox.git) registered for path 'modules/virtualbox'
      Submodule 'modules/vncserver' (git@bitbucket.org:pdzwart_atlassian/puppet-module-vncserver.git) registered for path 'modules/vncserver'
      Cloning into 'modules/apparmor'...
      Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to the list of known hosts.
      Permission denied (publickey).
      fatal: The remote end hung up unexpectedly
      Clone of 'git@bitbucket.org:pdzwart_atlassian/puppet-module-apparmor.git' into submodule path 'modules/apparmor' failed
      	at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:132)
      	at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88)
      	at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:191)
      	at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:176)
      	at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:109)
      	at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:187)
      	at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:68)
      	at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:69)
      	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206)
      	at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103)
      	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111)
      	at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: com.atlassian.bamboo.repository.RepositoryException: Checkout to revision ca17aab070816756a288f339fb7b14c001d3453d has failed.command /usr/bin/git submodule update --init --recursive failed with code 1. Working directory was [/opt/bamboora/bamboo-agent-home/xml-data/build-dir/PERFENGPUPPET-ROLES-JOB1]., stderr:
      

      When the build is run with the private key from the plan placed in the ~/.ssh/ of the Bamboo agent, the build succesfully checks out all git submodules.

      I would expect that as a user of Bamboo that I wouldn't have to distribute the SSH private key to all Bamboo remote agents; rather just have the private key kept as a part of the plan configuration.

      This way, the build infrastructure could scale in respect to not having to have a ssh-agent with all the SSH private keys loaded in for all git submodule based builds that are required to be built on these agents.

      Therefore Bamboo could leave the power of configuration up to the users of bamboo instead of the infrastructure administrators of the build agents.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pdzwart PdZ (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: