Search code examples
jenkinsbuildyamlgithub-actions

Build failed after triggering the Jenkins through GitHub Actions


Getting the below Error and build job failed when I am triggering the Jenkins build through the GitHub Actions via .yml file, but in GitHub Actions the Action is passed GitHub Action Result for trigger_jenkins_build.yml)

Jenkins build job Error:

Started by user Subbaramaiah Chevuru
Running as SYSTEM
Building remotely on Node_for_C in workspace /home/subbaramaiah_ch/Jenkins/workspace/subbu_project
The recommended git tool is: NONE
using credential github
 > git rev-parse --resolve-git-dir /home/subbaramaiah_ch/Jenkins/workspace/subbu_project/.git # timeout=10
Fetching changes from the remote Git repository
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 192.168.241.134/192.168.241.134:47184
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1826)
        at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
        at hudson.remoting.Channel.call(Channel.java:1042)
        at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:285)
        at PluginClassLoader for git-client//com.sun.proxy.$Proxy110.withRepository(Unknown Source)
        at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.RemoteGitImpl.withRepository(RemoteGitImpl.java:261)
        at PluginClassLoader for git//jenkins.plugins.git.GitHooksConfiguration.configure(GitHooksConfiguration.java:112)
        at PluginClassLoader for git//jenkins.plugins.git.GitHooksConfiguration.configure(GitHooksConfiguration.java:102)
        at PluginClassLoader for git//jenkins.plugins.git.GitHooksConfiguration.configure(GitHooksConfiguration.java:91)
        at PluginClassLoader for git//hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1231)
        at PluginClassLoader for git//hudson.plugins.git.GitSCM._checkout(GitSCM.java:1310)
        at PluginClassLoader for git//hudson.plugins.git.GitSCM.checkout(GitSCM.java:1277)
        at hudson.scm.SCM.checkout(SCM.java:540)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1247)
        at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649)
        at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:521)
        at hudson.model.Run.execute(Run.java:1894)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
        at hudson.model.ResourceController.execute(ResourceController.java:101)
        at hudson.model.Executor.run(Executor.java:446)
java.nio.file.AccessDeniedException: /home/subbaramaiah_ch/Jenkins/workspace/subbu_project/.git/config.lock
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:371)
    at java.base/java.nio.file.Files.createFile(Files.java:648)
    at PluginClassLoader for git-client//org.eclipse.jgit.util.FS_POSIX.createNewFileAtomic(FS_POSIX.java:442)
    at PluginClassLoader for git-client//org.eclipse.jgit.internal.storage.file.LockFile.lock(LockFile.java:146)
    at PluginClassLoader for git-client//org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:201)
    at PluginClassLoader for git//jenkins.plugins.git.GitHooksConfiguration.disable(GitHooksConfiguration.java:139)
    at PluginClassLoader for git//jenkins.plugins.git.GitHooksConfiguration.lambda$configure$2f1f6402$1(GitHooksConfiguration.java:113)
    at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:28)
    at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:83)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:924)
    at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:902)
    at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:853)
    at hudson.remoting.UserRequest.perform(UserRequest.java:211)
    at hudson.remoting.UserRequest.perform(UserRequest.java:54)
    at hudson.remoting.Request$2.run(Request.java:377)
    at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:140)
    at java.base/java.lang.Thread.run(Thread.java:829)
Archiving artifacts
Finished: FAILURE

And the trigger.yml file is in trigger_jenkins_build.yml

I have cross verified the permissions of the workspace, Jenkins and Git plug-ins, but I am unable to solve the above Error.


Solution

  • This is the actual error:

    java.nio.file.AccessDeniedException: /home/subbaramaiah_ch/Jenkins/workspace/subbu_project/.git/config.lock
    

    Try deleting the file and re-run.