[GH-ISSUE #1148] hoppscotch empties the collections by itself #399

Closed
opened 2026-03-16 15:04:55 +03:00 by kerem · 29 comments
Owner

Originally created by @ravieze on GitHub (Sep 7, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1148

Describe the bug

  1. create hoppscotch account. multiple users of your team use the same gmail credentials to login to hoppscotch to share the rest api collections
  2. import collections from postman
  3. Now, refresh the page. The collections are visible. Refresh the page 4-5 times after a few times of refresh the collections are emptied.

Expected behavior
The collections should stay as they are. They shouldnt be emptied.

Screenshots
image

Desktop (please complete the following information):

  • OS: windows 10
  • Browser chrome 85.0.4183.83 (Official Build) (64-bit)
  • Version [e.g. 22]
Originally created by @ravieze on GitHub (Sep 7, 2020). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1148 **Describe the bug** 1. create hoppscotch account. multiple users of your team use the same gmail credentials to login to hoppscotch to share the rest api collections 2. import collections from postman 3. Now, refresh the page. The collections are visible. Refresh the page 4-5 times after a few times of refresh the collections are emptied. **Expected behavior** The collections should stay as they are. They shouldnt be emptied. **Screenshots** ![image](https://user-images.githubusercontent.com/5900517/92363498-34bfa600-f10f-11ea-885d-8bae5c054d27.png) **Desktop (please complete the following information):** - OS: windows 10 - Browser chrome 85.0.4183.83 (Official Build) (64-bit) - Version [e.g. 22]
kerem 2026-03-16 15:04:55 +03:00
Author
Owner

@liyasthomas commented on GitHub (Sep 7, 2020):

I can't reproduce this issue. Can you check with your team mates that none of them accidently deleted those saved requests?

<!-- gh-comment-id:688361649 --> @liyasthomas commented on GitHub (Sep 7, 2020): I can't reproduce this issue. Can you check with your team mates that none of them accidently deleted those saved requests?
Author
Owner

@ravieze commented on GitHub (Sep 7, 2020):

Actually me and 1 more colleague login with same gmail account credentials. After I had imported we both refreshed the pages, the collection entries remained intact for a while and then they all disappeared. we tried this couple of times, and it was consistently reproducible.

  1. I add to the collection
  2. He des the refresh
  3. I do the refresh,
  4. after couple of refreshes, the collection is emptied. (the same collection which was imported a while ago)

Not sure if this can be of some help, but this is all the ifo i have / i can share

<!-- gh-comment-id:688363336 --> @ravieze commented on GitHub (Sep 7, 2020): Actually me and 1 more colleague login with same gmail account credentials. After I had imported we both refreshed the pages, the collection entries remained intact for a while and then they all disappeared. we tried this couple of times, and it was consistently reproducible. 1. I add to the collection 2. He des the refresh 3. I do the refresh, 4. after couple of refreshes, the collection is emptied. (the same collection which was imported a while ago) Not sure if this can be of some help, but this is all the ifo i have / i can share
Author
Owner

@liyasthomas commented on GitHub (Sep 7, 2020):

I tried to reproduce this situation with two incognito windows, but had no issue. Will try more cases now.

<!-- gh-comment-id:688365789 --> @liyasthomas commented on GitHub (Sep 7, 2020): I tried to reproduce this situation with two incognito windows, but had no issue. Will try more cases now.
Author
Owner

@ravieze commented on GitHub (Sep 7, 2020):

Make sure that each window has multipe Gmail accounts in it. Not sure if this can be an issue. But in my case we did have multiple gmail accounts. Also, when u import the collection does it happen in background, in async?

<!-- gh-comment-id:688493932 --> @ravieze commented on GitHub (Sep 7, 2020): Make sure that each window has multipe Gmail accounts in it. Not sure if this can be an issue. But in my case we did have multiple gmail accounts. Also, when u import the collection does it happen in background, in async?
Author
Owner

@liyasthomas commented on GitHub (Sep 27, 2020):

Not reproducible, hence closing.

<!-- gh-comment-id:699662755 --> @liyasthomas commented on GitHub (Sep 27, 2020): Not reproducible, hence closing.
Author
Owner

@vinayakavaradaraj commented on GitHub (Nov 5, 2020):

As @ravieze mentioned, collections are emptied when we have a high latency or slow internet connection.

Steps to reproduce issue

  1. Open Network in developers tools of a browser and set Good 2G under Thorttling (In Firefox)
  2. Load Hoppscotch (user should be logged-in and should have collections synced)
  3. Once the UI is loaded, create new collection before appearing of Synced collections.
  4. Only new collection is visible with My Collections

Hence issue reproduced.

<!-- gh-comment-id:722211069 --> @vinayakavaradaraj commented on GitHub (Nov 5, 2020): As @ravieze mentioned, collections are emptied when we have a high latency or slow internet connection. Steps to reproduce issue 1. Open Network in developers tools of a browser and set Good 2G under Thorttling (In Firefox) 2. Load Hoppscotch (user should be logged-in and should have collections synced) 3. Once the UI is loaded, create new collection before appearing of Synced collections. 4. Only new collection is visible with My Collections Hence issue reproduced.
Author
Owner

@gabrielenosso commented on GitHub (Mar 24, 2021):

I had the same experience, logging in from 2 different instances of Chrome.
Lost all my data... Luckily I had a very recent backup.

<!-- gh-comment-id:805770530 --> @gabrielenosso commented on GitHub (Mar 24, 2021): I had the same experience, logging in from 2 different instances of Chrome. Lost all my data... Luckily I had a very recent backup.
Author
Owner

@liyasthomas commented on GitHub (Mar 24, 2021):

Sorry for that incident. We're working on a fully refactored state system along with better synchronisation on cloud. We'll keep an eye out on this very particular edge case and make sure it'll be resolved in upcoming days.

<!-- gh-comment-id:805779634 --> @liyasthomas commented on GitHub (Mar 24, 2021): Sorry for that incident. We're working on a fully refactored state system along with better synchronisation on cloud. We'll keep an eye out on this very particular edge case and make sure it'll be resolved in upcoming days.
Author
Owner

@dovwatbnh commented on GitHub (Jan 16, 2024):

I have this same issue. Very unfortunate. I tried to use a normal account using a magic link to log in, but I guess it was still tied to my Google account? After a couple seconds after importing an Insomnia export, it all gets deleted.

Turning off all sync features fixes it

<!-- gh-comment-id:1894618250 --> @dovwatbnh commented on GitHub (Jan 16, 2024): I have this same issue. Very unfortunate. I tried to use a normal account using a magic link to log in, but I guess it was still tied to my Google account? After a couple seconds after importing an Insomnia export, it all gets deleted. Turning off all sync features fixes it
Author
Owner

@dovwatbnh commented on GitHub (Jan 17, 2024):

After rebooting my PC, everything was deleted once again... Even with sync off. I tried using a new account which wasn't linked to a Google account in Hoppscotch, and it was still deleted after a couple seconds after import.
I think the issue is most likely the fact that I do an Insomnia import.

Maybe the fact that I'm on a restricted company network with a MITM proxy is causing issues?

<!-- gh-comment-id:1895974242 --> @dovwatbnh commented on GitHub (Jan 17, 2024): After rebooting my PC, everything was deleted once again... Even with sync off. I tried using a new account which wasn't linked to a Google account in Hoppscotch, and it was still deleted after a couple seconds after import. I think the issue is most likely the fact that I do an Insomnia import. Maybe the fact that I'm on a restricted company network with a MITM proxy is causing issues?
Author
Owner

@abbychau commented on GitHub (Apr 12, 2024):

It happened to my colleague today again!

<!-- gh-comment-id:2051586046 --> @abbychau commented on GitHub (Apr 12, 2024): It happened to my colleague today again!
Author
Owner

@ARE2KUSU commented on GitHub (Apr 16, 2024):

I got the same issue than @dovwatbnh but after a postman import, everything got deleted after a while

<!-- gh-comment-id:2059170065 --> @ARE2KUSU commented on GitHub (Apr 16, 2024): I got the same issue than @dovwatbnh but after a postman import, everything got deleted after a while
Author
Owner

@suiramdev commented on GitHub (Apr 11, 2025):

Same issue when importing a postman collection... This should be re-opened.

<!-- gh-comment-id:2797002904 --> @suiramdev commented on GitHub (Apr 11, 2025): Same issue when importing a postman collection... This should be re-opened.
Author
Owner

@suiramdev commented on GitHub (Apr 11, 2025):

Image

<!-- gh-comment-id:2797004744 --> @suiramdev commented on GitHub (Apr 11, 2025): ![Image](https://github.com/user-attachments/assets/51fcf86d-c1c8-4519-b4b5-c0a052b7a45b)
Author
Owner

@ravieze commented on GitHub (Jun 4, 2025):

i moved away from postman, hoppscotch.

now i use: HTTPYAC : https://httpyac.github.io/guide/installation_vscode.html ( very beautiful vscode plugin )

  • you can choose stage/ local/ prod environemnts
  • define varaibles to each environment ( eg: host )
  • make api calls and see responses ( like postman )
  • the api calls reside in .http files. meaning you can review, commit, version the files to git / bitbucket and sync all api calls across teams. Because its on bitbucket, you also have versioning, reviews in place
  • you can run all api calls EOD via script --automation testing comes in for free.
Image

definiing placeholders:

Image
<!-- gh-comment-id:2938655853 --> @ravieze commented on GitHub (Jun 4, 2025): i moved away from postman, hoppscotch. now i use: HTTPYAC : https://httpyac.github.io/guide/installation_vscode.html ( very beautiful vscode plugin ) - you can choose stage/ local/ prod environemnts - define varaibles to each environment ( eg: host ) - make api calls and see responses ( like postman ) - the api calls reside in .http files. meaning you can review, commit, version the files to git / bitbucket and sync all api calls across teams. Because its on bitbucket, you also have versioning, reviews in place - you can run all api calls EOD via script --automation testing comes in for free. <img width="1333" alt="Image" src="https://github.com/user-attachments/assets/dc9ea474-7f19-4e38-95a5-b683b80fcf93" /> definiing placeholders: <img width="829" alt="Image" src="https://github.com/user-attachments/assets/45857ec9-0559-4081-b736-6a236d2c1037" />
Author
Owner

@bernatGene commented on GitHub (Oct 20, 2025):

Same issue, even without importing anything. Created directly items in a collection (in the desktop app), still had the browser version opened too.
After some time of doing other things. I come back and my collection is empty except for a single request.
The rest are still opened in the tabs, and saving says "saved" but still do not appear in the collections sidebar??

<!-- gh-comment-id:3422851200 --> @bernatGene commented on GitHub (Oct 20, 2025): Same issue, even without importing anything. Created directly items in a collection (in the desktop app), still had the browser version opened too. After some time of doing other things. I come back and my collection is empty except for a single request. The rest are still opened in the tabs, and saving says "saved" but still do not appear in the collections sidebar??
Author
Owner

@TOHUHM commented on GitHub (Nov 11, 2025):

same issue, I don't even believe my eyes and try again and again, but the collection keep being empty, any solution?

<!-- gh-comment-id:3514751246 --> @TOHUHM commented on GitHub (Nov 11, 2025): same issue, I don't even believe my eyes and try again and again, but the collection keep being empty, any solution?
Author
Owner

@liyasthomas commented on GitHub (Nov 11, 2025):

Have you noticed any error messages or toast notifications? You might also want to check the browser console.

<!-- gh-comment-id:3514755993 --> @liyasthomas commented on GitHub (Nov 11, 2025): Have you noticed any error messages or toast notifications? You might also want to check the browser console.
Author
Owner

@TOHUHM commented on GitHub (Nov 11, 2025):

Have you noticed any error messages or toast notifications? You might also want to check the browser console.

No error message, the request disappeared just when I right click and "reload"

Image

yes, It happened on my desktop version, I tried to create new request on browser console, it's normal and synced to my desktop version fast, Any sync logic I need to change?

<!-- gh-comment-id:3514811305 --> @TOHUHM commented on GitHub (Nov 11, 2025): > Have you noticed any error messages or toast notifications? You might also want to check the browser console. No error message, the request disappeared just when I right click and "reload" <img width="464" height="195" alt="Image" src="https://github.com/user-attachments/assets/5250ad99-9535-4f8f-b7da-3f529bb4d268" /> yes, It happened on my desktop version, I tried to create new request on browser console, it's normal and synced to my desktop version fast, Any sync logic I need to change?
Author
Owner

@ankurmalhotra07 commented on GitHub (Nov 11, 2025):

We had multiple users complain about this exact issue where collections were getting deleted after a day.

<!-- gh-comment-id:3514817592 --> @ankurmalhotra07 commented on GitHub (Nov 11, 2025): We had multiple users complain about this exact issue where collections were getting deleted after a day.
Author
Owner

@TOHUHM commented on GitHub (Nov 11, 2025):

seem it keep sync with remote data and override any local changes.

<!-- gh-comment-id:3514821820 --> @TOHUHM commented on GitHub (Nov 11, 2025): seem it keep sync with remote data and override any local changes.
Author
Owner

@liyasthomas commented on GitHub (Nov 11, 2025):

I need a few more details.

  • Are you using the desktop or web version of the Hoppscotch client?
  • Are those collections imported from any platforms like Postman or created from scratch within Hoppscotch?
  • If imported, did it have any unsupported or failed imports?
  • Could you provide a redacted sample collection file that keeps disappearing?
<!-- gh-comment-id:3514823481 --> @liyasthomas commented on GitHub (Nov 11, 2025): I need a few more details. - Are you using the desktop or web version of the Hoppscotch client? - Are those collections imported from any platforms like Postman or created from scratch within Hoppscotch? - If imported, did it have any unsupported or failed imports? - Could you provide a redacted sample collection file that keeps disappearing?
Author
Owner

@TOHUHM commented on GitHub (Nov 11, 2025):

I need a few more details.

  • Are you using the desktop or web version of the Hoppscotch client?
    desktop version on MacOS m4
  • Are those collections imported from any platforms like Postman or created from scratch within Hoppscotch?
    both, imported from OpenAPI or created from scratch, I can use it if shortly, it will be disappear after a while or reload
  • If imported, did it have any unsupported or failed imports?
    No, I can use them for a while
  • Could you provide a redacted sample collection file that keeps disappearing?
    (seems yes, not all request will disappearing, you can check below request with this issue )

https://hopp.sh/r/z7fvnsnZ5ayi

<!-- gh-comment-id:3514847707 --> @TOHUHM commented on GitHub (Nov 11, 2025): > I need a few more details. > > * Are you using the desktop or web version of the Hoppscotch client? desktop version on MacOS m4 > * Are those collections imported from any platforms like Postman or created from scratch within Hoppscotch? both, imported from OpenAPI or created from scratch, I can use it if shortly, it will be disappear after a while or reload > * If imported, did it have any unsupported or failed imports? No, I can use them for a while > * Could you provide a redacted sample collection file that keeps disappearing? (seems yes, not all request will disappearing, you can check below request with this issue ) https://hopp.sh/r/z7fvnsnZ5ayi
Author
Owner

@ankurmalhotra07 commented on GitHub (Nov 11, 2025):

We’re observing issues with both the desktop and browser versions. Collections are being imported from Postman, but the issue appears intermittently. We’re in the process of gathering more logs, but wanted to flag a potential contributing factor.

It looks like the createCollection method is acquiring a lock on the entire UserCollection table here

This could be problematic, as a full table lock is likely to cause timeouts and possible deadlocks under concurrent or mixed workloads.

<!-- gh-comment-id:3514854231 --> @ankurmalhotra07 commented on GitHub (Nov 11, 2025): We’re observing issues with both the desktop and browser versions. Collections are being imported from Postman, but the issue appears intermittently. We’re in the process of gathering more logs, but wanted to flag a potential contributing factor. It looks like the createCollection method is acquiring a lock on the entire UserCollection table [here](https://github.com/hoppscotch/hoppscotch/blob/654e18fce9394f6c3d303717194d60ea770171ec/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts#L230) This could be problematic, as a full table lock is likely to cause timeouts and possible deadlocks under concurrent or mixed workloads.
Author
Owner

@TOHUHM commented on GitHub (Nov 11, 2025):

seem it keep sync with remote data and override any local changes.

ignore this guess, I tried to create request from web browser, issue happened too, seems linked to specific request

<!-- gh-comment-id:3514871908 --> @TOHUHM commented on GitHub (Nov 11, 2025): > seem it keep sync with remote data and override any local changes. ignore this guess, I tried to create request from web browser, issue happened too, seems linked to specific request
Author
Owner

@shaezard commented on GitHub (Nov 11, 2025):

We found following scalability issues with the current backend implementation for Create/Update/Delete operations on UserRequest, UserCollection, TeamRequest, TeamCollection

FULL EXCLUSIVE TABLE LOCK while modification operations:-

Image

Possible Deadlocks patterns:-

// This pattern might be causing deadlocks:

// User Request 1:
await prisma.lockTableExclusive(tx, 'UserCollection'); // Locks UserCollection
// ... then might try to lock UserRequest

// User Request 2 (simultaneously):
await prisma.lockTableExclusive(tx, 'UserRequest'); // Locks UserRequest
// ... then might try to lock UserCollection

// Result: DEADLOCK! One transaction is killed

Image

The 69 deadlocks prove we need to refactor ASAP.
Option 1 : Replace table locks with row-level locks (using FOR UPDATE)
Option 2 : Migrate to sequence-based ordering (using PostGres Sequences)

<!-- gh-comment-id:3514879665 --> @shaezard commented on GitHub (Nov 11, 2025): We found following scalability issues with the current backend implementation for Create/Update/Delete operations on UserRequest, UserCollection, TeamRequest, TeamCollection FULL EXCLUSIVE TABLE LOCK while modification operations:- <img width="1326" height="2768" alt="Image" src="https://github.com/user-attachments/assets/cfcbed32-fe5e-4302-9eb7-f800e8207024" /> Possible Deadlocks patterns:- // This pattern might be causing deadlocks: // User Request 1: await prisma.lockTableExclusive(tx, 'UserCollection'); // Locks UserCollection // ... then might try to lock UserRequest // User Request 2 (simultaneously): await prisma.lockTableExclusive(tx, 'UserRequest'); // Locks UserRequest // ... then might try to lock UserCollection // Result: DEADLOCK! One transaction is killed <img width="409" height="492" alt="Image" src="https://github.com/user-attachments/assets/b8d7e531-1cc4-4770-9e6c-e8c8f4378ccb" /> The 69 deadlocks prove we need to refactor ASAP. Option 1 : Replace table locks with row-level locks (using FOR UPDATE) Option 2 : Migrate to sequence-based ordering (using PostGres Sequences)
Author
Owner

@mirarifhasan commented on GitHub (Nov 11, 2025):

If anyone has backend logs showing DB deadlock errors or failed creation attempts, please share them so we can debug further.

<!-- gh-comment-id:3515302069 --> @mirarifhasan commented on GitHub (Nov 11, 2025): If anyone has backend logs showing DB deadlock errors or failed creation attempts, please share them so we can debug further.
Author
Owner

@shaezard commented on GitHub (Nov 11, 2025):

We saw one more issue due to which the collections are getting lost on relogin.
When postman collections are imported to the Personal workspace, they are stored in the local storage and then synced to the database asynchronously. This makes the changes in the personal collection appear instantaneously on the UI. But sometimes the DB sync fails due to some validation errors like:-

  1. Argument title is missing

Backend Server | Argument titleis missing. Backend Server | at /dist/backend/dist/team-collection/team-collection.service.js:141:27 Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120) Backend Server | at async TeamCollectionService.importCollectionsFromJSON (/dist/backend/dist/team-collection/team-collection.service.js:125:13) Backend Server | at async TeamCollectionResolver.importCollectionsFromJSON (/dist/backend/dist/team-collection/team-collection.resolver.js:85:36) { Backend Server | response: PrismaClientValidationError: Backend Server | Invalidtx.teamCollection.create() invocation in Backend Server | /dist/backend/dist/team-collection/team-collection.service.js:135:81 Backend Server | Backend Server | 132 }); Backend Server | 133 let lastOrderIndex = lastEntry ? lastEntry.orderIndex : 0; Backend Server | 134 queryList = collectionsList.right.map((x) => this.generatePrismaQueryObjForFBCollFolder(x, teamID, ++lastOrderIndex)); Backend Server | → 135 const promises = queryList.map((query) => tx.teamCollection.create({ Backend Server | data: { Backend Server | title: "## DBILL-9213: Data_Fix_Script_For_Primary_Contact_Missing_In_Account ## Copy", Backend Server | team: { Backend Server | connect: { Backend Server | id: "cmhsmclxf04a86d2jyydiba6e" Backend Server | } Backend Server | }

  1. PostgresError { code: "22P05", message: "unsupported Unicode escape sequence", severity: "ERROR", detail: Some("\\u0000 cannot be converted to text.")

Due to these validation errors, the db sync fails and when the user logs in again, the local storage is overridden by the data in database resulting in the loss of collections for which the db sync failed.

<!-- gh-comment-id:3518391103 --> @shaezard commented on GitHub (Nov 11, 2025): We saw one more issue due to which the collections are getting lost on relogin. When postman collections are imported to the Personal workspace, they are stored in the local storage and then synced to the database asynchronously. This makes the changes in the personal collection appear instantaneously on the UI. But sometimes the DB sync fails due to some validation errors like:- 1. Argument `title` is missing `Backend Server | Argument `title` is missing. Backend Server | at /dist/backend/dist/team-collection/team-collection.service.js:141:27 Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120) Backend Server | at async TeamCollectionService.importCollectionsFromJSON (/dist/backend/dist/team-collection/team-collection.service.js:125:13) Backend Server | at async TeamCollectionResolver.importCollectionsFromJSON (/dist/backend/dist/team-collection/team-collection.resolver.js:85:36) { Backend Server | response: PrismaClientValidationError: Backend Server | Invalid `tx.teamCollection.create()` invocation in Backend Server | /dist/backend/dist/team-collection/team-collection.service.js:135:81 Backend Server | Backend Server | 132 }); Backend Server | 133 let lastOrderIndex = lastEntry ? lastEntry.orderIndex : 0; Backend Server | 134 queryList = collectionsList.right.map((x) => this.generatePrismaQueryObjForFBCollFolder(x, teamID, ++lastOrderIndex)); Backend Server | → 135 const promises = queryList.map((query) => tx.teamCollection.create({ Backend Server | data: { Backend Server | title: "## DBILL-9213: Data_Fix_Script_For_Primary_Contact_Missing_In_Account ## Copy", Backend Server | team: { Backend Server | connect: { Backend Server | id: "cmhsmclxf04a86d2jyydiba6e" Backend Server | } Backend Server | }` 2. PostgresError { code: \"22P05\", message: \"unsupported Unicode escape sequence\", severity: \"ERROR\", detail: Some(\"\\\\u0000 cannot be converted to text.\") Due to these validation errors, the db sync fails and when the user logs in again, the local storage is overridden by the data in database resulting in the loss of collections for which the db sync failed.
Author
Owner

@shaezard commented on GitHub (Nov 13, 2025):

Here are the backend logs showing error due to deadlock. The requests might have eventually succeeded due to retries but Having a full exclusive lock certainly affects the latency of the request

1. UserRequestService.createRequest
Backend Server | Error from UserRequestService.createRequest ConflictException:
Backend Server | Invalid prisma.$executeRaw() invocation:
Backend Server |
Backend Server |
Backend Server | Raw query failed. Code: 40P01. Message: ERROR: deadlock detected Backend Server | DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039. Backend Server | Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248. Backend Server | Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091. Backend Server | HINT: See server log for query details.
Backend Server | at /dist/backend/dist/user-request/user-request.service.js:93:27
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserRequestService.createRequest (/dist/backend/dist/user-request/user-request.service.js:74:26)
Backend Server | at async UserRequestResolver.createRESTUserRequest (/dist/backend/dist/user-request/resolvers/user-request.resolver.js:57:25) {
Backend Server | response: PrismaClientKnownRequestError:
Backend Server | Invalid prisma.$executeRaw() invocation:
Backend Server |
Backend Server |
Backend Server | Raw query failed. Code: 40P01. Message: ERROR: deadlock detected Backend Server | DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039. Backend Server | Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248. Backend Server | Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091. Backend Server | HINT: See server log for query details.
Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7283)
Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608)
Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315)
Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551)
Backend Server | at async /dist/backend/dist/user-request/user-request.service.js:76:21
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserRequestService.createRequest (/dist/backend/dist/user-request/user-request.service.js:74:26)
Backend Server | at async UserRequestResolver.createRESTUserRequest (/dist/backend/dist/user-request/resolvers/user-request.resolver.js:57:25) {
Backend Server | code: 'P2010',
Backend Server | meta: {
Backend Server | code: '40P01',
Backend Server | message: 'ERROR: deadlock detected\n' +
Backend Server | 'DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039.\n' +
Backend Server | 'Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248.\n' +
Backend Server | 'Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091.\n' +
Backend Server | 'HINT: See server log for query details.'
Backend Server | },
Backend Server | clientVersion: '6.14.0'
Backend Server | },
Backend Server | status: 409,
Backend Server | options: {}
Backend Server | }

2. UserCollectionService.updateOrderIndex

Backend Server | ::1 POST /graphql 200 - 0.927 ms
Backend Server | Error from UserCollectionService.updateOrderIndex: ConflictException:
Backend Server | Invalid tx.userCollection.delete() invocation in
Backend Server | /dist/backend/dist/user-collection/user-collection.service.js:310:55
Backend Server |
Backend Server | 307 await this.prisma.$transaction(async (tx) => {
Backend Server | 308 try {
Backend Server | 309 await this.prisma.lockTableExclusive(tx, 'UserCollection');
Backend Server | → 310 await tx.userCollection.delete(
Backend Server | Error occurred during query execution:
Backend Server | ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "40P01", message: "deadlock detected", severity: "ERROR", detail: Some("Process 11516 waits for RowShareLock on relation 20747 of database 20621; blocked by process 3404.\nProcess 3404 waits for RowShareLock on relation 20755 of database 20621; blocked by process 11516."), column: None, hint: Some("See server log for query details.") }), transient: false })
Backend Server | at /dist/backend/dist/user-collection/user-collection.service.js:322:31
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17)
Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27)
Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32)
Backend Server | at async UserCollectionResolver.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.resolver.js:105:24) {
Backend Server | response: PrismaClientUnknownRequestError:
Backend Server | Invalid tx.userCollection.delete() invocation in
Backend Server | /dist/backend/dist/user-collection/user-collection.service.js:310:55
Backend Server |
Backend Server | 307 await this.prisma.$transaction(async (tx) => {
Backend Server | 308 try {
Backend Server | 309 await this.prisma.lockTableExclusive(tx, 'UserCollection');
Backend Server | → 310 await tx.userCollection.delete(
Backend Server | Error occurred during query execution:
Backend Server | ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "40P01", message: "deadlock detected", severity: "ERROR", detail: Some("Process 11516 waits for RowShareLock on relation 20747 of database 20621; blocked by process 3404.\nProcess 3404 waits for RowShareLock on relation 20755 of database 20621; blocked by process 11516."), column: None, hint: Some("See server log for query details.") }), transient: false })
Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7473)
Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608)
Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315)
Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551)
Backend Server | at async /dist/backend/dist/user-collection/user-collection.service.js:310:25
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17)
Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27)
Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32)
Backend Server | at async UserCollectionResolver.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.resolver.js:105:24) {
Backend Server | clientVersion: '6.14.0'
Backend Server | },
Backend Server | status: 409,
Backend Server | options: {}
Backend Server | }

