I have created a pipeline with 3 stages. I am storing the each pipeline stage status in “build.env” file.
While executing the pipeline, the build stage script successfully executed but when gitlab tried to upload the “dotenv” artifact that time it fails intermittently with TLS handshake error.
Below is the sample pipeline script.
stages:
- download
- build
- test
download:
stage: download
script:
- echo "===== Download starts ====="
- echo "===== Download Ends ====="
after_script:
# Preserve a job status 'success or failed' into artifacts.
- >
if [ $CI_JOB_STATUS == 'success' ]; then
echo "DOWNLOAD_JOB_STATUS=success" >> build.env
else
echo "DOWNLOAD_JOB_STATUS=failed" >> build.env
fi
tags:
- linux
artifacts:
reports:
dotenv: build.env
build:
stage: build
script:
- echo "===== Build starts ====="
- echo "===== Build Ends ====="
after_script:
# Preserve a job status 'success or failed' into artifacts.
- >
if [ $CI_JOB_STATUS == 'success' ]; then
echo "BUILD_JOB_STATUS=success" >> build.env
else
echo "BUILD_JOB_STATUS=failed" >> build.env
fi
tags:
- linux
artifacts:
reports:
dotenv: build.env
test:
stage: test
script:
- echo "===== Test starts ====="
- echo "===== Test Ends ====="
after_script:
# Preserve a job status 'success or failed' into artifacts.
- >
if [ $CI_JOB_STATUS == 'success' ]; then
echo "TEST_JOB_STATUS=success" >> build.env
else
echo "TEST_JOB_STATUS=failed" >> build.env
fi
tags:
- linux
artifacts:
reports:
dotenv: build.env
Error Message:
ERROR: Uploading artifacts as “dotenv” to coordinator… error
error=couldn’t execute POST against
https://gitlab.abc.com/api/v4/jobs/12345/artifacts?artifact_format=gzip&artifact_type=dotenv:
Post
“https://gitlab.abc.com/api/v4/jobs/12345/artifacts?artifact_format=gzip&artifact_type=dotenv”:
net/http: TLS handshake timeout id=12345 token=XXXXXX
How I can fix this issue?