Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35340

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

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: git-plugin
    • Environment:
      Jenkins ver. 1651.2, Ubuntu 12.04, VirtualBox, Git-Plugin, Firefox
    • Similar Issues:

      Description

      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

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Freddy Paxton welcome to Jenkins. Glad to have you learning.

          We find it is much more effective for new user questions to be raised on the Jenkins mailing list rather than being raised as bug reports. Could you bring your questions to the mailing list so that you can have the benefit of help from many more people than just the maintainer of the git plugin?

          In your specific case, you may want to watch the screencast I created a few years ago called "Jenkins in Five Minutes".

          You may also want to consider learning about "ant" or "maven" or "gradle" as tools that can help you compile your software.

          Alternately, you could open a free Java integrated development environment (Netbeans is the one I use, others use Eclipse) and use it to create a project for your HelloWorld test.

          Show
          markewaite Mark Waite added a comment - Freddy Paxton welcome to Jenkins. Glad to have you learning. We find it is much more effective for new user questions to be raised on the Jenkins mailing list rather than being raised as bug reports. Could you bring your questions to the mailing list so that you can have the benefit of help from many more people than just the maintainer of the git plugin? In your specific case, you may want to watch the screencast I created a few years ago called "Jenkins in Five Minutes". You may also want to consider learning about "ant" or "maven" or "gradle" as tools that can help you compile your software. Alternately, you could open a free Java integrated development environment (Netbeans is the one I use, others use Eclipse) and use it to create a project for your HelloWorld test.
          Hide
          fep92 Freddy Paxton added a comment -

          Sorry Mark, I think I have now posted in the correct place. Is it the Google group for Jenkins Users?

          Show
          fep92 Freddy Paxton added a comment - Sorry Mark, I think I have now posted in the correct place. Is it the Google group for Jenkins Users?
          Hide
          markewaite Mark Waite added a comment -

          That was exactly the correct location, and I was very glad to see that someone already responded with answers to your questions. The Jenkins community tends to be very helpful to new users.

          Show
          markewaite Mark Waite added a comment - That was exactly the correct location, and I was very glad to see that someone already responded with answers to your questions. The Jenkins community tends to be very helpful to new users.

            People

            Assignee:
            markewaite Mark Waite
            Reporter:
            fep92 Freddy Paxton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: