Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

[build] SQLSTATE[HY000] [2002] Connection timed out

Dev1
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 3, 2025

Hello,

My YML file, but facing issue [build] SQLSTATE[HY000] [2002] Connection timed out :
Please explain why this happend.

image: quay.io/hypernode/deploy:3-php8.1-node18

pipelines:
  branches:
    staging:
      - step:
          name: Build
          script:
            - hypernode-deploy build -vvv
            - php deploy-static.php
          services:
          - mysql
          artifacts:
            - build/**
          caches:
            - composer

      - step:
          name: Deploy
          deployment: staging
          script:
            - mkdir -p ~/.ssh
            - echo "$SSH_PRIVATE_KEY" | base64 --decode > ~/.ssh/id_rsa
            - chmod 600 ~/.ssh/id_rsa
            - eval "$(ssh-agent -s)"
            - ssh-add ~/.ssh/id_rsa
            - ssh-keyscan [REDACTED]>> ~/.ssh/known_hosts
            - hypernode-deploy deploy staging -vvv
            - php deploy-static.php
definitions:
  services:
    mysql:
      image: mysql:5.7
      variables:
        MYSQL_DATABASE: [REDACTED]
        MYSQL_USER: [REDACTED]
        MYSQL_PASSWORD: [REDACTED]
        MYSQL_RANDOM_ROOT_PASSWORD: [REDACTED]

2 answers

1 vote
Jim Knepley - ReleaseTEAM
Atlassian Partner
July 3, 2025

Hi @Dev1. Welcome to the community.

"Connection timed out" means that the build runner tried to connect to a system (like a database) and didn't get a response. This is different from "Connection refused," which indicates the remote system actively rejecting the connection, usually because the service isn't running.

In my experience, your error is a network connectivity issue, often caused by a firewall or ACL between the runner and the database, or sometimes a misconfigured route between subnets.

Dev1
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 7, 2025

hypernode-systemctl whitelist add database 34.233.65.54 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.196.8.197 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 44.194.7.14 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.199.54.113 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.232.25.90 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.232.119.183 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.236.25.177 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 35.171.175.212 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 52.54.90.98 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 52.202.195.162 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 52.203.14.55 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 52.204.96.37 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.218.156.209 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.218.168.212 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 52.41.219.63 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 35.155.178.254 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 35.160.177.10 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.216.18.129 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 3.216.235.48 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 34.231.96.243 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 44.199.3.254 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 174.129.205.191 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 44.199.127.226 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 44.199.45.64 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 3.221.151.112 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 52.205.184.192 --description "Bitbucket Pipelines" &&
hypernode-systemctl whitelist add database 52.72.137.240 --description "Bitbucket Pipelines"

we have whitelists ips but getting same issue

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 7, 2025

Hi @Dev1 

If whitelisting does not resolve the issue, please raise a support ticket. You have a paid workspace and are entitled to support from our support team. A ticket is required for our engineers to access your workspace and check your YML/build logs/environment in detail:

Please let me know your timezone if you are having difficulties raising a ticket, and I will raise one on your behalf.

Cheers!

- Ben (Bitbucket Cloud Support)

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 6, 2025

Hi @Dev1 

I am echoing what Jim has commented on this post. The connection timing out implies that the remote database server you're trying to connect to may be blocking the connection. Please refer to our IP address documentation - particularly the "Valid IP addresses for Bitbucket Pipelines build environments" subheading and ensure these are whitelisted:

If you need further support, please raise a support ticket. You have a paid workspace and are entitled to support from our support team. A ticket is required for our engineers to access your workspace and check your YML/build logs/environment in detail:

Also - I redacted sensitive information, as this is a public forum and you have shared your remote database URL and its password publicly...

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events