“Creation Failed: ID Must Be Unique” Error

Expected behavior

Records are created

Actual behavior

image

Failure Logs

2020-10-20T11:00:18.828720+00:00 app[web.1]: e[31m[forest] 🌳🌳🌳  Unexpected error: id must be uniquee[39m
2020-10-20T11:00:18.828722+00:00 app[web.1]: e[31mSequelizeUniqueConstraintError: Validation errore[39m
2020-10-20T11:00:18.828723+00:00 app[web.1]: e[31m    at Query.formatError (/app/node_modules/sequelize/lib/dialects/postgres/query.js:312:18)e[39m
2020-10-20T11:00:18.828723+00:00 app[web.1]: e[31m    at /app/node_modules/sequelize/lib/dialects/postgres/query.js:71:18e[39m
2020-10-20T11:00:18.828724+00:00 app[web.1]: e[31m    at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)e[39m
2020-10-20T11:00:18.828724+00:00 app[web.1]: e[31m    at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:547:31)e[39m
2020-10-20T11:00:18.828724+00:00 app[web.1]: e[31m    at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:604:18)e[39m
2020-10-20T11:00:18.828725+00:00 app[web.1]: e[31m    at Promise._settlePromise0 (/app/node_modules/bluebird/js/release/promise.js:649:10)e[39m
2020-10-20T11:00:18.828725+00:00 app[web.1]: e[31m    at Promise._settlePromises (/app/node_modules/bluebird/js/release/promise.js:725:18)e[39m
2020-10-20T11:00:18.828725+00:00 app[web.1]: e[31m    at _drainQueueStep (/app/node_modules/bluebird/js/release/async.js:93:12)e[39m
2020-10-20T11:00:18.828726+00:00 app[web.1]: e[31m    at _drainQueue (/app/node_modules/bluebird/js/release/async.js:86:9)e[39m
2020-10-20T11:00:18.828726+00:00 app[web.1]: e[31m    at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:102:5)e[39m
2020-10-20T11:00:18.828727+00:00 app[web.1]: e[31m    at Immediate.Async.drainQueues [as _onImmediate] (/app/node_modules/bluebird/js/release/async.js:15:14)e[39m
2020-10-20T11:00:18.828728+00:00 app[web.1]: e[31m    at processImmediate (internal/timers.js:461:21)e[39m

Context

Please provide any relevant information about your setup.

  • Express Version: 4.16.4 (Forest -> 7.4.4)
  • Sequelize Version: 5.15.2 (Forest -> 6.3.13)
  • Database Dialect: PG
  • Database Version: 12.4

I am using PG Identity column type and not Serial. Id field is not present in any of the models.

It seems id sequences are messed up in my database thus FA hitting a constraint problem. So no issues with FA.