Hi, I'm working in a notification app and I'm trying to add a notification when pipelines starts and finish. I tried to execute a curl in a after-script step and it throws me the following error error:
"curl: (56) Recv failure: Connection reset by peer"
When I execute the same curl inside the step, in other step after-script or even if that step fails the curl works just fine. The problem whit this curl is only when the script runs correctly.
This is my after script code:
after-script:
- echo $BITBUCKET_EXIT_CODE
- if [ $BITBUCKET_EXIT_CODE == 0 ]; then export TAG="success"; else export TAG="failed"; fi
- curl -d "{\"app\":\"notification_app\",\"title\":\"$BITBUCKET_REPO_FULL_NAME\",\"author\":\"bitbucket\",\"content\":\"deployment finished\",\"tag\":\"$TAG\",\"link\":\"https://bitbucket.org/$BITBUCKET_REPO_FULL_NAME/addon/pipelines/home#!/results/$BITBUCKET_BUILD_NUMBER\",\"type\":\"deploy\",\"filters\":[\"deploy\",\"EAP\"]}" -H "Content-Type:application/json" -X POST http://$URL/api/v1/notifications
- echo 'Pipeline Finished'
Hi @Tomas
Welcome to the community.
Based on the Curl command response, it seems the endpoint you used is unreachable from the Pipelines container when you run it.
For this, you could try to run the Curl command with verbose loggings by adding the "-v".
This is for you to get more information about the "Connection reset by peer" error.
curl -d -v .....
Let me know how it goes.
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.