Issue
I did spend an hour to find solution for my issue but I was not able to. I'm using Jenkins to make some tests and in future deploy my project to AWS.
Right now my configuration in Jenkins for git looks fine. I have link to my github repo. But When I'm using "Build now" and actually succesfully building job, but when i'm checking logs it showing me this:
Started by user unknown or anonymous
Running as SYSTEM
Building in workspace C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\test_git
The recommended git tool is: NONE
using credential MyGit
Cloning the remote Git repository
Cloning repository https://github.com/NeoVic2006/Summit_project
> git.exe init C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\test_git # timeout=10
Fetching upstream changes from https://github.com/NeoVic2006/Summit_project
> git.exe --version # timeout=10
> git --version # 'git version 2.32.0.windows.2'
using GIT_ASKPASS to set credentials
> git.exe fetch --tags --force --progress -- https://github.com/NeoVic2006/Summit_project +refs/heads/*:refs/remotes/origin/* # timeout=10
> git.exe config remote.origin.url https://github.com/NeoVic2006/Summit_project # timeout=10
> git.exe config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
> git.exe rev-parse "refs/remotes/origin/main^{commit}" # timeout=10
Checking out Revision bb6a87a950e251b83d44296b0d230317ec43056c (refs/remotes/origin/main)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f bb6a87a950e251b83d44296b0d230317ec43056c # timeout=10
ERROR: Unable to retrieve commit message
org.eclipse.jgit.errors.MissingObjectException: Missing unknown bb6a87a950e251b83d44296b0d230317ec43056c
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:135)
at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:212)
at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:1065)
at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:975)
at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:86)
at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1397)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1363)
at hudson.scm.SCM.checkout(SCM.java:505)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1211)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:636)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:508)
at hudson.model.Run.execute(Run.java:1906)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
> git.exe rev-list --no-walk bb6a87a950e251b83d44296b0d230317ec43056c # timeout=10
[test_git] $ cmd.exe /c call C:\Windows\TEMP\shiningpanda2252295568321242739.bat
C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\test_git>python --version
Python 3.9.7
C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\test_git>exit 0
Finished: SUCCESS
I have this error "ERROR: Unable to retrieve commit message" and I don't have any files in Workspace.
I did try to reinstall jenkins, I did try to push fresh Commit to github but still same error.
Any ideas how to solve it?
Please be specific and if you will decide to give me link to another Stackoverflow questions MAKE SURE it will be SAME question.
Thank you, Sergey
Solution
I found solution. The issue was with root folders for Jenkins. And also I'm suspecting that some projects in Jenkins were not working properly after I reinstall Jenkins. So what I did is Remove ALL Jenkins files from PC and reinstall it from scratch:
how to remove completly from PC:
Open Windows Control Panel and click Programs and Features
Right-click Jenkins x.xxx.x (where x.xxx.x, is the Jenkins version), and select Uninstall.
Follow the directions.
When done, delete the following folders: (note: DO NOT remove the jenkins.jenkins or jenkinswar folders if you want to keep the projects and plugins.)
C:\Program Files\Jenkins or C:\Program Files(x86)\Jenkins
C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins
C:\Windows\System32\config\systemprofile\AppData\Local\Jenkinswar
Restart the computer.
After that I did recreate my projects in Jenkins and everything working great now.
Answered By - Sergey