cfdp / opeka

Counseling chat service, built for providing anonymous help to young people at risk
https://curachat.com
GNU General Public License v3.0
10 stars 6 forks source link

Chat crashes when screening module not enabled: Error: ER_NO_SUCH_TABLE #85

Closed benjamin-dk closed 7 years ago

benjamin-dk commented 7 years ago

When the Opeka Screening Questions module is disabled while the screeningQuestions setting in config.json is set to true, the chat crashes:

1 May 17:25:19 - Error: Screening responses could not be saved.
Connection 8202 released
/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/node_modules/mysql/lib/protocol/Parser.js:79
        throw err; // Rethrow non-MySQL errors
        ^

Error: ER_NO_SUCH_TABLE: Table 'skanderborg.opeka_screening_submissions' doesn't exist
    at Query.Sequence._packetToError (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
    at Query.ErrorPacket (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
    at Protocol._parsePacket (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/node_modules/mysql/lib/protocol/Protocol.js:280:23)
    at Parser.write (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/node_modules/mysql/lib/protocol/Parser.js:75:12)
    at Protocol.write (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/node_modules/mysql/lib/Connection.js:103:28)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:543:20)
    --------------------
    at Pool.query (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/node_modules/mysql/lib/Pool.js:199:23)
    at runQuery (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/lib/db.js:94:10)
    at /home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/lib/db.js:81:7
    at getClient (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/lib/db.js:58:14)
    at Object.query (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/drupal/lib/db.js:74:3)
    at Object.module.exports.save (/home/skanderborg/domains/skanderborg-node.curachat.com/opeka/nodejs/lib/screening.js:21:13)
    at Client.<anonymous> (/home/skanderborg/domains/skanderborg-node.curachat.com/opeka/nodejs/lib/opeka.js:840:23)
    at methods.(anonymous function) (/home/skanderborg/domains/skanderborg-node.curachat.com/opeka/nodejs/lib/groups.js:200:24)
    at Proto.apply (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/dnode/node_modules/dnode-protocol/index.js:123:13)
    at Proto.handle (/home/ubuntu/.nvm/versions/node/v6.6.0/lib/node_modules/dnode/node_modules/dnode-protocol/index.js:99:19)