3. UserCollectionService.deleteUserCollection

Backend Server |
Backend Server | Raw query failed. Code: 40P01. Message: ERROR: deadlock detected Backend Server | DETAIL: Process 18072 waits for ExclusiveLock on relation 20755 of database 20621; blocked by process 18067. Backend Server | Process 18067 waits for RowShareLock on relation 20747 of database 20621; blocked by process 26123. Backend Server | Process 26123 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18072. Backend Server | HINT: See server log for query details.
Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7283)
Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608)
Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315)
Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551)
Backend Server | at async /dist/backend/dist/user-collection/user-collection.service.js:309:25
Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120)
Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17)
Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27)
Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32)
Backend Server | at async Promise.all (index 0) {
Backend Server | code: 'P2010',
Backend Server | meta: {
Backend Server | code: '40P01',
Backend Server | message: 'ERROR: deadlock detected\n' +
Backend Server | 'DETAIL: Process 18072 waits for ExclusiveLock on relation 20755 of database 20621; blocked by process 18067.\n' +
Backend Server | 'Process 18067 waits for RowShareLock on relation 20747 of database 20621; blocked by process 26123.\n' +
Backend Server | 'Process 26123 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18072.\n' +
Backend Server | 'HINT: See server log for query details.'
Backend Server | },
Backend Server | clientVersion: '6.14.0'
Backend Server | },
Backend Server | status: 409,
Backend Server | options: {}
Backend Server | }

