MYSQL Database SSL


#1

Hi!

im trying to use a ssl connection with my databas eon heroku and with the config like:

  mysql: {
    client: 'mysql',
    connection: {
      host: Env.get('DB_HOST', CLEARDB_DATABASE_URL.host),
      port: Env.get('DB_PORT', ''),
      user: Env.get('DB_USER', CLEARDB_DATABASE_URL.username),
      password: Env.get('DB_PASSWORD', CLEARDB_DATABASE_URL.password),
      database: Env.get('DB_DATABASE', CLEARDB_DATABASE_URL.pathname.substr(1)),
      ssl: {
        ca: fs.readFileSync(__dirname + '/certs/ca.pem'),
        key: fs.readFileSync(__dirname + '/certs/client-key.pem'),
        cert: fs.readFileSync(__dirname + '/certs/client-cert.pem')
      }
    },
  },

I have some errors on startup:

RuntimeException: E_MISSING_CONFIG: logger.transport is not defined inside config/app.js file
> More details: https://err.sh/adonisjs/errors/E_MISSING_CONFIG


1 Function.missingConfig
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\generic-exceptions\src\RuntimeException.js
:38

2 LoggerFacade.transport
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\framework\src\Logger\Facade.js:90

3 Object.get
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\framework\src\Logger\Facade.js:41

4 new Server
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\framework\src\Server\index.js:41

5 Object.app.singleton [as closure]
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\framework\providers\AppProvider.js:149

6 Ioc._resolveBinding
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\fold\src\Ioc\index.js:231

7 Ioc.use
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\fold\src\Ioc\index.js:731

8 ValidationProvider.boot
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\validator\providers\ValidatorProvider.js:8
7

9 _.filter.map
  C:\Users\vinicius\code\indicadores-producao\node_modules\@adonisjs\fold\src\Registrar\index.js:147

10 arrayMap
  C:\Users\vinicius\code\indicadores-producao\node_modules\lodash\lodash.js:639

11 Function.map
  C:\Users\vinicius\code\indicadores-producao\node_modules\lodash\lodash.js:9556

12 interceptor
  C:\Users\vinicius\code\indicadores-producao\node_modules\lodash\lodash.js:16993

13 thru
  C:\Users\vinicius\code\indicadores-producao\node_modules\lodash\lodash.js:8797

14 anonymous
  C:\Users\vinicius\code\indicadores-producao\node_modules\lodash\lodash.js:4374

15 arrayReduce
  C:\Users\vinicius\code\indicadores-producao\node_modules\lodash\lodash.js:683

16 baseWrapperValue
  C:\Users\vinicius\code\indicadores-producao\node_modules\lodash\lodash.js:4373

Application crashed, make sure to kill all related running process, fix the issue and re-run the app

Is there any way to do this?


#2

Two things I would check based on the error:

  1. Check to see if you accidentally removed/edited the logger config in config/app.js, the transport value needs to be either console or file.

  2. I would also check if you have .env file with a key generated.


#3

Hi, i have not removed anything from config/app.js, i checked the log config there, its on defaults, i think its a bug.

I will reproduce this on a blank project and post the project on github later.