Opened 2 years ago

Closed 2 years ago

#2343 closed defect (worksforme)

gitpoller fails when using ssh for the repository

Reported by: kclair Owned by:
Priority: major Milestone: ongoing
Version: 0.8.6p1 Keywords: git
Cc:

Description

I have defined the following ChangeSource (i've replaced the real user and host name with example data):

c['change_source'].append(GitPoller(
        'ssh://user@somehost:4422/our-repo',
        workdir='gitpoller-workdir', branch='master',
        pollinterval=300))

which is producing this error:

2012-08-09 20:23:18-0400 [-] gitpoller: repo poll failed

2012-08-09 20:23:18-0400 [-] Unhandled Error

Traceback (most recent call last): Failure: twisted.internet.utils._UnexpectedErrorOutput: got stderr: "fatal: ambiguous argument 'master..origin/master': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions "

I have confirmed that I am able to clone the repo using the same location as the same user that runs buildbot, and the cloning process doesn't require any keyboard intervention.

This looks very much like this bug from an older version: http://trac.buildbot.net/ticket/2116

But it appears that GitPoller? has been rewritten since then, and the patch is no longer applicable.

Change History (12)

comment:1 Changed 2 years ago by kclair

  • Summary changed from gitpoller fails when user ssh for the repository to gitpoller fails when using ssh for the repository

comment:2 Changed 2 years ago by dustin

The new version passes the environment when it runs git:

    def _dovccmd(self, command, args, path=None):
        d = utils.getProcessOutputAndValue(self.gitbin,
                [command] + args, path=path, env=os.environ)

so maybe this is something different? Can you narrow it down?

comment:3 Changed 2 years ago by kclair

I tested it with a non-ssh based git location, and I did not receive the same error.

I will try with an ssh-based git location that's on the default ssh port.

Besides that, I'm not really sure how to narrow it down further. Can you offer any suggestions?

comment:4 Changed 2 years ago by dustin

One option is to set gitbin to something that will print out the environment it gets. If you're using SSH, is there an SSH agent involved?

comment:5 Changed 2 years ago by dustin

  • Milestone changed from undecided to ongoing

comment:6 Changed 2 years ago by mlevit

@kclair according to @ tomprince on buildbots IRC channel a fix that worked for me was to delete the gitpoller-workdir folder and then restart the master.

[09:57] <tomprince> Actually, the solution to that is probably to delete the poller directory.
[09:57] <tomprince> The release poller is somewhat fragile and prone to getting stuck.
[09:57] <tomprince> s/release/released/
[09:57] <tomprince> I've since rewritten it to be more resilient to errors.

comment:7 Changed 2 years ago by tom.prince

  • Resolution set to worksforme
  • Status changed from new to closed

This appears to be the usual "GitPoller? state is confused", and GitPoller? has be rewritten to be more resilient meanwhile, so closing.

comment:8 Changed 2 years ago by kclair

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Hi,

Sorry for the delay in response - I was travelling for a while.

Actually I did try deleting the poller directory, and that didn't fix it.

I will try to debug further with gitbin as suggested.

comment:9 Changed 2 years ago by tom.prince

Are the symptoms the same after deleting the poller directory? I would expect that you would at least get some other error when it tries re-cloning the remote repo.

comment:10 Changed 2 years ago by kclair

Actually, no, the error is not different.

I went back and looked through the logs, and the git poller had successfully cloned the example (pyflakes) repository. The first error I found using our repository, when the poller directory had not been deleted, is exactly the same as the error I see now (the same error I reported), when the poller directory is empty.

comment:11 Changed 2 years ago by kclair

Ach. I am not sure what I did previously to remove the poller directory, but if i make sure i remove the .git directory from the poller directory, everything seems fine.

sorry about the confusion!

comment:12 Changed 2 years ago by kclair

  • Resolution set to worksforme
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.