Level-4 "Jenkins MR Jobs" --- Validation Issue

Hi Team, I have completed the task as per requirement, You can see below getting expected outcome as well…

image

still I am getting below error —

  • pipeline job ‘nginx-container’ is not configured to build and deploy the ‘nginx-app’ app.
    ERROR test_MR.py - AssertionError: - pipeline job ‘nginx-container’ is not co…

Which is not correct at all, I can see nginx-app container is running on stapp03, and it is accessible as well on port 8080.

I am pasting my pipeline script below @mumshadgmail @Tej-Singh-Rana please help me out…

pipeline {
agent any
stages {
stage(‘Build’) {
steps {
sh ‘’’

            sshpass -p BigGr33n ssh -o StrictHostKeyChecking=no banner@stapp03 \
            'git clone http://git.stratos.xfusioncorp.com/sarah/mr_job.git ; cd mr_job; \
             docker build -t stregi01.stratos.xfusioncorp.com:5000/nginx:latest .; \
             docker push stregi01.stratos.xfusioncorp.com:5000/nginx:latest'
            
            '''
        }
    }
    stage('Deploy') {
        steps {
            sh '''
            
            sshpass -p BigGr33n ssh -o StrictHostKeyChecking=no banner@stapp03 \
            'docker stop nginx-app; \
             docker rm nginx-app; \
             docker run -d --name nginx-app -p 8080:80 stregi01.stratos.xfusioncorp.com:5000/nginx:latest'
            
            '''
        }
    }
}

}

@inderpreetaps can you please look into this

@awantika-kodekloud can you please check if there is something wrong with validation

When I am using app server03 as agent I am not able to build docker image…
getting below error

ERROR: failed to solve: using mount program fuse-overlayfs: unknown argument ignored: lazytime
/proc seems to be mounted as readonly, it can lead to unexpected failuresfuse: device not found, try ‘modprobe fuse’ first
fuse-overlayfs: cannot mount: No such file or directory
: exit status 1

Hi @Dhirendra-Vats,
Sorry for the delayed response. I have forwarded your issue to the KKE team.

Regards,

Thanks @Tej-Singh-Rana please let me know if you get any update on this, so that I can retry the task.

Hi @Dhirendra-Vats,
The team pushed some fixes. Can you please try again? and share your feedback.

Regards,

#6 [2/2] COPY index.html /usr/share/nginx/html/
#6 ERROR: using mount program fuse-overlayfs: unknown argument ignored: lazytime
/proc seems to be mounted as readonly, it can lead to unexpected failuresfuse: device not found, try ‘modprobe fuse’ first
fuse-overlayfs: cannot mount: No such file or directory
: exit status 1

[2/2] COPY index.html /usr/share/nginx/html/:


Dockerfile:2

1 | FROM nginx:stable-alpine3.17-slim
2 | >>> COPY index.html /usr/share/nginx/html/

ERROR: failed to solve: using mount program fuse-overlayfs: unknown argument ignored: lazytime
/proc seems to be mounted as readonly, it can lead to unexpected failuresfuse: device not found, try ‘modprobe fuse’ first
fuse-overlayfs: cannot mount: No such file or directory
: exit status 1

@Tej-Singh-Rana still not able to build docker image getting the same error NOTE: I am using App Server 03 as jenkins build agent.

@Tej-Singh-Rana Any, Update… can you try to complete this perticular TASK, Whether you are able to do it on not.

Hi @Dhirendra-Vats,
The team has checked from their end and it’s working for them. Can you please try again?

Hi @Tej-Singh-Rana first I tried with this approach only, You can see my pipleine in the very first message and I was able to build and run image as well as container on stapp03.
but validation got failed. As in the Task it is mentioned that run pipeline on stapp03.

So I have used stapp03 as jenkins agent, and then I am getting error.

Below is my pipeline…

please ask the team try to complete the TASK, if you just build image using sshpass you will be able to do it, i tried that.

pipeline {
agent {
label ‘stapp03’
}
stages {
stage(‘Build’) {
steps {
sh ‘’’
rm -rf /home/banner/workspace/nginx-container/mr_job

           git clone http://git.stratos.xfusioncorp.com/sarah/mr_job.git
           
           cd mr_job
           
           docker build -t stregi01.stratos.xfusioncorp.com:5000/nginx:latest .
           
           docker push stregi01.stratos.xfusioncorp.com:5000/nginx:latest
           
           '''
        }
    }
    stage('Deploy') {
        steps {
            sh '''
            
            docker stop nginx-app
            
            docker rm nginx-app
            
            docker run -d --name nginx-app -p 8080:80 stregi01.stratos.xfusioncorp.com:5000/nginx:latest
            
            '''
        }
    }
}

}

Hi @Dhirendra-Vats

We tried using both methods sshpass (as sent earlier) and build agent method as below:

It seems to be working fine with both methods, can you please try this task again and record your solution, the screen recording would be really helpful for us to troubleshoot this issue.

Ok I will check, By the way are you also using any plugin for docker … as I have not used…

Completed the TASK using same pipeline, there must be some issue before which is fixed now. Thanks team kodekloud…

The same issue exists in another lab: Jenkins Level3 - task Jenkins Build Images

1 Like