ef-labs / stash-hook-mirror

An Atlassian Stash repository hook for mirroring to one or more remote git repositories.
MIT License
77 stars 58 forks source link

Breaks when trying to mirror an empty repository #19

Closed xaviershay closed 10 years ago

xaviershay commented 10 years ago

This is relevant when automatically setting up mirroring across the entire stash instance.

It's not that bad, but does clutter up the logs and workers.

2014-02-22 15:15:58,695 ERROR [threadpool:thread-728] git-mirror-robot 911x23958x1 yeirr0 192.168.19.0 "PUT /rest/api/1.0/projects/PROJECT_1/repos/rep_1/settings/hooks/com.englishtown.stash-hook-mirror:mirror-repository-hook/settings HTTP/1.1" c.e.stash.hook.MirrorRepositoryHook Failed to mirror repository pay-jenkins after 5 attempts.
com.atlassian.stash.exception.ServerException: An error occurred while executing an external process: '/usr/bin/git push --prune ssh://git@git-mirror/app/git/stash/project_1/rep_1.git +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/*' exited with code 1 saying: No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'ssh://git@git-mirror/app/git/stash/project_1/rep_1.git'
    at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.evaluateThrowable(GitCommandExitHandler.java:120) ~[na:na]
    at com.atlassian.stash.scm.git.common.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:163) ~[na:na]
    at com.atlassian.stash.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:35) ~[stash-spi-2.10.2.jar:na]
    at com.englishtown.stash.hook.PasswordHandler.onExit(PasswordHandler.java:46) ~[plugin.6810898803854921466.stash-hook-mirror-1.7.0_1383594112000.jar:na]
    at com.atlassian.stash.scm.BaseCommand.callExitHandler(BaseCommand.java:143) ~[stash-spi-2.10.2.jar:na]
    at com.atlassian.stash.scm.BaseCommand$CommandFuture.internalGet(BaseCommand.java:256) ~[stash-spi-2.10.2.jar:na]
    at com.atlassian.stash.scm.BaseCommand$CommandFuture.get(BaseCommand.java:225) ~[stash-spi-2.10.2.jar:na]
    at com.atlassian.stash.scm.BaseCommand.call(BaseCommand.java:78) ~[stash-spi-2.10.2.jar:na]
    at com.englishtown.stash.hook.MirrorRepositoryHook$1.call(MirrorRepositoryHook.java:119) [plugin.6810898803854921466.stash-hook-mirror-1.7.0_1383594112000.jar:na]
    at com.englishtown.stash.hook.MirrorRepositoryHook$1.call(MirrorRepositoryHook.java:107) [plugin.6810898803854921466.stash-hook-mirror-1.7.0_1383594112000.jar:na]
adrianluisgonzalez commented 10 years ago

Any interest in submitting a PR?

xaviershay commented 10 years ago

See linked.