rahul
rahul

Reputation: 3

getting curl: (52) Empty reply from server when run from jenkins job (only an issue with the job that i used docker run )

I have seemed to run into some issues with curl, I have created a freestyle Jenkins job to build and deploy a basic hello world docker image. The build and deployment work fine, but I ran a curl command to test the deployment and it always fails the job

below is the script that I ran

npm install docker build -t rvarg11/helloworld2 . docker rm -f dockertest docker run -d -p 3000:3000 --name dockertest rvarg11/helloworld2 curl -f http://127.0.0.1:3000

the jobs fail with the below error when Jenkins reach the curl command

this is only an issue when I try curl from the same job that I used for build , if I create a separate job and try to curl it works without any issues I am new to all this and this is the first time I am posting a question hope I have explained everything properly enter image description here

enter image description here

Upvotes: 0

Views: 1227

Answers (1)

pradosh nair
pradosh nair

Reputation: 945

Since it is working fine from another Jenkins job, it is because there is a time delay for Jenkins executor to pick up the next job by which time the application is ready to accept request causing the subsequent job to be success. An appropriate delay in the current job before making the curl request should solve the problem.

Upvotes: 1

Related Questions