My bitbucket-pipelines.yml script was working fine a couple of commits ago. Now, I see the following error. Please find attached a screenshot of the same.
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)
Attaching my bitbucket-pipelines.yml as well.
I checked the forum and tried a recommended solution to move the - services section above the -script section. But it didn't work, either.
Any help would be appreciated.
Thanks
Dipankar
Hi Dipankar,
One limitation of Bitbucket Pipelines is that there is no mechanism to wait for service startup. The build may be failing because the mysql service hasn't started yet.
I tried running a build with a bitbucket-pipelines.yml file similar to yours and I got the same error. Adding a sleep command for 5 seconds:
- sleep 5
before the mysql command solved the issue for me. Could you give it a try and let me know if it works?
We have a request in our issue tracker to have the build wait until all services are ready:
You can add your vote (by selecting the Vote for this issue link) and feedback to it if you'd be interested in that.
Kind regards,
Theodora
It really did resolve my issue. You're awesome @Theodora Boudale ! Appreciate the prompt response and registering the issue in the backlog.
Thanks
Dipankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's good to hear Dipankar and you are very welcome!
Please feel free to reach out if you ever need anything else!
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.