You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a Sails app running with a sails-postgresql adapter. Since we installed [email protected] we ran into some compatibility issues between them. We have a config/autoreload.js file with the following content:
The overrideMigrateSetting is set to false, as we don't want the tables to be created again and so on. when we modify whichever file of the list, autoreload is triggered and does his job, but sails-postgresql crashes with the following error:
21/09/2017 | 11:26:53 | - error: TypeError: Cannot read property 'collections' of undefined
at getCollection (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\lib\adapter.js:1354:39)
at __CREATE__ (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\lib\adapter.js:440:26)
at after (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\lib\adapter.js:1293:7)
at c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\lib\adapter.js:1182:7
at c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\node_modules\pg\lib\pool.js:84:11
at dispense (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\node_modules\pg\node_modules\generic-pool\lib\generic-pool.js:250:16)
at Object.me.release (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\node_modules\pg\node_modules\generic-pool\lib\generic-pool.js:349:5)
at c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\node_modules\pg\lib\pool.js:88:20
at c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\lib\adapter.js:1296:9
at null.callback (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\lib\adapter.js:234:15)
at Query.handleReadyForQuery (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\node_modules\pg\lib\query.js:89:10)
at null.<anonymous> (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\node_modules\pg\lib\client.js:163:19)
at emitOne (events.js:82:20)
at emit (events.js:169:7)
at Socket.<anonymous> (c:\Iberdrola\TicketBook\Node\ProyectoIncidencias\node_modules\sails-postgresql\node_modules\pg\lib\connection.js:109:12)
at emitOne (events.js:77:13)
It crashes once per model and we have 40+ models in our app. I understand by the error that "collection of undefined" refers to the global sails variable.
Also, in our app error log we can see those lines, printing our tables one by one:
TABLE --> table1
TABLE --> table2
TABLE --> ...
Those lines are printed by the function describe(connectionName, table, cb) inside the sails-postgresql adapter. Why is it describing all the tables and why does it not get printed when we start the node app for the first time?
// Describe a table
describe: function(connectionName, table, cb) {
spawnConnection(connectionName, function __DESCRIBE__(client, cb) {
var connectionObject = connections[connectionName];
console.error('TABLE --> ' + table);
var collection = connectionObject.collections[table];
var tableName = table;
var schemaName = getSchema(connectionName, table);
Maybe this issue is more about the PostgreSQL adapter than the hook itself. Hope you can shed some light on this, as every time we reload a file, service for the users gets denied.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
We have a Sails app running with a
sails-postgresql
adapter. Since we installed[email protected]
we ran into some compatibility issues between them. We have aconfig/autoreload.js
file with the following content:The
overrideMigrateSetting
is set to false, as we don't want the tables to be created again and so on. when we modify whichever file of the list, autoreload is triggered and does his job, butsails-postgresql
crashes with the following error:It crashes once per model and we have 40+ models in our app. I understand by the error that "collection of undefined" refers to the global
sails
variable.Also, in our app error log we can see those lines, printing our tables one by one:
Those lines are printed by the function
describe(connectionName, table, cb)
inside thesails-postgresql
adapter. Why is it describing all the tables and why does it not get printed when we start the node app for the first time?Maybe this issue is more about the PostgreSQL adapter than the hook itself. Hope you can shed some light on this, as every time we reload a file, service for the users gets denied.
Thanks!
The text was updated successfully, but these errors were encountered: