Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should automatically shutdown the Default MySQL before setup a MySQL #2

Open
fbjork opened this issue Sep 27, 2019 · 7 comments
Open
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@fbjork
Copy link

fbjork commented Sep 27, 2019

I get this error when I try to setup a mysql instance in my Actions workflow. Any idea what I'm doing wrong?

docker: Error response from daemon: driver failed programming external connectivity on endpoint busy_mcnulty (e90f9b113c26a0772d43fe413b6c5755204a5459a16817a6ff398ca003a859ee): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use.

Here's my workflow:

jobs:
  ruby:
    name: Ruby Tests
    runs-on: ubuntu-latest
    steps:
      - uses: zhulik/redis-action@v1.0.0
        with:
          redis version: "4"

      - uses: mirromutth/mysql-action@v1.1
        with:
          mysql version: "5.7.17"
          mysql root password: "test"

      - uses: actions/checkout@v1.0.0

      - name: Setup Ruby
        uses: actions/setup-ruby@v1.0.0
        with:
          ruby-version: 2.5.5

      - name: Install Dependencies
        run: bundle install

      - name: Setup Database
        env:
          RAILS_ENV: test
          DATABASE_URL: mysql2://root:test@127.0.0.1/test
        run: bundle exec rake db:create db:schema:load --trace

      - name: Run Tests
        env:
          RAILS_ENV: test
          DATABASE_URL: mysql2://root:test@127.0.0.1/test
        run: bundle exec rspec
@sublayerio
Copy link

I got the same error when the host port was 3306. I changed both ports and it works for me.

mysql-action

@fbjork
Copy link
Author

fbjork commented Oct 1, 2019

@Keyflight Thanks. Curious why the default port doesn't work.

@mazzarito
Copy link

mazzarito commented Oct 3, 2019

@Keyflight @fbjork Just found this out: looks like mysql is already installed on ubuntu (version 5.7) with root user password "root". Actually quite a bit of software is available:

https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions#ubuntu-1804-lts

All you need to do is create your database like so:

    - name: Create DB
      run: mysql -uroot -proot -e "CREATE DATABASE dbname;"

@mirromutth mirromutth self-assigned this Oct 9, 2019
@mirromutth mirromutth added the bug Something isn't working label Oct 9, 2019
@mirromutth
Copy link
Owner

mirromutth commented Oct 9, 2019

Hi there,

Sorry for late reply.
Sounds like the host port 3306 has bound. It seems like MySQL was set-up twice or the port 3306 has been bound by other container.

@mirromutth
Copy link
Owner

mirromutth commented Oct 9, 2019

@mazzarito You're right, MySQL has been installed and started by ubuntu, so the port 3306 has been bound by default MySQL that is outer than Docker.

I will add a command try to stop the default MySQL of Ubuntu before set-up Docker MySQL.

@mirromutth mirromutth added help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Oct 10, 2019
@mirromutth
Copy link
Owner

mirromutth commented Oct 10, 2019

For now, there is no built-in functionality to execute a command on the host before docker build (i.e., no "hooks" to trigger scripts on the host).

@fbjork @Keyflight So we should run a script by other Actions Step that will shutdown the Default MySQL before we set-up MySQL. Or just use the Default MySQL.

I have added its description to README, it is not a solution but it may be solve this problem.

Keep this issue, maybe we can fix this in future.

@mirromutth mirromutth added the help wanted Extra attention is needed label Oct 10, 2019
@mirromutth mirromutth changed the title Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use. Should automatically shutdown the Default MySQL before setup a MySQL Oct 10, 2019
@knowlet
Copy link

knowlet commented May 25, 2021

GitHub Actions Breaking Change:
Starting March 3rd, 2020, the Ubuntu virtual environments will no longer start the MySQL service automatically.

actions/runner-images#375

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants