Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins job notification fails with "No git consumers for URI ..."

Tags:

git

curl

jenkins

I want to set up a post-receive git hook that notify jenkins about the change, but no job is triggered in jenkins.

My post-receive hook looks like this:

curl http://localhost/jenkins/git/notifyCommit?url=<git_repository_url> 

If I issue the command in terminal, I get the following message:

"No git consumers for URI..." 

I have a jenkins job that connected to Git Source Code Management, repository URL is given as well as branches: */master

I've searched for this problem, but I've found nothing useful related to: "No git consumers for URI"

I use:

  • LinuxMint
  • Apache 2.4.6
  • git 1.8.3.2
  • curl 7.32.0
  • Jenkins 1.532.2

I have a proxy setup in apache:

<Proxy *>     Order deny,allow     deny from all    allow from 127.0.0.1 </Proxy> 

The git repository is bare.

like image 652
Quirin Avatar asked Apr 10 '14 22:04

Quirin


2 Answers

Enable SCM polling for each project you want to notify:

  1. Go to the Dashboard.
  2. Click on your project.
  3. Click Configure.
  4. Under Build Triggers check the box for Poll SCM.
  5. Repeat for any other projects.

The notification you send tells Jenkins to poll the repository, so projects will only respond if SCM polling is enabled.

like image 121
idontevenseethecode Avatar answered Sep 19 '22 09:09

idontevenseethecode


The message No git consumers for URI always shows up, you should be worried if you see No git jobs using repository. The response will contain a list of jobs scheduled for polling, so as long as you see them, the polling was triggered.

That said you might want to check that polling is actually doing something. If you go into a job configured with Git, you can see a link to the Git Polling Log on the left. In there you'll be able to see if the trigger actually did anything and, more crucially, if there was an error.

I had an issue similar to this, and it took me a while to figure out that my Git was misconfigured. My job will build fine when manually triggered, but the polling trigger would use a different path to the Git binary and fail. I ended up having to define the Git path to fix my issue.

like image 39
monitorjbl Avatar answered Sep 19 '22 09:09

monitorjbl