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

Problem mirroring to local git repo (expand your logging) #25

Closed tschirmer closed 9 years ago

tschirmer commented 9 years ago

Hey,

I'm getting a problem with mirroring, but nothing significant is appearing in the log files.

I understand this is meant to retry, but my installation of stash isn't running this schedule properly for whatever reason (I'm still looking into that separately).

That means the log looks like: 2014-08-18 16:03:42,336 WARN [threadpool:thread-85] Tony @113CSN8x963x6657x0 1rmbeux 192.168.0.180:56797,192.168.0.2 "PUT /rest/api/latest/projects/_/repos/**/settings/hooks/com.englishtown.stash-hook-mirror:mirror-repository-hook/settings HTTP/1.1" c.e.stash.hook.MirrorRepositoryHook Failed to mirror repository *_*****, retrying in 1 minute (attempt 1 of 5).

Then doesn't give me any more information (I notice in your code you're waiting til the 5th try before displaying the nature of the exception).

Seriously frustrating. A "debug mode" where it just logs everything wouldn't go astray.

tschirmer commented 9 years ago

My issue's solved, but it would've helped a lot to have those logs.

What was happening was some bad file encoding in the post-receive hook, and that was causing git to not read the file correctly. Not a terribly hard problem, but without to those logs took a fair amount to time to track down.