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
Describe the bug
Running with a completely fresh created db docker container the migrations are failing at 20230124115524-add-duration-to-clips.ts. That migration was adjusted after the fact, this is why this is not impacting deployment.
[BE] APPLICATION -- listening at http://localhost:9000
[BE] APPLICATION -- Maintenance error OperationalError: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version fo
r the right syntax to use near 'IF NOT EXISTS (
[BE] (
[BE] SELECT
[BE] NULL
[BE] FROM
[BE] INF' at line 1
[BE] at Query.Sequence._packetToError (/code/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
[BE] at Query.ErrorPacket (/code/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
[BE] at Protocol._parsePacket (/code/node_modules/mysql/lib/protocol/Protocol.js:291:23)
[BE] at Parser._parsePacket (/code/node_modules/mysql/lib/protocol/Parser.js:433:10)
[BE] at Parser.write (/code/node_modules/mysql/lib/protocol/Parser.js:43:10)
[BE] at Protocol.write (/code/node_modules/mysql/lib/protocol/Protocol.js:38:16)
[BE] at Socket.<anonymous> (/code/node_modules/mysql/lib/Connection.js:88:28)
[BE] at Socket.<anonymous> (/code/node_modules/mysql/lib/Connection.js:526:10)
[BE] at Socket.emit (events.js:314:20)
[BE] at Socket.EventEmitter.emit (domain.js:483:12)
[BE] at addChunk (_stream_readable.js:297:12)
[BE] at readableAddChunk (_stream_readable.js:272:9)
[BE] at Socket.Readable.push (_stream_readable.js:213:10)
[BE] at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
[BE] --------------------
[BE] at Protocol._enqueue (/code/node_modules/mysql/lib/protocol/Protocol.js:144:48)
[BE] at Connection.query (/code/node_modules/mysql/lib/Connection.js:198:25)
[BE] at /code/node_modules/db-migrate-mysql/index.js:371:29
[BE] at Promise._execute (/code/node_modules/bluebird/js/release/debuggability.js:384:9)
[BE] at Promise._resolveFromExecutor (/code/node_modules/bluebird/js/release/promise.js:518:18)
[BE] at new Promise (/code/node_modules/bluebird/js/release/promise.js:103:10)
[BE] at Object.runSql (/code/node_modules/db-migrate-mysql/index.js:366:12)
[BE] at Class.exports.up (/code/server/src/lib/model/db/migrations/20230124115524-add-duration-to-clips.ts:2:13)
[BE] at Class.<anonymous> (/code/node_modules/db-migrate/lib/skeleton.js:85:43)
[BE] at Promise._execute (/code/node_modules/bluebird/js/release/debuggability.js:384:9)
[BE] at Promise._resolveFromExecutor (/code/node_modules/bluebird/js/release/promise.js:518:18)
[BE] at new Promise (/code/node_modules/bluebird/js/release/promise.js:103:10)
[BE] at Class._up (/code/node_modules/db-migrate/lib/skeleton.js:68:12)
[BE] at Class.up (/code/node_modules/db-migrate/lib/skeleton.js:150:17)
[BE] at Migrator.up (/code/node_modules/db-migrate/lib/migrator.js:108:14)
[BE] at /code/node_modules/db-migrate/lib/migrator.js:237:31 {
[BE] cause: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF
NOT EXISTS (
[BE] (
[BE] SELECT
[BE] NULL
[BE] FROM
[BE] INF' at line 1
[BE] at Query.Sequence._packetToError (/code/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
[BE] at Query.ErrorPacket (/code/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
[BE] at Protocol._parsePacket (/code/node_modules/mysql/lib/protocol/Protocol.js:291:23)
[BE] at Parser._parsePacket (/code/node_modules/mysql/lib/protocol/Parser.js:433:10)
[BE] at Parser.write (/code/node_modules/mysql/lib/protocol/Parser.js:43:10)
[BE] at Protocol.write (/code/node_modules/mysql/lib/protocol/Protocol.js:38:16)
[BE] at Socket.<anonymous> (/code/node_modules/mysql/lib/Connection.js:88:28)
[BE] at Socket.<anonymous> (/code/node_modules/mysql/lib/Connection.js:526:10)
[BE] at Socket.emit (events.js:314:20)
[BE] at Socket.EventEmitter.emit (domain.js:483:12)
[BE] at addChunk (_stream_readable.js:297:12)
[BE] at readableAddChunk (_stream_readable.js:272:9)
[BE] at Socket.Readable.push (_stream_readable.js:213:10)
[BE] at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
[BE] --------------------
[BE] at Protocol._enqueue (/code/node_modules/mysql/lib/protocol/Protocol.js:144:48)
[BE] at Connection.query (/code/node_modules/mysql/lib/Connection.js:198:25)
[BE] at /code/node_modules/db-migrate-mysql/index.js:371:29
[BE] at Promise._execute (/code/node_modules/bluebird/js/release/debuggability.js:384:9)
[BE] at Promise._resolveFromExecutor (/code/node_modules/bluebird/js/release/promise.js:518:18)
[BE] at new Promise (/code/node_modules/bluebird/js/release/promise.js:103:10)
[BE] at Object.runSql (/code/node_modules/db-migrate-mysql/index.js:366:12)
[BE] at Class.exports.up (/code/server/src/lib/model/db/migrations/20230124115524-add-duration-to-clips.ts:2:13)
[BE] at Class.<anonymous> (/code/node_modules/db-migrate/lib/skeleton.js:85:43)
[BE] at Promise._execute (/code/node_modules/bluebird/js/release/debuggability.js:384:9)
[BE] at Promise._resolveFromExecutor (/code/node_modules/bluebird/js/release/promise.js:518:18)
[BE] at new Promise (/code/node_modules/bluebird/js/release/promise.js:103:10)
[BE] at Class._up (/code/node_modules/db-migrate/lib/skeleton.js:68:12)
[BE] at Class.up (/code/node_modules/db-migrate/lib/skeleton.js:150:17)
[BE] at Migrator.up (/code/node_modules/db-migrate/lib/migrator.js:108:14)
[BE] at /code/node_modules/db-migrate/lib/migrator.js:237:31 {
[BE] code: 'ER_PARSE_ERROR',
[BE] errno: 1064,
[BE] sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS (\n"
+
[BE] ' (\n' +
[BE] ' SELECT\n' +
[BE] ' NULL\n' +
[BE] ' FROM\n' +
[BE] " INF' at line 1",
[BE] sqlState: '42000',
[BE] index: 0,
[BE] sql: '\n' +
[BE] ' IF NOT EXISTS (\n' +
[BE] ' (\n' +
[BE] ' SELECT\n' +
[BE] ' NULL\n' +
[BE] ' FROM\n' +
[BE] ' INFORMATION_SCHEMA.COLUMNS\n' +
[BE] ' WHERE\n' +
[BE] " TABLE_NAME = 'clips'\n" +
[BE] " AND COLUMN_NAME = 'duration' \n" +
[BE] ' )\n' +
[BE] ' ) THEN\n' +
[BE] ' ALTER TABLE clips\n' +
[BE] ' ADD COLUMN duration INT NOT NULL DEFAULT 0,\n' +
[BE] ' ALGORITHM = INPLACE,\n' +
[BE] ' LOCK = NONE;\n' +
[BE] ' END IF;\n' +
[BE] ' '
[BE] },
[BE] isOperational: true,
[BE] code: 'ER_PARSE_ERROR',
[BE] errno: 1064,
[BE] sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS (\n" +
[BE] ' (\n' +
[BE] ' SELECT\n' +
[BE] ' NULL\n' +
[BE] ' FROM\n' +
[BE] " INF' at line 1",
[BE] sqlState: '42000',
[BE] index: 0,
[BE] sql: '\n' +
[BE] ' IF NOT EXISTS (\n' +
[BE] ' (\n' +
[BE] ' SELECT\n' +
[BE] ' NULL\n' +
[BE] ' FROM\n' +
[BE] ' INFORMATION_SCHEMA.COLUMNS\n' +
[BE] ' WHERE\n' +
[BE] " TABLE_NAME = 'clips'\n" +
[BE] " AND COLUMN_NAME = 'duration' \n" +
[BE] ' )\n' +
[BE] ' ) THEN\n' +
[BE] ' ALTER TABLE clips\n' +
[BE] ' ADD COLUMN duration INT NOT NULL DEFAULT 0,\n' +
[BE] ' ALGORITHM = INPLACE,\n' +
[BE] ' LOCK = NONE;\n' +
[BE] ' END IF;\n' +
[BE] ' '
[BE] }
The text was updated successfully, but these errors were encountered:
Describe the bug
Running with a completely fresh created db docker container the migrations are failing at
20230124115524-add-duration-to-clips.ts
. That migration was adjusted after the fact, this is why this is not impacting deployment.The text was updated successfully, but these errors were encountered: