hudson.plugins.git.GitException: Could not fetch from any repository

14,940

Solution 1

I have created the SSH key on hudson server and added it to my github account that solved my issue.

Solution 2

Try this:

  1. Go to the job's "Configure" page.

  2. Under Source Code ManagementGitAdditional Behaviors, add a behavior "Wipe out repository & force clone":

enter image description here

enter image description here

  1. Click on Save button.

  2. Try to Build again.

Share:
14,940
pbhle
Author by

pbhle

Updated on June 07, 2022

Comments

  • pbhle
    pbhle about 2 years

    I want to configure hudson+git and want to create a build. But I am getting following exception:

    Started by user nitish
    Checkout:workspace / /root/.hudson/jobs/NightlyGit/workspace - hudson.remoting.LocalChannel@dd7efd
    Using strategy: Default
    Checkout:workspace / /root/.hudson/jobs/NightlyGit/workspace - hudson.remoting.LocalChannel@dd7efd
    Fetching changes from the remote Git repository
    Fetching upstream changes from https://github.com/test/eng.git
    ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
    ERROR:  (Underlying report) : Error performing command: /usr/bin/git fetch -t https://github.com/test/eng.git +refs/heads/nightly:refs/remotes/origin/nightly
    Command "/usr/bin/git fetch -t https://github.com/test/engile.git +refs/heads/nightly:refs/remotes/origin/nightly" returned status code 128: error: The requested URL returned error: 401 while accessing https://github.com/test/eng.git/info/refs
    
    fatal: HTTP request failed
    
    ERROR: Could not fetch from any repository
    FATAL: Could not fetch from any repository
    hudson.plugins.git.GitException: Could not fetch from any repository
        at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:887)
        at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:845)
        at hudson.FilePath.act(FilePath.java:758)
        at hudson.FilePath.act(FilePath.java:740)
        at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:845)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:622)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1483)
        at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:507)
        at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
        at hudson.model.Run.run(Run.java:1366)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:145)
    

    I am newbie to the git ,I dont know what is the exact problem is there any creadentials required while using git with hudson?. Right now I have created the hudson job and providing the git repository link but it throws above exception. can somebody help me to sort out this issue.

    • Steve
      Steve over 11 years
      What version of hudson and the git plugin are you using?
    • pbhle
      pbhle over 11 years
      Hudson git plugin is 2.2.0 and hudson version is 2.3.6
    • pbhle
      pbhle over 11 years
      I am following the link stackoverflow.com/questions/3516719/hudson-git-error-ssh but don't understand Log in as the user running hudson