Details
-
Bug
-
Resolution: Invalid
-
Low
-
None
-
5.2.2
-
None
-
None
Description
I have a Git repository managed by Stash which requires user/password authentication when checking out source code.
I have defined two global variables in Bamboo, stash.username and stash.password.
In my plan configuration, I've configured the "Source Repository" this way:
Repository URL: http://localhost:7990/scm/proj/repository.git
Authentication Type: Username/password
Username:
${bamboo.stash.username}
Password:
${bamboo.stash.password}
This doesn't work. The username variable is correctly replaced by its value, but the password variable is not replaced. I believe Bamboo tries to use the string
"${bamboo.stash.password}"
as password, instead of the variable value.
This is proved by modifying the password field by typing the variable value (i.e., the real password). In this case, the build is successful.
The following is written in the Bamboo instance logs:
2013-11-27 15:20:15,170 INFO [3-DelayedChangeDetectionThread:pool-6-thread-5] [RetryingTaskExecutor] Task 'Collecting changes for OSP-SIT' was unsuccessful. Run 1 / 2. Exception thrown when running task 'Collecting changes for OSP-SIT', with message: : http://localhost:7990/scm/proj/repository.git: not authorized 2013-11-27 15:20:15,171 INFO [3-DelayedChangeDetectionThread:pool-6-thread-5] [RetryingTaskExecutor] Waiting 5969ms before retrying... 2013-11-27 15:20:15,780 INFO [http-bio-8085-exec-7] [AccessLogFilter] fkraemer GET http://localhost:8085/rest/api/latest/result/status/OSP-SIT-5?expand=stages.stage.results.result&_=1385572815708 149939kb 2013-11-27 15:20:15,869 INFO [http-bio-8085-exec-5] [AccessLogFilter] fkraemer GET http://localhost:8085/rest/stp/1.0/license/status 149264kb 2013-11-27 15:20:15,869 INFO [http-bio-8085-exec-7] [AccessLogFilter] fkraemer GET http://localhost:8085/rest/nav-links-analytics-data/1.0/ 149264kb 2013-11-27 15:20:20,874 INFO [http-bio-8085-exec-3] [AccessLogFilter] fkraemer GET http://localhost:8085/rest/api/latest/result/status/OSP-SIT-5?expand=stages.stage.results.result&_=1385572820865 148972kb 2013-11-27 15:20:21,178 INFO [3-DelayedChangeDetectionThread:pool-6-thread-5] [RetryingTaskExecutor] Task 'Collecting changes for OSP-SIT' was unsuccessful. Run 2 / 2. Exception thrown when running task 'Collecting changes for OSP-SIT', with message: : http://localhost:7990/scm/proj/repository.git: not authorized 2013-11-27 15:20:21,178 ERROR [3-DelayedChangeDetectionThread:pool-6-thread-5] [RetryingTaskExecutor] Failed to run task 'Collecting changes for OSP-SIT' after 2 attempts. Task was not executed. 2013-11-27 15:20:21,178 ERROR [3-DelayedChangeDetectionThread:pool-6-thread-5] [RetryingTaskExecutor] Exception being rethrown 2013-11-27 15:20:21,178 ERROR [3-DelayedChangeDetectionThread:pool-6-thread-5] [ChainExecutionManagerImpl] Errors getting changes for OSP-SIT-5 java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: : http://localhost:7990/scm/proj/repository.git: not authorized 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.v2.trigger.DefaultChangeDetectionManager.collectionChangesWithRetry(DefaultChangeDetectionManager.java:470) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:331) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:259) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:161) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectAllChangesSinceLastBuild(DefaultChangeDetectionManager.java:127) at com.atlassian.bamboo.v2.trigger.ManualBuildDetectionAction.performDelayedChangeDetection(ManualBuildDetectionAction.java:173) at com.atlassian.bamboo.chains.ChainExecutionManagerImpl$2.getChainState(ChainExecutionManagerImpl.java:207) at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.tryStartChainState(ChainExecutionManagerImpl.java:260) at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.delayedStart(ChainExecutionManagerImpl.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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.$Proxy98.delayedStart(Unknown Source) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1$1$1.call(PlanExecutionManagerImpl.java:383) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1$1$1.call(PlanExecutionManagerImpl.java:378) 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:725) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.access$200(PlanExecutionManagerImpl.java:123) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1$1.run(PlanExecutionManagerImpl.java:377) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:55) at java.lang.Thread.run(Thread.java:662) Caused by: com.atlassian.bamboo.repository.RepositoryException: : http://localhost:7990/scm/proj/repository.git: not authorized at com.atlassian.bamboo.plugins.git.JGitOperationHelper.obtainLatestRevision(JGitOperationHelper.java:431) at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:217) at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:205) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager$1.call(DefaultChangeDetectionManager.java:475) at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager$1.call(DefaultChangeDetectionManager.java:471) at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108) ... 32 more Caused by: org.shaded.eclipse.jgit.errors.TransportException: http://localhost:7990/scm/proj/repository.git: not authorized at org.shaded.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:446) at org.shaded.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:276) at com.atlassian.bamboo.plugins.git.JGitOperationHelper.withFetchConnection(JGitOperationHelper.java:885) at com.atlassian.bamboo.plugins.git.JGitOperationHelper.obtainLatestRevision(JGitOperationHelper.java:407) ... 37 more 2013-11-27 15:20:21,181 INFO [3-DelayedChangeDetectionThread:pool-6-thread-5] [DefaultErrorHandler] Recording an error: Errors getting changes for OSP-SIT-5 : OSP-SIT : com.atlassian.bamboo.repository.RepositoryException: : http://localhost:7990/scm/proj/repository.git: not authorized 2013-11-27 15:20:21,204 INFO [3-DelayedChangeDetectionThread:pool-6-thread-5] [ChainExecutionManagerImpl] Plan OSP-SIT-5: One Single Project - Stash Integration Test has finished executing