Coder Social home page Coder Social logo

actions-setup-mysql's People

Contributors

cromfr avatar dependabot[bot] avatar github-actions[bot] avatar shogo82148 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

actions-setup-mysql's Issues

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Hi,

I'm having an error every time in my workflow. I don't understand why since it works locally with Act. Can you help me, please?

     - name: Setup MySQL
        uses: shogo82148/[email protected]
        with:
          auto-start: true
          distribution: 'mysql'
          mysql-version: '8.0'
          my-conf: |
            default-authentication-plugin=mysql_native_password
            sync_binlog=0
            innodb_doublewrite=OFF
            innodb-flush-log-at-trx-commit=0
            innodb-flush-method=nosync
          user: ${{ secrets.MYSQL_USER }}
          root-password: ${{ secrets.MYSQL_PASSWORD }}
          password: ${{ secrets.MYSQL_PASSWORD }}

      - name: Create database
        run: mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS ${{ secrets.MYSQL_DB_NAME }};'
Run mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS test;'
Warning: ning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

MariaDB 10.10.2 installation fails

https://github.com/shogo82148/actions-setup-mysql/actions/runs/3424387262/jobs/5704005846

2022-11-09T00:45:20.1191767Z [command]/opt/hostedtoolcache/mariadb/10.10.2/x64/scripts/mysql_install_db --defaults-file=/tmp/actions-setup-mysql-8sehcE/etc/my.cnf --basedir=/opt/hostedtoolcache/mariadb/10.10.2/x64 --auth-root-authentication-method=normal
2022-11-09T00:45:20.1337832Z Installing MariaDB/MySQL system tables in '/tmp/actions-setup-mysql-8sehcE/var' ...
2022-11-09T00:45:20.2523961Z 2022-11-09  0:45:20 0 [ERROR] Failed to setup SSL
2022-11-09T00:45:20.2525046Z 2022-11-09  0:45:20 0 [ERROR] SSL error: SSL_CTX_set_default_verify_paths failed
2022-11-09T00:45:20.2525803Z 2022-11-09  0:45:20 0 [ERROR] Aborting
2022-11-09T00:45:20.5106844Z 
2022-11-09T00:45:20.5107654Z Installation of system tables failed!  Examine the logs in
2022-11-09T00:45:20.5108621Z /tmp/actions-setup-mysql-8sehcE/var for more information.
2022-11-09T00:45:20.5165251Z 
2022-11-09T00:45:20.5167614Z The problem could be conflicting information in an external
2022-11-09T00:45:20.5168120Z my.cnf files. You can ignore these by doing:
2022-11-09T00:45:20.5168631Z 
2022-11-09T00:45:20.5169289Z     shell> /opt/hostedtoolcache/mariadb/10.10.2/x64/scripts/mysql_install_db --defaults-file=~/.my.cnf
2022-11-09T00:45:20.5169570Z 
2022-11-09T00:45:20.5169839Z You can also try to start the mysqld daemon with:
2022-11-09T00:45:20.5170039Z 
2022-11-09T00:45:20.5170541Z     shell> /opt/hostedtoolcache/mariadb/10.10.2/x64/bin/mariadbd --skip-grant-tables --general-log &
2022-11-09T00:45:20.5170816Z 
2022-11-09T00:45:20.5171187Z and use the command line tool /opt/hostedtoolcache/mariadb/10.10.2/x64/bin/mariadb
2022-11-09T00:45:20.5171740Z to connect to the mysql database and look at the grant tables:
2022-11-09T00:45:20.5171952Z 
2022-11-09T00:45:20.5172349Z     shell> /opt/hostedtoolcache/mariadb/10.10.2/x64/bin/mysql -u root mysql
2022-11-09T00:45:20.5172703Z     mysql> show tables;
2022-11-09T00:45:20.5172860Z 
2022-11-09T00:45:20.5173238Z Try 'mysqld --help' if you have problems with paths.  Using
2022-11-09T00:45:20.5173969Z --general-log gives you a log in /tmp/actions-setup-mysql-8sehcE/var that may be helpful.
2022-11-09T00:45:20.5174265Z 
2022-11-09T00:45:20.5174669Z The latest information about mysql_install_db is available at
2022-11-09T00:45:20.5175287Z https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
2022-11-09T00:45:20.5175938Z You can find the latest source at https://downloads.mariadb.org and
2022-11-09T00:45:20.5176757Z the maria-discuss email list at https://launchpad.net/~maria-discuss
2022-11-09T00:45:20.5177003Z 
2022-11-09T00:45:20.5177292Z Please check all of the above before submitting a bug report
2022-11-09T00:45:20.5177672Z at https://mariadb.org/jira
2022-11-09T00:45:20.5177848Z 

