Git Product home page Git Product logo

Comments (6)

djyde avatar djyde commented on September 3, 2024

Thank you. I will take a look later.

But I think it's because of too many concurrent database insertions. I should fix it by making them insert serially

from cusdis.

djyde avatar djyde commented on September 3, 2024

Did you see some logs on Vercel functions log when it failed?

from cusdis.

frostming avatar frostming commented on September 3, 2024

Yes

[POST] /api/project/aa4ece8e-cc79-4c64-a92d-83bc53b09d1a/data/import
21:44:42:67
2021-04-23T13:44:47.255Z	83faf46e-922a-4eb8-bc8d-eff37a45ecf1	ERROR	Unhandled Promise Rejection 	{"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Foreign key constraint failed on the field: `comments_parentId_fkey (index)`","reason":{"errorType":"Error","errorMessage":"Foreign key constraint failed on the field: `comments_parentId_fkey (index)`","code":"P2003","clientVersion":"2.21.2","meta":{"field_name":"comments_parentId_fkey (index)"},"stack":["Error: Foreign key constraint failed on the field: `comments_parentId_fkey (index)`","    at cb (/var/task/node_modules/@prisma/client/runtime/index.js:34780:17)","    at processTicksAndRejections (internal/process/task_queues.js:93:5)","    at async /var/task/.next/server/pages/api/project/[projectId]/data/import.js:432:7","    at async Promise.all (index 2)","    at async data_service_DataService.importFromDisqus (/var/task/.next/server/pages/api/project/[projectId]/data/import.js:429:5)","    at async /var/task/.next/server/pages/api/project/[projectId]/data/import.js:504:24"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: Foreign key constraint failed on the field: `comments_parentId_fkey (index)`","    at process.<anonymous> (/var/runtime/index.js:35:15)","    at process.emit (events.js:327:22)","    at processPromiseRejections (internal/process/promises.js:245:33)","    at processTicksAndRejections (internal/process/task_queues.js:94:32)"]}

from cusdis.

frostming avatar frostming commented on September 3, 2024

It seems that the parent comment that is referred to isn't created yet.

from cusdis.

djyde avatar djyde commented on September 3, 2024

It seems that the parent comment that is referred to isn't created yet.

I think so. I should make sure the parent comment upsert successfully first then upsert the children.

from cusdis.

frostming avatar frostming commented on September 3, 2024

I finally workaround this by splitting the XML into comments without parents and the rest. Then upload them separately. Thanks to Cusdis, keep going on.

from cusdis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.