Hi, community
WGET (Apache resources)
In a bitbucket pipeline, I have defined some simple bash for getting Apache Ant resources and I frequently got a connection timeout. The following snippet is the result of Wget when it timeouts:
<span>--2021-11-29 11:46:30-- <a href="https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.8-bin.tar.gz" rel="noopener nofollow noreferrer" target="_blank">https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.8-bin.tar.gz</a></span>
<span>Resolving <a href="http://archive.apache.org/" rel="noopener nofollow noreferrer" target="_blank">archive.apache.org</a> (<a href="http://archive.apache.org/" rel="noopener nofollow noreferrer" target="_blank">archive.apache.org</a>)... 138.201.131.134, 2a01:4f8:172:2ec5::2</span>
<span>Connecting to <a href="http://archive.apache.org/" rel="noopener nofollow noreferrer" target="_blank">archive.apache.org</a> (<a href="http://archive.apache.org/" rel="noopener nofollow noreferrer" target="_blank">archive.apache.org</a>)|138.201.131.134|:443... failed: Connection timed out.</span>
<code><span>Connecting to <a href="http://archive.apache.org/" rel="noopener nofollow noreferrer" target="_blank">archive.apache.org</a> (<a href="http://archive.apache.org/" rel="noopener nofollow noreferrer" target="_blank">archive.apache.org</a>)|2a01:4f8:172:2ec5::2|:443... failed: Network is unreachable.</span>
<span>I provide the single step to simulate the error (used image:amazoncorretto:11)</span>
if [[ ! -d /opt/apache-ant-1.10.8 || ! -f /opt/apache-ant-1.10.8/bin/ant ]]; then
echo "Ant directory not exists!"
wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.8-bin.tar.gz
tar -xzf apache-ant-1.10.8-bin.tar.gz -C /opt
fi
Temporary solution: I restart the pipeline until a Wget success.
Note: On my localhost, I never experienced this type of error for reaching Apache. Is docker introducing a TLS problem or other issues? Is there a way to fix this connectivity problem?