Error: Failed to load collection xlsxTemplates Error: Can't insert key NdW7rL9aMMpTdfT6, it violates the unique constraint.



  • Hi all, I am getting this error. Can anybody know about this error:

    error: Failed to load collection xlsxTemplates Error: Can't insert key NdW7rL9aMMpTdfT6, it violates the unique constraint
    at _AVLTree.insert (E:\js-report\node_modules\binary-search-tree\lib\avltree.js:273:19)
    at AVLTree.insert (E:\js-report\node_modules\binary-search-tree\lib\avltree.js:307:27)
    at Index.insert (E:\js-report\node_modules\nedb\lib\indexes.js:77:15)
    at Index.insertMultipleDocs (E:\js-report\node_modules\nedb\lib\indexes.js:114:12)
    at Index.insert (E:\js-report\node_modules\nedb\lib\indexes.js:69:33)
    at Index.reset (E:\js-report\node_modules\nedb\lib\indexes.js:55:23)
    at E:\js-report\node_modules\nedb\lib\datastore.js:107:21
    at Array.forEach (native)
    at Datastore.resetIndexes (E:\js-report\node_modules\nedb\lib\datastore.js:106:29)
    at E:\js-report\node_modules\jsreport-fs-store\lib\persistence.js:403:17
    at E:\js-report\node_modules\jsreport-fs-store\node_modules\async\dist\async.js:460:16
    at iteratorCallback (E:\js-report\node_modules\jsreport-fs-store\node_modules\async\dist\async.js:1034:13)
    at E:\js-report\node_modules\jsreport-fs-store\node_modules\async\dist\async.js:944:16
    at E:\js-report\node_modules\jsreport-fs-store\lib\persistence.js:394:9
    at E:\js-report\node_modules\jsreport-fs-store\lib\persistence.js:344:9
    at E:\js-report\node_modules\jsreport-fs-store\node_modules\async\dist\async.js:460:16
    at iteratorCallback (E:\js-report\node_modules\jsreport-fs-store\node_modules\async\dist\async.js:1034:13)
    at E:\js-report\node_modules\jsreport-fs-store\node_modules\async\dist\async.js:944:16
    at E:\js-report\node_modules\jsreport-fs-store\lib\persistence.js:341:11
    at E:\js-report\node_modules\graceful-fs\graceful-fs.js:90:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:446:3)



  • Would you consider updating jsreport to the latest version?
    Storing templates is completely reworked there.



  • yes, sure. Thanks Jan.



  • @jan_blaha Is there any alternative to fix this error temporarily and any reason why this error is coming?



  • I've never seen this error...

    You can zip the data folder and email it to me. I would take a look.
    I would additionally need the exact jsreport version you use and when this error occurs.



  • It got resolved Jan. It was coming because my teammate defined same key for 2 different xlsx template. Thanks for helping me.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.