Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,112
Community Members
 
Community Events
176
Community Groups

Curl error in after-script

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"

bitbucket1.png

 

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'

 

1 answer

0 votes
Mark C Atlassian Team Feb 17, 2022

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

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events