Tar: no such file or directory

Previously set up action cannot untar downloaded archive. It worked a week ago.
Tried to use previous versions, but did not succeed. Tried 1.10, 1.9, 1.8.
Runs on self-hosted.

Run shogo82148/[email protected]
  with:
    distribution: mariadb
    mysql-version: 10.4
    root-password: mypass
    auto-start: true
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    CACHE_RESTORE_KEY: Linux-php-8.0.19-composer---ignore-platform-reqs---no-scripts-locked-
    ImageOS: ubuntu
install MySQL
  downloading from https://github.com/shogo82148/actions-setup-mysql/releases/download/v1.7.0/mariadb-10.4.2-linux-x64.tar.zstd
  /usr/bin/tar --use-compress-program zstd -d --long=30 -x --warning=no-unknown-keyword --overwrite -C /docker/machines/actions-runner/_work/_temp/82221b9-0882-4772-8230-aab8d1f1b7a9 -f /docker/machines/actions-runner/_work/_temp/994298b2-fcf9-44f-ae7e-55fb520772
  tar (child): zstd -d --long=30: Cannot exec: No such file or directory
  tar (child): Error is not recoverable: exiting now
  /usr/bin/tar: Child returned status 2
  /usr/bin/tar: Error is not recoverable: exiting now
Error: The process '/usr/bin/tar' failed with exit code 2

Action Fails to Launch MySQL in nektos/act

Log Output

