Yet again I'm trying to work out why my new build plan on Bamboo isn't working. All the configuration details are good, but Bamboo can't access the repo. Apparently it doesn't exist. What?

Here's part of the stack trace displayed in Bamboo:


Caused by: com.atlassian.bamboo.repository.RepositoryException: Runtime exception.
at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:285)
at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:186)
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: com.google.common.util.concurrent.UncheckedExecutionException: com.atlassian.bamboo.plugins.git.GitCommandException: command /opt/git/current/bin/git ls-remote ssh://f1ca42c1-202b-4319-b86f-ce49828e3bc7@127.0.0.1:66102/splendid/spliffing-product.git failed with code 128. Working directory was [.]., stderr:
[Warning: Permanently added '[127.0.0.1]:66102' (RSA) to the list of known hosts., fatal: remote error: Repository does not exist, The requested repository does not exist, or you do not have permission to, access it., fatal: Could not read from remote repository., , Please make sure you have the correct access rights, and the repository exists.]
at com.google.common.cache.AbstractCache.getUnchecked(AbstractCache.java:51)
at com.atlassian.bamboo.plugins.git.CallableResultCache.call(CallableResultCache.java:82)
at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.getRemoteRefs(NativeGitOperationHelper.java:464)
at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.resolveBranch(NativeGitOperationHelper.java:399)
at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.obtainLatestRevision(NativeGitOperationHelper.java:497)
at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:198)
... 36 more
Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command /opt/git/current/bin/git ls-remote ssh://f1ca42c1-202b-4319-b86f-ce49828e3bc7@127.0.0.1:66102/splendid/spliffing-product.git failed with code 128. Working directory was [.]., stderr:
[Warning: Permanently added '[127.0.0.1]:66102' (RSA) to the list of known hosts., fatal: remote error: Repository does not exist, The requested repository does not exist, or you do not have permission to, access it., fatal: Could not read from remote repository., , Please make sure you have the correct access rights, and the repository exists.]
at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:496)
at com.atlassian.bamboo.plugins.git.GitCommandProcessor.getRemoteRefs(GitCommandProcessor.java:416)

Oh, wait a minute, "you do not have permission to, access it", crap. It's that again.

OK, that's easy to fix. We're using a dedicated Bamboo user to access the repo. I bet I haven't added permissions for that user in my Stash project.

stash-bamboo-annotated

There we go. Added. Guess what, my build works just dandy now.

Idiot. Maybe a public shaming blog post will remind me for next time.

Update

So, on to release plans... Having got the CI build working nicely, I need to also remember little aspects of releasing.

Remember to update the Maven environment variables with some git details, otherwise you get my next mystery error:


[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to commit files
Provider message:
The git-commit command failed.
Command output:

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <atlassian@example.com>) not allowed

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch

Browse to your release job, Maven task...

env-variables

Add something similar to this in Environment variables:

GIT_AUTHOR_NAME=Bamboo GIT_AUTHOR_EMAIL=bamboo@example.com GIT_COMMITTER_NAME=Bamboo GIT_COMMITTER_EMAIL=bamboo@example.com