Migration:run fails on Gitlab delpoyment


#1

I am trying to delpoy Adonis JS (REST) on Gitlab.

When the job hit this script line: adonis migration:run, the pipeline fails with this error message:

{ Error: connect ECONNREFUSED 127.0.0.1:3306
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1083:14)
    --------------------
    at Protocol._enqueue (/builds/begueradjitest/node_modules/mysql/lib/protocol/Protocol.js:144:48)
    at Protocol.handshake (/builds/begueradjitest/node_modules/mysql/lib/protocol/Protocol.js:51:23)
    at Connection.connect (/builds/begueradjitest/node_modules/mysql/lib/Connection.js:118:18)
    at /builds/begueradjitest/node_modules/knex/lib/dialects/mysql/index.js:95:18
    at Promise._execute (/builds/begueradjitest/node_modules/bluebird/js/release/debuggability.js:313:9)
    at Promise._resolveFromExecutor (/builds/begueradjitest/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/builds/begueradjitest/node_modules/bluebird/js/release/promise.js:79:10)
    at Client_MySQL.acquireRawConnection (/builds/begueradjitest/node_modules/knex/lib/dialects/mysql/index.js:90:12)
    at create (/builds/begueradjitest/node_modules/knex/lib/client.js:280:23)
    at tryPromise (/builds/begueradjitest/node_modules/tarn/lib/Pool.js:366:22)
    at tryPromise (/builds/begueradjitest/node_modules/tarn/lib/utils.js:57:20)
    at Promise (/builds/begueradjitest/node_modules/tarn/lib/Pool.js:366:5)
    at new Promise (<anonymous>)
    at callbackOrPromise (/builds/begueradjitest/node_modules/tarn/lib/Pool.js:357:10)
    at Pool._create (/builds/begueradjitest/node_modules/tarn/lib/Pool.js:307:5)
    at Pool._doCreate (/builds/begueradjitest/node_modules/tarn/lib/Pool.js:275:32)
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 3306,
  fatal: true }

I am using MySQL.

What should I do ?


#2

The error speaks for itself. It’s not able to make MYSQL connection. I am not sure if Gitlab has support for Mysql, so please do read their docs on how to setup Mysql for a build


#3

I use GitLab to store my repos and then i use Plesk in a DO VPS.

Plesk is really great to pull from GitLab and then run all stuff like npm and adonis commands in a nice GUI.