tcp连接错误和代码42703错误

hgc7kmma  于 2021-06-07  发布在  Redis
关注(0)|答案(0)|浏览(310)

我在前端使用angular,在后端使用sails&postgresql。我得到tcp连接错误和代码42703错误。有人能提出他们对那件事的看法吗。datastore.js文件内容如下:

module.exports.datastores = {

  /***************************************************************************
  *                                                                          *
  * Your app's default datastore.                                            *
  *                                                                          *
  * Sails apps read and write to local disk by default, using a built-in     *
  * database adapter called `sails-disk`.  This feature is purely for        *
  * convenience during development; since `sails-disk` is not designed for   *
  * use in a production environment.                                         *
  *                                                                          *
  * To use a different db _in development_, follow the directions below.     *
  * Otherwise, just leave the default datastore as-is, with no `adapter`.    *
  *                                                                          *
  * (For production configuration, see `config/env/production.js`.)          *
  *                                                                          *

***************************************************************************/

  default: {

    /***************************************************************************
    *                                                                          *
    * Want to use a different database during development?                     *
    *                                                                          *
    * 1. Choose an adapter:                                                    *
    *    https://sailsjs.com/plugins/databases                                 *
    *                                                                          *
    * 2. Install it as a dependency of your Sails app.                         *
    *    (For example:  npm install sails-mysql --save)                        *
    *                                                                          *
    * 3. Then pass it in, along with a connection URL.                         *
    *    (See https://sailsjs.com/config/datastores for help.)                 *
    *                                                                          *
  ***************************************************************************/
    // adapter: 'sails-mysql',
    // url: 'mysql://root:root@localhost:3306/panzura',
    // charset: 'utf8mb4',
    // collation: 'utf8mb4_unicode_ci'

    adapter: 'sails-postgresql',
    url: 'postgresql://panzura:panzura695!@localhost:5432/panzura'
    //url: 'postgresql://mannawar:hello@localhost:5432/mannawar'
  },

  cache: {
    adapter: 'sails-redis',
    url: 'redis://localhost:6379',
  },

  scanStore: {
    adapter: 'sails-redis',
    url: 'redis://localhost:6379/1',
  }

};

前端连接如下:

{
    "appName": "Global",
    "origin": "http://127.0.0.1:1337",
    "socketOrigin": "ws://127.0.0.1:1337",
    "appUrl": "http://localhost",
    "apiKey": "3y6gp1hz9de7cgvkn7xqjb3285hyudf1",
    "vapidKey": "dbffklfsdfsdmfksadaskdlasfdfjewjle32kj32j23k2j425jdljfkr24ljrasda"
}

pm2日志的堆栈跟踪如下所示:

at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
0|worker-s |   errno: 'ECONNREFUSED',
0|worker-s |   code: 'ECONNREFUSED',
0|worker-s |   syscall: 'connect',
0|worker-s |   address: '127.0.0.1',
0|worker-s |   port: 6379 }

2|app      |      code: '42703',
2|app      |      detail: undefined,
2|app      |      hint: undefined,
2|app      |      position: '347',
2|app      |      internalPosition: undefined,
2|app      |      internalQuery: undefined,
2|app      |      where: undefined,
2|app      |      schema: undefined,
2|app      |      table: undefined,
2|app      |      column: undefined,
2|app      |      dataType: undefined,
2|app      |      constraint: undefined,
2|app      |      file: 'parse_relation.c',
2|app      |      line: '3349',
2|app      |      routine: 'errorMissingColumn' } }

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题