"Error: ER_NO_SUCH_TABLE" when connecting ACE to Database

HI! I’ve managed to connect my production environment to a database and now I get an error that some tables are missing.

I cannot find any documentation on how these tables should be configured and my guess is that they should’ve been created by the ACE lib itself.

In any case, I’ll add in the stacktrace here and hopefully someone can help me figure it out. Thank you all in advance <3

{ Error: ER_NO_SUCH_TABLE: Table 'ColosseoClients.AddonSettings' doesn't exist
    at Query.Sequence._packetToError (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
    at Query.ErrorPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
    at Protocol._parsePacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:279:23)
    at Parser.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/ubuntu/deploy/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:547:20)
    --------------------
    at Protocol._enqueue (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:145:48)
    at Connection.query (/home/ubuntu/deploy/node_modules/mysql/lib/Connection.js:208:25)
    at MySQL.query (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:150:17)
    at MySQL.<anonymous> (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:143:18)
    at emitNone (events.js:86:13)
    at Schema.emit (events.js:185:7)
    at Schema.<anonymous> (/home/ubuntu/deploy/node_modules/jugglingdb/lib/schema.js:121:14)
    at Query._callback (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:80:29)
    at Query.Sequence.end (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Sequence.js:88:24)
    at Query._handleFinalResultPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:139:8)
    at Query.OkPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:72:10)
    at Protocol._parsePacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:279:23)
    at Parser.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/ubuntu/deploy/node_modules/mysql/lib/Connection.js:103:28)
    at emitOne (events.js:96:13)
  code: 'ER_NO_SUCH_TABLE',
  errno: 1146,
  sqlMessage: 'Table \'ColosseoClients.AddonSettings\' doesn\'t exist',
  sqlState: '42S02',
  index: 0,
  sql: 'SHOW FIELDS FROM `AddonSettings`',
  query: 'SHOW FIELDS FROM `AddonSettings`' }
Failed to initialize mysql storage adapter: Error: ER_NO_SUCH_TABLE: Table 'ColosseoClients.AddonSettings' doesn't exist
Error: ER_NO_SUCH_TABLE: Table 'ColosseoClients.AddonSettings' doesn't exist
    at Query.Sequence._packetToError (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
    at Query.ErrorPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
    at Protocol._parsePacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:279:23)
    at Parser.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/ubuntu/deploy/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:547:20)
    --------------------
    at Protocol._enqueue (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:145:48)
    at Connection.query (/home/ubuntu/deploy/node_modules/mysql/lib/Connection.js:208:25)
    at MySQL.query (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:150:17)
    at MySQL.<anonymous> (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:143:18)
    at emitNone (events.js:86:13)
    at Schema.emit (events.js:185:7)
    at Schema.<anonymous> (/home/ubuntu/deploy/node_modules/jugglingdb/lib/schema.js:121:14)
    at Query._callback (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:80:29)
    at Query.Sequence.end (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Sequence.js:88:24)
    at Query._handleFinalResultPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:139:8)
    at Query.OkPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:72:10)
    at Protocol._parsePacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:279:23)
    at Parser.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/ubuntu/deploy/node_modules/mysql/lib/Connection.js:103:28)
    at emitOne (events.js:96:13)
Unhandled error: Error: ER_NO_SUCH_TABLE: Table 'ColosseoClients.AddonSettings' doesn't exist
    at Query.Sequence._packetToError (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
    at Query.ErrorPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
    at Protocol._parsePacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:279:23)
    at Parser.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/ubuntu/deploy/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:547:20)
    --------------------
    at Protocol._enqueue (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:145:48)
    at Connection.query (/home/ubuntu/deploy/node_modules/mysql/lib/Connection.js:208:25)
    at MySQL.query (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:150:17)
    at MySQL.<anonymous> (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:143:18)
    at emitNone (events.js:86:13)
    at Schema.emit (events.js:185:7)
    at Schema.<anonymous> (/home/ubuntu/deploy/node_modules/jugglingdb/lib/schema.js:121:14)
    at Query._callback (/home/ubuntu/deploy/node_modules/jugglingdb-mysql/lib/mysql.js:80:29)
    at Query.Sequence.end (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Sequence.js:88:24)
    at Query._handleFinalResultPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:139:8)
    at Query.OkPacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/sequences/Query.js:72:10)
    at Protocol._parsePacket (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:279:23)
    at Parser.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/home/ubuntu/deploy/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/ubuntu/deploy/node_modules/mysql/lib/Connection.js:103:28)

hey @alexander.sopov,

Which type of database are you using?
And how did you configure it?

Cheers,
Peter

I’m using mysql, but getting similar errors in posgres.

I think I’ve found the culprit. the second column in the AddonSettings is called “key” which is a reserved keyword for mysql and it stops the table from being created. At least that’s the error I’m getting from mysql (and confirmed from google-searches) when i try to create such a table manually.

Hi!

I just switched the Adapter to sequelize and everything works fine.

The information on how to connect to database using juggingdb is deprecated (the “store” object in config.json is totally wrong for jugglingdb, and once connected I spent the entire day trying to get it to create tables that wouldn’t create… a whole day of hacking, solved by simply switching adapter).

So, if anyone else has a similar problem, please switch to sequelize by adding this to you “store” object in “config.json”:

"store":{
  "adapter":"sequelize",
  "type": "<<mysql-or-whatever>>",
  "url": "<<type-variable>>://<<DBusername>>:<<DBpwd>>@<<DBHost>>//<DBName>>"
}

Do that and, obviously, put in the correct values for your setup and everything should work fine. Don’t waste two days like I did :slight_smile:

2 Likes

Thanks for that solution @alexander.sopov.

I was already able to recreate your problem but was also struggling with finding a solution short of just creating the table manually.

1 Like