<!-- gh-comment-id:3529726711 --> @shaezard commented on GitHub (Nov 13, 2025): Here are the backend logs showing error due to deadlock. The requests might have eventually succeeded due to retries but Having a full exclusive lock certainly affects the latency of the request **1. UserRequestService.createRequest** Backend Server | Error from UserRequestService.createRequest ConflictException: Backend Server | Invalid `prisma.$executeRaw()` invocation: Backend Server | Backend Server | Backend Server | Raw query failed. Code: `40P01`. Message: `ERROR: deadlock detected Backend Server | DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039. Backend Server | Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248. Backend Server | Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091. Backend Server | HINT: See server log for query details.` Backend Server | at /dist/backend/dist/user-request/user-request.service.js:93:27 Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120) Backend Server | at async UserRequestService.createRequest (/dist/backend/dist/user-request/user-request.service.js:74:26) Backend Server | at async UserRequestResolver.createRESTUserRequest (/dist/backend/dist/user-request/resolvers/user-request.resolver.js:57:25) { Backend Server | response: PrismaClientKnownRequestError: Backend Server | Invalid `prisma.$executeRaw()` invocation: Backend Server | Backend Server | Backend Server | Raw query failed. Code: `40P01`. Message: `ERROR: deadlock detected Backend Server | DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039. Backend Server | Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248. Backend Server | Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091. Backend Server | HINT: See server log for query details.` Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7283) Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608) Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315) Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551) Backend Server | at async /dist/backend/dist/user-request/user-request.service.js:76:21 Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120) Backend Server | at async UserRequestService.createRequest (/dist/backend/dist/user-request/user-request.service.js:74:26) Backend Server | at async UserRequestResolver.createRESTUserRequest (/dist/backend/dist/user-request/resolvers/user-request.resolver.js:57:25) { Backend Server | code: 'P2010', Backend Server | meta: { Backend Server | code: '40P01', Backend Server | message: 'ERROR: deadlock detected\n' + Backend Server | 'DETAIL: Process 20091 waits for ExclusiveLock on relation 20747 of database 20621; blocked by process 25039.\n' + Backend Server | 'Process 25039 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18248.\n' + Backend Server | 'Process 18248 waits for RowShareLock on relation 20747 of database 20621; blocked by process 20091.\n' + Backend Server | 'HINT: See server log for query details.' Backend Server | }, Backend Server | clientVersion: '6.14.0' Backend Server | }, Backend Server | status: 409, Backend Server | options: {} Backend Server | } **2. UserCollectionService.updateOrderIndex** Backend Server | ::1 POST /graphql 200 - 0.927 ms Backend Server | Error from UserCollectionService.updateOrderIndex: ConflictException: Backend Server | Invalid `tx.userCollection.delete()` invocation in Backend Server | /dist/backend/dist/user-collection/user-collection.service.js:310:55 Backend Server | Backend Server | 307 await this.prisma.$transaction(async (tx) => { Backend Server | 308 try { Backend Server | 309 await this.prisma.lockTableExclusive(tx, 'UserCollection'); Backend Server | → 310 await tx.userCollection.delete( Backend Server | Error occurred during query execution: Backend Server | ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "40P01", message: "deadlock detected", severity: "ERROR", detail: Some("Process 11516 waits for RowShareLock on relation 20747 of database 20621; blocked by process 3404.\nProcess 3404 waits for RowShareLock on relation 20755 of database 20621; blocked by process 11516."), column: None, hint: Some("See server log for query details.") }), transient: false }) Backend Server | at /dist/backend/dist/user-collection/user-collection.service.js:322:31 Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120) Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17) Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27) Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32) Backend Server | at async UserCollectionResolver.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.resolver.js:105:24) { Backend Server | response: PrismaClientUnknownRequestError: Backend Server | Invalid `tx.userCollection.delete()` invocation in Backend Server | /dist/backend/dist/user-collection/user-collection.service.js:310:55 Backend Server | Backend Server | 307 await this.prisma.$transaction(async (tx) => { Backend Server | 308 try { Backend Server | 309 await this.prisma.lockTableExclusive(tx, 'UserCollection'); Backend Server | → 310 await tx.userCollection.delete( Backend Server | Error occurred during query execution: Backend Server | ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "40P01", message: "deadlock detected", severity: "ERROR", detail: Some("Process 11516 waits for RowShareLock on relation 20747 of database 20621; blocked by process 3404.\nProcess 3404 waits for RowShareLock on relation 20755 of database 20621; blocked by process 11516."), column: None, hint: Some("See server log for query details.") }), transient: false }) Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7473) Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608) Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315) Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551) Backend Server | at async /dist/backend/dist/user-collection/user-collection.service.js:310:25 Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120) Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17) Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27) Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32) Backend Server | at async UserCollectionResolver.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.resolver.js:105:24) { Backend Server | clientVersion: '6.14.0' Backend Server | }, Backend Server | status: 409, Backend Server | options: {} Backend Server | } **3. UserCollectionService.deleteUserCollection** Backend Server | Backend Server | Raw query failed. Code: `40P01`. Message: `ERROR: deadlock detected Backend Server | DETAIL: Process 18072 waits for ExclusiveLock on relation 20755 of database 20621; blocked by process 18067. Backend Server | Process 18067 waits for RowShareLock on relation 20747 of database 20621; blocked by process 26123. Backend Server | Process 26123 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18072. Backend Server | HINT: See server log for query details.` Backend Server | at ei.handleRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:7283) Backend Server | at ei.handleAndLogRequestError (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6608) Backend Server | at ei.request (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:121:6315) Backend Server | at async a (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:9551) Backend Server | at async /dist/backend/dist/user-collection/user-collection.service.js:309:25 Backend Server | at async Proxy._transactionWithCallback (/dist/backend/node_modules/.pnpm/@prisma+client@6.14.0_prisma@6.14.0_typescript@5.9.2__typescript@5.9.2/node_modules/@prisma/client/runtime/library.js:130:8120) Backend Server | at async UserCollectionService.removeCollectionAndUpdateSiblingsOrderIndex (/dist/backend/dist/user-collection/user-collection.service.js:307:17) Backend Server | at async UserCollectionService.deleteCollectionData (/dist/backend/dist/user-collection/user-collection.service.js:227:27) Backend Server | at async UserCollectionService.deleteUserCollection (/dist/backend/dist/user-collection/user-collection.service.js:242:32) Backend Server | at async Promise.all (index 0) { Backend Server | code: 'P2010', Backend Server | meta: { Backend Server | code: '40P01', Backend Server | message: 'ERROR: deadlock detected\n' + Backend Server | 'DETAIL: Process 18072 waits for ExclusiveLock on relation 20755 of database 20621; blocked by process 18067.\n' + Backend Server | 'Process 18067 waits for RowShareLock on relation 20747 of database 20621; blocked by process 26123.\n' + Backend Server | 'Process 26123 waits for RowShareLock on relation 20755 of database 20621; blocked by process 18072.\n' + Backend Server | 'HINT: See server log for query details.' Backend Server | }, Backend Server | clientVersion: '6.14.0' Backend Server | }, Backend Server | status: 409, Backend Server | options: {} Backend Server | }
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#399
No description provided.