Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal: A branch named 'master-build' already exists. #381

Closed
janaksingh opened this issue Sep 12, 2016 · 10 comments
Closed

fatal: A branch named 'master-build' already exists. #381

janaksingh opened this issue Sep 12, 2016 · 10 comments
Labels
Bug Something isn't working

Comments

@janaksingh
Copy link

janaksingh commented Sep 12, 2016

Hi, I am having a slightly odd issue when RE-building the BLT artefact..

I am using….
blt deploy -Ddeploy.branch=master-build -Ddeploy.commitMsg=‘BLOG-000: Another test build.’

This works the first time, any subsequent update rebuilds, I am getting the following error:

fatal: A branch named 'master-build' already exists.

How should I be RE-building the artefact?

@janaksingh
Copy link
Author

janaksingh commented Sep 12, 2016

here is the complete error..

blt > deploy:remote:pull:

From mysite.devcloud.hosting.acquia.com:mysite
 * branch            master-build -> FETCH_HEAD
 * [new branch]      master-build -> 9ee9f57a555cedea3c1cded95bb1cf35/master-build
fatal: A branch named 'master-build' already exists.

[phingcall] /Users/dakku/Sites/devdesktop/mysite/vendor/acquia/blt/phing/tasks/deploy.xml:62:125: Task exited with code 128
  [foreach] /Users/dakku/Sites/devdesktop/mysite/vendor/acquia/blt/phing/tasks/deploy.xml:55:44: Execution of the target buildfile failed. Aborting.
[phingcall] /Users/dakku/Sites/devdesktop/mysite/vendor/acquia/blt/phing/tasks/deploy.xml:69:84: Execution of the target buildfile failed. Aborting.

BUILD FAILED
/Users/dakku/Sites/devdesktop/mysite/vendor/acquia/blt/phing/tasks/deploy.xml:25:43: Execution of the target buildfile failed. Aborting.

Total time: 20.6023 seconds

@grasmash
Copy link
Contributor

What version are you using?

@grasmash grasmash added the Bug Something isn't working label Sep 12, 2016
@grasmash
Copy link
Contributor

Actually, the artifact should be getting deleted before it is rebuilt: https://github.com/acquia/blt/blob/8.x/phing/tasks/deploy.xml#L127

Can you share your full output? Perhaps a permissions issue is preventing your artifact from being deleted in the first place.

@janaksingh
Copy link
Author

hey Matt,

i am running Phing 2.14.0-44-g0ef30e5 and BLT v8.. Let me get entire log..

@janaksingh
Copy link
Author

janaksingh commented Sep 12, 2016

dakku-mbpr:myblog dakku$ blt deploy -Ddeploy.branch=master-build -Ddeploy.commitMsg='BLOG-000: Another test build.'
Buildfile: /Users/dakku/Sites/devdesktop/myblog/vendor/acquia/blt/phing/build.xml
     [echo] Executing commands against multisite "default"
     [echo] No custom Phing file specified.

blt > deploy:

     [echo] Executing commands against multisite "default"
     [echo] No custom Phing file specified.

blt > deploy:prepare-dir:

   [delete] Deleting directory /Users/dakku/Sites/devdesktop/myblog/deploy
     [exec] Initialized empty Git repository in /Users/dakku/Sites/devdesktop/myblog/deploy/.git/
     [echo] Global .gitignore file is being disabled for this repository to prevent unexpected behavior.
     [echo] Executing commands against multisite "default"
     [echo] No custom Phing file specified.

blt > deploy:add-remotes:

     [echo] Executing commands against multisite "default"
     [echo] No custom Phing file specified.

blt > deploy:remote:add:

     [echo] Fetching from git remote [email protected]:myproject/myrepo.git
     [echo] Executing commands against multisite "default"
     [echo] No custom Phing file specified.

blt > deploy:remote:pull:

remote: Counting objects: 24451, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 24451 (delta 40), reused 38 (delta 38), pack-reused 24402
Receiving objects: 100% (24451/24451), 20.26 MiB | 4.60 MiB/s, done.
Resolving deltas: 100% (4029/4029), done.
From github.com-myuser:myproject/myrepo
 * branch            master-build -> FETCH_HEAD
 * [new branch]      master-build -> bac9deaab6a91701f97d0f9d66de1d46/master-build
Switched to a new branch 'master-build'
     [echo] Executing commands against multisite "default"
     [echo] No custom Phing file specified.

blt > deploy:remote:add:

     [echo] Fetching from git remote [email protected]:myblog.git
     [echo] Executing commands against multisite "default"
     [echo] No custom Phing file specified.

blt > deploy:remote:pull:

From freeacquia.devcloud.hosting.acquia.com:myblog
 * branch            master-build -> FETCH_HEAD
 * [new branch]      master-build -> 9ee9f57a555cedea3c1cded95bb1cf36/master-build
fatal: A branch named 'master-build' already exists.
[phingcall] /Users/dakku/Sites/devdesktop/myblog/vendor/acquia/blt/phing/tasks/deploy.xml:62:125: Task exited with code 128
  [foreach] /Users/dakku/Sites/devdesktop/myblog/vendor/acquia/blt/phing/tasks/deploy.xml:55:44: Execution of the target buildfile failed. Aborting.
[phingcall] /Users/dakku/Sites/devdesktop/myblog/vendor/acquia/blt/phing/tasks/deploy.xml:69:84: Execution of the target buildfile failed. Aborting.

BUILD FAILED
/Users/dakku/Sites/devdesktop/myblog/vendor/acquia/blt/phing/tasks/deploy.xml:25:43: Execution of the target buildfile failed. Aborting.

Total time: 20.6023 seconds

@janaksingh
Copy link
Author

janaksingh commented Sep 12, 2016

so, shall I try deploy:prepare-dir on its own and see if the directory is being removed?

update:

dakku-mbpr:myblog dakku$ blt deploy:prepare-dir
Buildfile: /Users/dakku/Sites/devdesktop/myblog/vendor/acquia/blt/phing/build.xml
     [echo] Executing commands against multisite "default"
     [echo] No custom Phing file specified.

blt > deploy:prepare-dir:

   [delete] Deleting directory /Users/dakku/Sites/devdesktop/myblog/deploy
     [exec] Initialized empty Git repository in /Users/dakku/Sites/devdesktop/myblog/deploy/.git/
     [echo] Global .gitignore file is being disabled for this repository to prevent unexpected behavior.

BUILD FINISHED

Total time: 11.4280 seconds

deploy directory is now empty! let me try to deploy again.

@janaksingh
Copy link
Author

no luck..

still get the..

fatal: A branch named 'master-build' already exists.

I guess deleting the folder makes no difference. deploy:remote:pull bring in the branch that was previously created and it fails because it exists already?

@janaksingh
Copy link
Author

@janaksingh
Copy link
Author

I changed line 62 in my local version of deploy.xml as per the link above..

basically adding
checkreturn="false" level="info" passthru="true"/>

All seems well.

@grasmash
Copy link
Contributor

Yeah I was wondering what exact version of BLT you were using. E.g., 8.4.0. Because I believe this bug has been fixed already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants