简体   繁体   中英

adonis migration:run fails on Gitlab deployment

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 to run the migrations.

What should I do ?

You need to use this command :

> node ace migration:run

Adonis ACE documentation

您是否尝试过使用adonis迁移:run --force

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM