ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

3,967 views
Skip to first unread message

Freddy Paxton

unread,
Jun 3, 2016, 2:43:46 PM6/3/16
to Jenkins Users

I'm new to Jenkins, Ubuntu and Git so the answer to this is probably something I've missed out!

What I want to do is set up a Git repository in which 2 Java files are located (HelloWorld.java and HelloWorldErr.java - HelloWorldErr is missing an ; ). This is to test the Jenkins build and test system to see if it can successfully compile the HelloWorld.java file and run it, and also discover the error in HelloWorldErr.java. It's a pretty simple test but I'm having trouble getting it working.

After finally managing to set up the repository correctly, I now get an error saying:
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

After scouting the internet for tutorials and/or anyone with similar problems I'm still looking for a solution. Even an explanation of the process would probably help me a lot.

My repository is located at /var/lib/jenkins/repo/test_repo.git/ and the 2 Java files are in there. I left the branch specifier as */master as I do not know what this does.

In my Execute shell command I have:

javac HelloWorld.java
java HelloWorld
Obviously this means that it is not looking at HelloWorldErr.java but for now I just want the build to run successfully.

Sorry if I haven't explained myself very well. Once I get this working I am also planning to test running files through GitHub but I do not want to start on that before I can get the local Git working correctly.

Thanks in advance! Any insight on this is going to really help me with my project.

If it helps here is the console output with branch set to */master...
Building in workspace /var/lib/jenkins/jobs/HelloWorld/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url file:///var/lib/jenkins/repo/test_repo.git # timeout=10
Fetching upstream changes from file:///var/lib/jenkins/repo/test_repo.git
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress file:///var/lib/jenkins/repo/test_repo.git +refs/heads/:refs/remotes/origin/
> git rev-parse refs/remotes/origin/master^

{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit}

# timeout=10
> git rev-parse origin/master^

{commit}

# timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

And here is the output when I leave branch blank...
Building in workspace /var/lib/jenkins/jobs/HelloWorld/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url file:///var/lib/jenkins/repo/test_repo.git # timeout=10
Fetching upstream changes from file:///var/lib/jenkins/repo/test_repo.git
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress file:///var/lib/jenkins/repo/test_repo.git +refs/heads/:refs/remotes/origin/
Seen 0 remote branches
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

Thomas Zoratto

unread,
Jun 3, 2016, 3:23:10 PM6/3/16
to jenkins...@googlegroups.com
Hi, 

Did you commit your changes in your repo ? 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/911c209e-58d8-4cca-9077-43f00d37402d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Freddy Paxton

unread,
Jun 3, 2016, 4:00:37 PM6/3/16
to Jenkins Users
How do I go about doing this?

Thomas Zoratto

unread,
Jun 3, 2016, 4:07:36 PM6/3/16
to jenkins...@googlegroups.com
cd /path/to/your/repo

git add --all
git commit -m "your commit message"

I encourage you to go through a git tutorial to learn the basics.

Thomas

Freddy Paxton

unread,
Jun 3, 2016, 4:16:19 PM6/3/16
to Jenkins Users
Thank you, I have been trying to use tutorials but because I'm already half way through the process it's hard to see what I have missed or what I have setup incorrectly.
Just for clarification, do my java files need to be in the /var/lib/jenkins/repo folder or the /var/lib/jenkins/repo/test_repo.git folder? Originally I was trying to use the test_repo.git folder for all of this, I think this is mainly where I have been going wrong.

Thomas Zoratto

unread,
Jun 3, 2016, 4:23:09 PM6/3/16
to jenkins...@googlegroups.com
you need to do something like that : 

mkdir my-repo
cd my-repo
git init
cp /path/to/a/file ./
git add --all
git commit -m "your commit message"

then you specify the path to this repo in a Jenkins job et voilà !

Reply all
Reply to author
Forward
0 new messages