dockerkubernetesjenkinsnfs

Jenkins docker build with NFS pv hangs


I have a jenkins pod running on minikube. This pod uses NFS persistent volume with Winnfsd server and is working fine. In my jenkins pipeline I can clone my github repository, but when execute docker build command it hangs and after 3 or 4 minutes this error is thrown:

[Pipeline] sh
docker build . -t localhost/myapp:1.0.1 --build-arg HOSTNAME=my.ingress.host
ERROR: input/output error
groovy.lang.MissingPropertyException: No such property: exc for class: groovy.lang.Binding
at groovy.lang.Binding.getVariable(Binding.java:63)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:285)
at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:375)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:379)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:355)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
at WorkflowScript.run(WorkflowScript:117)
at ___cps.transform___(Native Method)

Any ideas about how to solve this issue?

Jenkins version: 2.387.2

minikube version: 1.28.0

WinNFSd version: 2.4.0

P.D. When using standard pvc on jenkins pod the docker build command works as expected


Solution

  • It seems that Winnfsd server does not have support for NLM protocol as stated in this post:

    General error: 10 disk I/O error

    So basically what I did was to add nolock to mountOptions in pv:

    apiVersion: v1
    kind: PersistentVolume
    spec:
       ...
      mountOptions:
           - nolock
           - nfsvers=3

    After that the Jenkins pipeline worked as expected!