electrode-io / electrode-ota-server

Electrode Over The Air Server for hot deployment of React Native and Cordova mobile apps
Other
204 stars 40 forks source link

Exception after patching update #39

Closed ikhilko closed 4 years ago

ikhilko commented 6 years ago

I'm trying to play with code-push cli to see how it works for different cases. So when I'm done code-push patch MyApp Staging -m then next command code-push release-react MyApp ios throw an exception in logs, and update not published correct:

electrode-ota-server_1  | { requestId: '1517910287897:f01106863e6d:46:jdbec40d:10163',
electrode-ota-server_1  |   method: 'post',
electrode-ota-server_1  |   url:
electrode-ota-server_1  |    Url {
electrode-ota-server_1  |      protocol: null,
electrode-ota-server_1  |      slashes: null,
electrode-ota-server_1  |      auth: null,
electrode-ota-server_1  |      host: null,
electrode-ota-server_1  |      port: null,
electrode-ota-server_1  |      hostname: null,
electrode-ota-server_1  |      hash: null,
electrode-ota-server_1  |      search: null,
electrode-ota-server_1  |      query: {},
electrode-ota-server_1  |      pathname: '/apps/VLN-ios/deployments/Staging/release',
electrode-ota-server_1  |      path: '/apps/VLN-ios/deployments/Staging/release',
electrode-ota-server_1  |      href: '/apps/VLN-ios/deployments/Staging/release' },
electrode-ota-server_1  |   headers:
electrode-ota-server_1  |    { host: 'electrode.viber.com:9001',
electrode-ota-server_1  |      'accept-encoding': 'gzip, deflate',
electrode-ota-server_1  |      'user-agent': 'node-superagent/3.8.2',
electrode-ota-server_1  |      'x-codepush-cli-version': '2.1.6',
electrode-ota-server_1  |      accept: 'application/vnd.code-push.v2+json',
electrode-ota-server_1  |      authorization: 'Bearer SomeAuthToken',
electrode-ota-server_1  |      'x-codepush-sdk-version': '2.0.5',
electrode-ota-server_1  |      'content-type': 'multipart/form-data; boundary=--------------------------177628006739346891542309',
electrode-ota-server_1  |      'content-length': '314154',
electrode-ota-server_1  |      connection: 'close' },
electrode-ota-server_1  |   remoteAddress: '172.18.0.1',
electrode-ota-server_1  |   remotePort: 50534 } 'upload request ' ''
electrode-ota-server_1  | UniqueConstraint violation { SequelizeUniqueConstraintError: Validation error
electrode-ota-server_1  |     at Query.formatError (/src/node_modules/sequelize/lib/dialects/mysql/query.js:207:16)
electrode-ota-server_1  |     at Query.connection.query [as onResult] (/src/node_modules/sequelize/lib/dialects/mysql/query.js:55:23)
electrode-ota-server_1  |     at Query.Command.execute (/src/node_modules/mysql2/lib/commands/command.js:30:12)
electrode-ota-server_1  |     at Connection.handlePacket (/src/node_modules/mysql2/lib/connection.js:515:28)
electrode-ota-server_1  |     at PacketParser.onPacket (/src/node_modules/mysql2/lib/connection.js:94:16)
electrode-ota-server_1  |     at PacketParser.executeStart (/src/node_modules/mysql2/lib/packet_parser.js:77:14)
electrode-ota-server_1  |     at Socket.<anonymous> (/src/node_modules/mysql2/lib/connection.js:102:29)
electrode-ota-server_1  |     at Socket.emit (events.js:160:13)
electrode-ota-server_1  |     at addChunk (_stream_readable.js:269:12)
electrode-ota-server_1  |     at readableAddChunk (_stream_readable.js:256:11)
electrode-ota-server_1  |     at Socket.Readable.push (_stream_readable.js:213:10)
electrode-ota-server_1  |     at TCP.onread (net.js:602:20)
electrode-ota-server_1  |   name: 'SequelizeUniqueConstraintError',
electrode-ota-server_1  |   errors:
electrode-ota-server_1  |    [ ValidationErrorItem {
electrode-ota-server_1  |        message: 'PRIMARY must be unique',
electrode-ota-server_1  |        type: 'unique violation',
electrode-ota-server_1  |        path: 'PRIMARY',
electrode-ota-server_1  |        value: 'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473',
electrode-ota-server_1  |        origin: 'DB',
electrode-ota-server_1  |        instance: [PackageContent],
electrode-ota-server_1  |        validatorKey: 'not_unique',
electrode-ota-server_1  |        validatorName: null,
electrode-ota-server_1  |        validatorArgs: [] } ],
electrode-ota-server_1  |   fields:
electrode-ota-server_1  |    { PRIMARY: 'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473' },
electrode-ota-server_1  |   parent:
electrode-ota-server_1  |    { Error: Duplicate entry 'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473' for key 'PRIMARY'
electrode-ota-server_1  |     at Packet.asError (/src/node_modules/mysql2/lib/packets/packet.js:713:13)
electrode-ota-server_1  |     at Query.Command.execute (/src/node_modules/mysql2/lib/commands/command.js:28:22)
electrode-ota-server_1  |     at Connection.handlePacket (/src/node_modules/mysql2/lib/connection.js:515:28)
electrode-ota-server_1  |     at PacketParser.onPacket (/src/node_modules/mysql2/lib/connection.js:94:16)
electrode-ota-server_1  |     at PacketParser.executeStart (/src/node_modules/mysql2/lib/packet_parser.js:77:14)
electrode-ota-server_1  |     at Socket.<anonymous> (/src/node_modules/mysql2/lib/connection.js:102:29)
electrode-ota-server_1  |     at Socket.emit (events.js:160:13)
electrode-ota-server_1  |     at addChunk (_stream_readable.js:269:12)
electrode-ota-server_1  |     at readableAddChunk (_stream_readable.js:256:11)
electrode-ota-server_1  |     at Socket.Readable.push (_stream_readable.js:213:10)
electrode-ota-server_1  |     at TCP.onread (net.js:602:20)
electrode-ota-server_1  |      code: 'ER_DUP_ENTRY',
electrode-ota-server_1  |      errno: 1062,
electrode-ota-server_1  |      sqlState: '23000',
electrode-ota-server_1  |      sqlMessage: 'Duplicate entry \'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473\' for key \'PRIMARY\'',
electrode-ota-server_1  |      sql: 'INSERT INTO `packages_content` (`packageHash`,`content`,`createdAt`,`updatedAt`,`version`) VALUES (\'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473\',X\'7b22436f6465507573682f6d61696e2e6a7362756e646c65223a2231383332623734303062376261663435366563363363623762306431613833633732373762373538343133383030316465366465626564633933316533373937222c22436f6465507573682f6d61696e2e6a7362756e646c652e6d657461223a2238646632323437343134353839623438346562333832646437323838366631353764643332363866626339363766623639383765646639613865636465346133222c22436f6465507573682f6173736574732f7372632f6173736574732f6865616465722d6261636b67726f756e642e706e67223a2235353165353433356132376563643632623266626566353962613636333633306436653862366135623064626334633361663139396163326236643935353163222c22436f6465507573682f6173736574732f7372632f6173736574732f6865616465722d6261636b67726f756e644032782e706e67223a2236313766313165396630653837376364656332643436323637333137386439666436323966666564363961336662633434633966336338616636633061386165222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e2e706e67223a2233396362306535663262633434383966383437386164613634356262633530386534313963396632343237636634393564616430663335343831656330623733222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e4032782e706e67223a2238643561663132306135376439326631613164306533396138636336306530666238333634623966626263623534393361303264343132656231366261303633222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e4033782e706e67223a2238653635316636333663616235353136626563316230366565313761663434373335643962383737386263316432333633303631363730353566316535323633227d\',\'2018-02-06 09:44:47\',\'2018-02-06 09:44:47\',0);' },
electrode-ota-server_1  |   original:
electrode-ota-server_1  |    { Error: Duplicate entry 'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473' for key 'PRIMARY'
electrode-ota-server_1  |     at Packet.asError (/src/node_modules/mysql2/lib/packets/packet.js:713:13)
electrode-ota-server_1  |     at Query.Command.execute (/src/node_modules/mysql2/lib/commands/command.js:28:22)
electrode-ota-server_1  |     at Connection.handlePacket (/src/node_modules/mysql2/lib/connection.js:515:28)
electrode-ota-server_1  |     at PacketParser.onPacket (/src/node_modules/mysql2/lib/connection.js:94:16)
electrode-ota-server_1  |     at PacketParser.executeStart (/src/node_modules/mysql2/lib/packet_parser.js:77:14)
electrode-ota-server_1  |     at Socket.<anonymous> (/src/node_modules/mysql2/lib/connection.js:102:29)
electrode-ota-server_1  |     at Socket.emit (events.js:160:13)
electrode-ota-server_1  |     at addChunk (_stream_readable.js:269:12)
electrode-ota-server_1  |     at readableAddChunk (_stream_readable.js:256:11)
electrode-ota-server_1  |     at Socket.Readable.push (_stream_readable.js:213:10)
electrode-ota-server_1  |     at TCP.onread (net.js:602:20)
electrode-ota-server_1  |      code: 'ER_DUP_ENTRY',
electrode-ota-server_1  |      errno: 1062,
electrode-ota-server_1  |      sqlState: '23000',
electrode-ota-server_1  |      sqlMessage: 'Duplicate entry \'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473\' for key \'PRIMARY\'',
electrode-ota-server_1  |      sql: 'INSERT INTO `packages_content` (`packageHash`,`content`,`createdAt`,`updatedAt`,`version`) VALUES (\'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473\',X\'7b22436f6465507573682f6d61696e2e6a7362756e646c65223a2231383332623734303062376261663435366563363363623762306431613833633732373762373538343133383030316465366465626564633933316533373937222c22436f6465507573682f6d61696e2e6a7362756e646c652e6d657461223a2238646632323437343134353839623438346562333832646437323838366631353764643332363866626339363766623639383765646639613865636465346133222c22436f6465507573682f6173736574732f7372632f6173736574732f6865616465722d6261636b67726f756e642e706e67223a2235353165353433356132376563643632623266626566353962613636333633306436653862366135623064626334633361663139396163326236643935353163222c22436f6465507573682f6173736574732f7372632f6173736574732f6865616465722d6261636b67726f756e644032782e706e67223a2236313766313165396630653837376364656332643436323637333137386439666436323966666564363961336662633434633966336338616636633061386165222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e2e706e67223a2233396362306535663262633434383966383437386164613634356262633530386534313963396632343237636634393564616430663335343831656330623733222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e4032782e706e67223a2238643561663132306135376439326631613164306533396138636336306530666238333634623966626263623534393361303264343132656231366261303633222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e4033782e706e67223a2238653635316636333663616235353136626563316230366565313761663434373335643962383737386263316432333633303631363730353566316535323633227d\',\'2018-02-06 09:44:47\',\'2018-02-06 09:44:47\',0);' },
electrode-ota-server_1  |   sql: 'INSERT INTO `packages_content` (`packageHash`,`content`,`createdAt`,`updatedAt`,`version`) VALUES (\'e84e9389a963cf99cf45baca6020743975c7f1429a62b09b2cc4ca173f87a473\',X\'7b22436f6465507573682f6d61696e2e6a7362756e646c65223a2231383332623734303062376261663435366563363363623762306431613833633732373762373538343133383030316465366465626564633933316533373937222c22436f6465507573682f6d61696e2e6a7362756e646c652e6d657461223a2238646632323437343134353839623438346562333832646437323838366631353764643332363866626339363766623639383765646639613865636465346133222c22436f6465507573682f6173736574732f7372632f6173736574732f6865616465722d6261636b67726f756e642e706e67223a2235353165353433356132376563643632623266626566353962613636333633306436653862366135623064626334633361663139396163326236643935353163222c22436f6465507573682f6173736574732f7372632f6173736574732f6865616465722d6261636b67726f756e644032782e706e67223a2236313766313165396630653837376364656332643436323637333137386439666436323966666564363961336662633434633966336338616636633061386165222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e2e706e67223a2233396362306535663262633434383966383437386164613634356262633530386534313963396632343237636634393564616430663335343831656330623733222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e4032782e706e67223a2238643561663132306135376439326631613164306533396138636336306530666238333634623966626263623534393361303264343132656231366261303633222c22436f6465507573682f6173736574732f6e6f64655f6d6f64756c65732f72656163742d6e617669676174696f6e2f7372632f76696577732f6173736574732f6261636b2d69636f6e4033782e706e67223a2238653635316636333663616235353136626563316230366565313761663434373335643962383737386263316432333633303631363730353566316535323633227d\',\'2018-02-06 09:44:47\',\'2018-02-06 09:44:47\',0);' }
electrode-ota-server_1  | UniqueConstraint violation { SequelizeUniqueConstraintError: Validation error
electrode-ota-server_1  |     at Query.formatError (/src/node_modules/sequelize/lib/dialects/mysql/query.js:207:16)
electrode-ota-server_1  |     at Query.connection.query [as onResult] (/src/node_modules/sequelize/lib/dialects/mysql/query.js:55:23)
electrode-ota-server_1  |     at Query.Command.execute (/src/node_modules/mysql2/lib/commands/command.js:30:12)
electrode-ota-server_1  |     at Connection.handlePacket (/src/node_modules/mysql2/lib/connection.js:515:28)
electrode-ota-server_1  |     at PacketParser.onPacket (/src/node_modules/mysql2/lib/connection.js:94:16)
electrode-ota-server_1  |     at PacketParser.executeStart (/src/node_modules/mysql2/lib/packet_parser.js:77:14)
electrode-ota-server_1  |     at Socket.<anonymous> (/src/node_modules/mysql2/lib/connection.js:102:29)
electrode-ota-server_1  |     at Socket.emit (events.js:160:13)
electrode-ota-server_1  |     at addChunk (_stream_readable.js:269:12)
electrode-ota-server_1  |     at readableAddChunk (_stream_readable.js:256:11)
electrode-ota-server_1  |     at Socket.Readable.push (_stream_readable.js:213:10)
electrode-ota-server_1  |     at TCP.onread (net.js:602:20)
electrode-ota-server_1  |   name: 'SequelizeUniqueConstraintError',
electrode-ota-server_1  |   errors:
electrode-ota-server_1  |    [ ValidationErrorItem {
electrode-ota-server_1  |        message: 'PRIMARY must be unique',
electrode-ota-server_1  |        type: 'unique violation',
electrode-ota-server_1  |        path: 'PRIMARY',
electrode-ota-server_1  |        value: '471b7dca00bfb01204543769dbdaf29bdb4e57b1d25828723f44834066212d1c',
electrode-ota-server_1  |        origin: 'DB',
electrode-ota-server_1  |        instance: [PackageContent],
electrode-ota-server_1  |        validatorKey: 'not_unique',
electrode-ota-server_1  |        validatorName: null,
electrode-ota-server_1  |        validatorArgs: [] } ],
electrode-ota-server_1  |   fields:
electrode-ota-server_1  |    { PRIMARY: '471b7dca00bfb01204543769dbdaf29bdb4e57b1d25828723f44834066212d1c' },
electrode-ota-server_1  |   parent:
electrode-ota-server_1  |    { Error: Duplicate entry '471b7dca00bfb01204543769dbdaf29bdb4e57b1d25828723f44834066212d1c' for key 'PRIMARY'
electrode-ota-server_1  |     at Packet.asError (/src/node_modules/mysql2/lib/packets/packet.js:713:13)
electrode-ota-server_1  |     at Query.Command.execute (/src/node_modules/mysql2/lib/commands/command.js:28:22)
electrode-ota-server_1  |     at Connection.handlePacket (/src/node_modules/mysql2/lib/connection.js:515:28)
electrode-ota-server_1  |     at PacketParser.onPacket (/src/node_modules/mysql2/lib/connection.js:94:16)
electrode-ota-server_1  |     at PacketParser.executeStart (/src/node_modules/mysql2/lib/packet_parser.js:77:14)
electrode-ota-server_1  |     at Socket.<anonymous> (/src/node_modules/mysql2/lib/connection.js:102:29)
electrode-ota-server_1  |     at Socket.emit (events.js:160:13)
electrode-ota-server_1  |     at addChunk (_stream_readable.js:269:12)
electrode-ota-server_1  |     at readableAddChunk (_stream_readable.js:256:11)
electrode-ota-server_1  |     at Socket.Readable.push (_stream_readable.js:213:10)
electrode-ota-server_1  |     at TCP.onread (net.js:602:20)
electrode-ota-server_1  |      code: 'ER_DUP_ENTRY',
electrode-ota-server_1  |      errno: 1062,
electrode-ota-server_1  |      sqlState: '23000',
electrode-ota-server_1  |      sqlMessage: 'Duplicate entry \'471b7dca00bfb01204543769dbdaf29bdb4e57b1d25828723f44834066212d1c\' for key \'PRIMARY\'',
electrode-ota-server_1  |      sql: 'INSERT INTO `packages_content` (`packageHash`,`content`,`createdAt`,`updatedAt`,`version`) VALUES (\'471b7dca00bfb01204543769dbdaf29bdb4e57b1d25828723f44834066212d1c\',X\'<blob_value>\',\'2018-02-06 09:44:47\',\'2018-02-06 09:44:47\',0);' },
electrode-ota-server_1  |   original:
electrode-ota-server_1  |    { Error: Duplicate entry '471b7dca00bfb01204543769dbdaf29bdb4e57b1d25828723f44834066212d1c' for key 'PRIMARY'
electrode-ota-server_1  |     at Packet.asError (/src/node_modules/mysql2/lib/packets/packet.js:713:13)
electrode-ota-server_1  |     at Query.Command.execute (/src/node_modules/mysql2/lib/commands/command.js:28:22)
electrode-ota-server_1  |     at Connection.handlePacket (/src/node_modules/mysql2/lib/connection.js:515:28)
electrode-ota-server_1  |     at PacketParser.onPacket (/src/node_modules/mysql2/lib/connection.js:94:16)
electrode-ota-server_1  |     at PacketParser.executeStart (/src/node_modules/mysql2/lib/packet_parser.js:77:14)
electrode-ota-server_1  |     at Socket.<anonymous> (/src/node_modules/mysql2/lib/connection.js:102:29)
electrode-ota-server_1  |     at Socket.emit (events.js:160:13)
electrode-ota-server_1  |     at addChunk (_stream_readable.js:269:12)
electrode-ota-server_1  |     at readableAddChunk (_stream_readable.js:256:11)
electrode-ota-server_1  |     at Socket.Readable.push (_stream_readable.js:213:10)
electrode-ota-server_1  |     at TCP.onread (net.js:602:20)
electrode-ota-server_1  |      code: 'ER_DUP_ENTRY',
electrode-ota-server_1  |      errno: 1062,
electrode-ota-server_1  |      sqlState: '23000',
electrode-ota-server_1  |      sqlMessage: 'Duplicate entry \'471b7dca00bfb01204543769dbdaf29bdb4e57b1d25828723f44834066212d1c\' for key \'PRIMARY\'',
electrode-ota-server_1  |      sql: 'INSERT INTO `packages_content` (`packageHash`,`content`,`createdAt`,`updatedAt`,`version`) VALUES (\'471b7dca00bfb01204543769dbdaf29bdb4e57b1d25828723f44834066212d1c\'X\'<blob_value>\',\'2018-02-06 09:44:47\',\'2018-02-06 09:44:47\',0);' }
datvong-wm commented 6 years ago

This is most likely a bug with the MariaDB plugin. For now, you can use the Cassandra implementation to get around this issue.

datvong-wm commented 6 years ago

Please try the latest version. The updated schema in the latest version should fix the above issue.