╰─ act --rm
[Rails/test] πŸš€  Start image=ghcr.io/catthehacker/ubuntu:act-2***.***4
[Rails/test]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-2***.***4 platform= username= forcePull=false
[Rails/test]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-2***.***4 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Rails/test]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-2***.***4 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Rails/test]   ☁  git clone 'https://github.com/shogo82148/actions-setup-mysql' # ref=v1
[Rails/test] ⭐ Run Main Git checkout
[Rails/test]   🐳  docker cp src=/Users/mzagaja/Developer/identity.ted.com/. dst=/Users/mzagaja/Developer/identity.ted.com
[Rails/test]   βœ…  Success - Main Git checkout
[Rails/test] ⭐ Run Main Setup MySQL
[Rails/test]   🐳  docker cp src=/Users/mzagaja/.cache/act/shogo82148-actions-setup-mysql@v1/ dst=/var/run/act/actions/shogo82148-actions-setup-mysql@v1/
[Rails/test]   🐳  docker exec cmd=[node /var/run/act/actions/shogo82148-actions-setup-mysql@v1/lib/setup-mysql.js] user= workdir=
[Rails/test]   ❓  ::group::install MySQL
[Rails/test]   πŸ’¬  ::debug::isExplicit: 8.***.31
[Rails/test]   πŸ’¬  ::debug::explicit? true
[Rails/test]   πŸ’¬  ::debug::checking cache: /opt/hostedtoolcache/mysql/8.***.31/x64
[Rails/test]   πŸ’¬  ::debug::not found
| downloading from https://github.com/shogo82148/actions-setup-mysql/releases/download/v1.14.1/mysql-8.***.31-ubuntu-2***.***4-x64.tar.zstd
[Rails/test]   πŸ’¬  ::debug::Downloading https://github.com/shogo82148/actions-setup-mysql/releases/download/v1.14.1/mysql-8.***.31-ubuntu-2***.***4-x64.tar.zstd
[Rails/test]   πŸ’¬  ::debug::Destination /tmp/522d92d8-f73d-417f-a965-d87716d***5539
[Rails/test]   πŸ’¬  ::debug::download complete
[Rails/test]   πŸ’¬  ::debug::Checking tar --version
[Rails/test]   πŸ’¬  ::debug::tar (GNU tar) 1.3***%***ACopyright (C) 2***17 Free Software Foundation, Inc.%***ALicense GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.%***AThis is free software: you are free to change and redistribute it.%***AThere is NO WARRANTY, to the extent permitted by law.%***A%***AWritten by John Gilmore and Jay Fenlason.
| [command]/usr/bin/tar --use-compress-program zstd -d --long=3*** -x --warning=no-unknown-keyword --overwrite -C /tmp/6859***9ec-246b-4a96-bcc3-d7fb***c***da282 -f /tmp/522d92d8-f73d-417f-a965-d87716d***5539
[Rails/test]   πŸ’¬  ::debug::Caching tool mysql 8.***.31 x64
[Rails/test]   πŸ’¬  ::debug::source dir: /tmp/6859***9ec-246b-4a96-bcc3-d7fb***c***da282
[Rails/test]   πŸ’¬  ::debug::destination /opt/hostedtoolcache/mysql/8.***.31/x64
[Rails/test]   πŸ’¬  ::debug::finished caching tool
[Rails/test]   πŸ’¬  ::debug::MySQL tool is cached under /opt/hostedtoolcache/mysql/8.***.31/x64
[Rails/test]   ❓  ::endgroup::
[Rails/test]   ❓  ::group::setup MySQL Database
| creating the directory structure on /tmp/actions-setup-mysql-YE9ypD
| writing my.cnf
[Rails/test]   πŸ’¬  ::debug::my.cnf path is /tmp/actions-setup-mysql-YE9ypD/etc/my.cnf
[Rails/test]   πŸ’¬  ::debug::[client]%***Ahost="127.***.***.1"%***Aport="33***6"%***A%***A[mysqld]%***Adatadir="/tmp/actions-setup-mysql-YE9ypD/var"%***Alc-messages-dir="/opt/hostedtoolcache/mysql/8.***.31/x64/share"%***Apid-file="/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid"%***Aport="33***6"%***Asocket="/tmp/actions-setup-mysql-YE9ypD/tmp/mysql.sock"%***Atmpdir="/tmp/actions-setup-mysql-YE9ypD/tmp"%***A
[Rails/test]   πŸ’¬  ::debug::execute: /opt/hostedtoolcache/mysql/8.***.31/x64/bin/mysqld --no-defaults --verbose --help
[Rails/test]   πŸ’¬  ::debug::execute: /opt/hostedtoolcache/mysql/8.***.31/x64/bin/mysqld --defaults-file=/tmp/actions-setup-mysql-YE9ypD/etc/my.cnf --initialize-insecure
| [command]/opt/hostedtoolcache/mysql/8.***.31/x64/bin/mysqld --defaults-file=/tmp/actions-setup-mysql-YE9ypD/etc/my.cnf --initialize-insecure
| 2***22-12-19T22:41:14.2***2241Z *** [System] [MY-***13169] [Server] /opt/hostedtoolcache/mysql/8.***.31/x64/bin/mysqld (mysqld 8.***.31) initializing of server in progress as process 39
| 2***22-12-19T22:41:14.681198Z 1 [System] [MY-***13576] [InnoDB] InnoDB initialization has started.
| 2***22-12-19T22:41:15.***35282Z 1 [System] [MY-***13577] [InnoDB] InnoDB initialization has ended.
| 2***22-12-19T22:41:17.335616Z 6 [Warning] [MY-***1***453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
[Rails/test]   ❓  ::endgroup::
[Rails/test]   ❓  ::group::configure TLS/SSL
| add TLS/SSL setting into my.cnf
[Rails/test]   πŸ’¬  ::debug::my.cnf path is /tmp/actions-setup-mysql-YE9ypD/etc/my.cnf
[Rails/test]   πŸ’¬  ::debug::[client]%***Ahost="127.***.***.1"%***Aport="33***6"%***A%***A[mysqld]%***Adatadir="/tmp/actions-setup-mysql-YE9ypD/var"%***Alc-messages-dir="/opt/hostedtoolcache/mysql/8.***.31/x64/share"%***Apid-file="/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid"%***Aport="33***6"%***Asocket="/tmp/actions-setup-mysql-YE9ypD/tmp/mysql.sock"%***Assl_ca="/tmp/actions-setup-mysql-YE9ypD/var/ca.pem"%***Assl_cert="/tmp/actions-setup-mysql-YE9ypD/var/server-cert.pem"%***Assl_key="/tmp/actions-setup-mysql-YE9ypD/var/server-key.pem"%***Atmpdir="/tmp/actions-setup-mysql-YE9ypD/tmp"%***A
| [command]/opt/hostedtoolcache/mysql/8.***.31/x64/bin/openssl req -newkey rsa:2***48 -nodes -keyout /tmp/actions-setup-mysql-YE9ypD/var/ca-key.pem -subj /CN=Actions_Setup_MySQL_Auto_Generated_CA_Certificate -out /tmp/actions-setup-mysql-YE9ypD/var/ca-req.pem
| ...+.........+......+....+......+.........+......+...+......+..............+............+...+.......+...+.........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*....+...+...+.+...+...+.........+...+..+...................+..+....+...+.....+.+.....+....+...+..+......+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+............+....+........................+............+...+......+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| ....+.......+............+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..........+......+...............+.................+............+...+..........+........+......+...+.......+...+..+..........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| -----
| [command]/opt/hostedtoolcache/mysql/8.***.31/x64/bin/openssl x5***9 -sha256 -req -in /tmp/actions-setup-mysql-YE9ypD/var/ca-req.pem -days 365*** -set_serial ***1 -signkey /tmp/actions-setup-mysql-YE9ypD/var/ca-key.pem -out /tmp/actions-setup-mysql-YE9ypD/var/ca.pem
| Certificate request self-signature ok
| subject=CN = Actions_Setup_MySQL_Auto_Generated_CA_Certificate
| [command]/opt/hostedtoolcache/mysql/8.***.31/x64/bin/openssl req -newkey rsa:2***48 -days 365*** -nodes -keyout /tmp/actions-setup-mysql-YE9ypD/var/server-key.pem -subj /CN=Actions_Setup_MySQL_Auto_Generated_Certificate -out /tmp/actions-setup-mysql-YE9ypD/var/server-req.pem
| Ignoring -days without -x5***9; not generating a certificate
| ..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+......+.........+...+.......+...+...+...+......+.....+...............+.+.....+...+.+......+........+.+.........+..+...+....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| .+........+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+...+..+...+.+.........+...............+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+...+........+...+....+.....+.+.....................+..............+......+.+..............+.+...+..............................+.....+......+......+.............+...............+...............+.....+......+.+..+...+.......+..+.+........+.+...+..+....+..+.........+......+....+.....+....+.....+.+...........+...+.........+...............+..........+...+..+......+......+...............+.............+.....+......+.......+..+.......+...+..+.+..+.......+...............+...+...+..+...+.......+..+...............+...+.+.........+........+.......+......+.........+............+......+...+.....+.+.....+.+........+......+.+...............+..+...+.........+...+...+.............+...........+...+.+......+........+.+..+....+..............+.+...+........+.......+.....+.+...........+....+............+.....+.......+......+.....+.+........+......+............+...............+...+......+....+......+.....+....+..+....+........+......+.........+............+.+.....+...................+.....+.+.....+..........+..+.+.................+....+......+..+..........+...........+......+......+..........+..............................+..+..........+..+......+...+...............+.+.........+...........+...+......+.+......+........+.+.........+..+.......+...+..+.......+.....+...+.+.....................+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| -----
| [command]/opt/hostedtoolcache/mysql/8.***.31/x64/bin/openssl rsa -in /tmp/actions-setup-mysql-YE9ypD/var/server-key.pem -out /tmp/actions-setup-mysql-YE9ypD/var/server-key.pem
| writing RSA key
| [command]/opt/hostedtoolcache/mysql/8.***.31/x64/bin/openssl x5***9 -sha256 -req -in /tmp/actions-setup-mysql-YE9ypD/var/server-req.pem -days 365*** -CA /tmp/actions-setup-mysql-YE9ypD/var/ca.pem -CAkey /tmp/actions-setup-mysql-YE9ypD/var/ca-key.pem -set_serial ***1 -out /tmp/actions-setup-mysql-YE9ypD/var/server-cert.pem
| Certificate request self-signature ok
| subject=CN = Actions_Setup_MySQL_Auto_Generated_Certificate
[Rails/test]   ❓  ::endgroup::
[Rails/test]   ❓  ::group::start MySQL database
| start MySQL database
| wait for MySQL ready
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in ***.5 sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 1 sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 2 sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 4 sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 8 sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 16 sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 3*** sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 3*** sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 3*** sec...
[Rails/test]   πŸ’¬  ::debug::failed: Error: ENOENT: no such file or directory, stat '/tmp/actions-setup-mysql-YE9ypD/tmp/mysqld.pid'
[Rails/test]   πŸ’¬  ::debug::retry in 3*** sec...
[Rails/test]   ❓  ::endgroup::
[Rails/test]   ❗  ::error::try harder but give up
[Rails/test]   ❌  Failure - Main Setup MySQL
[Rails/test] exitcode '1': failure
[Rails/test] ⭐ Run Post Setup MySQL
[Rails/test]   🐳  docker exec cmd=[node /var/run/act/actions/shogo82148-actions-setup-mysql@v1/lib/cleanup-mysql.js] user= workdir=
[Rails/test]   βœ…  Success - Post Setup MySQL
[Rails/test] 🏁  Job failed
INFO[0175] Cleaning up container for job test
Error: Job 'test' failed

Configuration

name: Rails
on:
  push:
jobs:
  test:
    env:
      RAILS_ENV: test
      DATABASE_URL: 'mysql2://127.0.0.1' # shogo82148/actions-setup-mysql@v1 doesn't work with socket
    runs-on: ubuntu-20.04
    steps:
    - name: Git checkout
      uses: actions/checkout@v3
    - name: Setup MySQL
      if: env.ACT
      uses: shogo82148/actions-setup-mysql@v1
      with:
        mysql-version: '8.0'
        root-password: root
    - run: mysql -uroot -h127.0.0.1 -e 'SELECT version()'

Unix socket?

Its possible to connect via UNIX socket?
I've tried via /tmp/mysql.sock like in the readme but is not working πŸ€”

I'm missing something?
Thanks

Action failed with v1.15.0

Error log:

rails aborted!
LoadError: libmysqlclient.so.20: cannot open shared object file: No such file or directory - /home/runner/work/my_proj/my_proj/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.4/lib/mysql2/mysql2.so
/home/runner/work/my_proj/my_proj/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.4/lib/mysql2.rb:36:in `require'
/home/runner/work/my_proj/my_proj/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.4/lib/mysql2.rb:36:in `<top (required)>'
/home/runner/work/my_proj/my_proj/config/application.rb:17:in `<top (required)>'
/home/runner/work/my_proj/my_proj/Rakefile:4:in `require_relative'
/home/runner/work/my_proj/my_proj/Rakefile:4:in `<top (required)>'
/home/runner/work/my_proj/my_proj/vendor/bundle/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/home/runner/work/my_proj/my_proj/vendor/bundle/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/home/runner/work/my_proj/my_proj/vendor/bundle/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/command.rb:51:in `invoke'
/home/runner/work/my_proj/my_proj/vendor/bundle/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

My action:

* env.MYSQL_VERSION is '5.7'

name: Build rails execution context
runs:
  using: Composite
  steps:
    - name: Install MySQL ${{ env.MYSQL_VERSION }}
      uses: shogo82148/actions-setup-mysql@v1
      with:
        mysql-version: ${{ env.MYSQL_VERSION }}
        root-password: ${{ env.TEST_DATABASE_PASS }}
        my-cnf: |
          [mysqld]
          character-set-server=utf8mb4
          [client]
          default-character-set=utf8mb4
    # ...
    - name: Set up DB
      shell: bash
      run: bundle exec rails db:setup

Workaround: use previous version

   steps:
     - name: Install MySQL ${{ env.MYSQL_VERSION }}
-      uses: shogo82148/actions-setup-mysql@v1
+      uses: shogo82148/[email protected]

Document the multi-value syntax for my-cnf

Hi,
many thanks for this useful action!

Unfortunately I'm not able to guess the correct syntax for my-cnf: values.

The source code doesn't help me either, that's simply not my programming language. πŸ˜‰

What I got working:

my-cnf: 'datadir=/dev/shm/mysql'

How to get in tmpdir=/dev/shm/mysql_tmp? I tried all sorts of white space, escaped newlines, ...
No clue.

building MySQL 5.6.51 fails

https://github.com/shogo82148/actions-setup-mysql/actions/runs/6307795570/job/17293393748

2023-10-01T15:21:51.3920471Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(65,15): error C2169: 'log2': intrinsic function, cannot be defined
2023-10-01T15:21:51.3930410Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(2406,56): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
2023-10-01T15:21:51.3940147Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(3964): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
2023-10-01T15:21:51.3950028Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(4773,66): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
2023-10-01T15:21:51.3959099Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(4792,66): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
2023-10-01T15:21:51.3969786Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(5145,24): warning C4244: 'initializing': conversion from 'ulonglong' to 'uint', possible loss of data
2023-10-01T15:21:51.4001093Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(5146,23): warning C4244: 'initializing': conversion from 'ulonglong' to 'uint', possible loss of data
2023-10-01T15:21:51.4016227Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(5169,24): warning C4244: 'initializing': conversion from 'ulonglong' to 'uint', possible loss of data
2023-10-01T15:21:51.4026727Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(5170,23): warning C4244: 'initializing': conversion from 'ulonglong' to 'uint', possible loss of data
2023-10-01T15:21:51.4037001Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(5188,24): warning C4244: 'initializing': conversion from 'ulonglong' to 'uint', possible loss of data
2023-10-01T15:21:51.4047735Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(5189,23): warning C4244: 'initializing': conversion from 'ulonglong' to 'uint', possible loss of data
2023-10-01T15:21:51.4058349Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(5718,48): warning C4244: 'argument': conversion from 'ha_rows' to 'double', possible loss of data
2023-10-01T15:21:51.4068690Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(6231,16): warning C4244: 'initializing': conversion from '__int64' to 'uint', possible loss of data
2023-10-01T15:21:51.4079423Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(6552,51): warning C4244: 'argument': conversion from 'ha_rows' to 'double', possible loss of data
2023-10-01T15:21:51.5944118Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(6599,36): error C2065: 'log2': undeclared identifier
2023-10-01T15:21:52.3139122Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(6599,48): error C2568: '*': unable to resolve function overload
2023-10-01T15:21:53.1792014Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(6599,48): message : could be 'double log2(double)'
2023-10-01T15:21:54.1328522Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(6599,18): error C2737: 'cpu_sort': const object must be initialized
2023-10-01T15:21:54.5244123Z 65>C:\Temp\mysql-server-mysql-5.6.51\sql\handler.cc(7073,46): warning C4267: 'argument': conversion from 'size_t' to 'uint', possible loss of data

How does one make the action use/store a cached version

The README states that it is optional to cache (and therefore use) the mysql installation so that it does not have to be downloaded and installed every time. However, it does not tell you how to do it.

When I use this action in downloads and installs MySql every time, which is very time consuming. How does one tell the action to use a cached version?

Post Setup MySQL always fails (looks like because port isn't detected properly)

      - name: Setup MySQL
        uses: shogo82148/actions-setup-mysql@v1
        with:
          mysql-version: '8'
          my-cnf: |
            port=5729
            authentication_policy=mysql_native_password
            sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
shutdown MySQL Server
  /opt/hostedtoolcache/mysql/8.0.27/x64/bin/mysqladmin --defaults-file=/tmp/actions-setup-mysql-mjne5V/etc/my.cnf --user=root --host=127.0.0.1 shutdown
  οΏ½mysqladmin: connect to server at '127.0.0.1' failed
  error: 'Can't connect to MySQL server on '127.0.0.1:3306' (111)'
  Check that mysqld is running on 127.0.0.1 and that the port is 3306.
  You can check this by doing 'telnet 127.0.0.1 3306'

Action fails with empty string in multiline my.cnf

Hi. I tried adding secure-file-priv = '' to my.cnf, like so:

    steps:
      - uses: actions/checkout@v3

      - name: Set up MySQL
        uses: shogo82148/actions-setup-mysql@v1
        with:
          mysql-version: '8.0'
          root-password: ${{ env.MYSQL_ROOT_PASSWORD }}
          my-cnf: |
            secure-file-priv = ''
            character-set-server = utf8mb4
            collation-server = utf8mb4_0900_ai_ci
            sql-mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

According to https://yaml-multiline.info/ that should be valid YAML.

But this yields
image

Moving the secure-file-priv line down to before the sql-mode line:

          my-cnf: |
            character-set-server = utf8mb4
            collation-server = utf8mb4_0900_ai_ci
            secure-file-priv = ''
            sql-mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

the error changes to

unexpected character "s"

so the unexpected character is the first character of the next line after the empty string.

Changing the quotes to double quotes fails the same way.

Only when secure-file-priv is the very last line, it works as expected.

          my-cnf: |
            character-set-server = utf8mb4
            collation-server = utf8mb4_0900_ai_ci
            sql-mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
            secure-file-priv = ''

So it must be the empty string causing trouble somehow.

runners are ubuntu-20.04 btw.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.