Skip to content

Local API create with filePath not properly awaited, leads to mongo lock failure #4160

Closed

Description

@ssyberg

Link to reproduction

No response

Describe the Bug

Related discord discussion: https://discord.com/channels/967097582721572934/1174039383574331562/1174039383574331562

Receiving this error on API creates, adding a sleep on creates with a filePath solves it.

[
    17: 15: 55
] ERROR (payload): There was an error while saving a version for the Image with ID 65282888aebd24030d4f8e0a.
[
    17: 15: 55
] ERROR (payload): Unable to acquire IX lock on '{
    7925038056408952763: Collection,
    1007509028767870907, projectname._images_versions
}' within 5ms. opId: 8048590, op: conn16163, connId: 16163.
    err: {
    "type": "MongoServerError",
    "message": "Unable to acquire IX lock on '{7925038056408952763: Collection, 1007509028767870907, projectname._images_versions}' within 5ms. opId: 8048590, op: conn16163, connId: 16163.",
    "stack":
          MongoServerError: Unable to acquire IX lock on '{
        7925038056408952763: Collection,
        1007509028767870907, projectname._images_versions
    }' within 5ms. opId: 8048590, op: conn16163, connId: 16163.

To Reproduce

Run a local api create with a filePath (perhaps in a loop with many updates of the same record?)

Payload Version

2.1.1

Adapters and Plugins

db-mongodb

Activity

  1. added
    status: needs-triage
    on Nov 15, 2023
  2. added
    db: mongodb
    on Dec 27, 2023
  3. added
    status: needs-repro
    on Jan 11, 2024
  4. removed
    status: needs-triage
    on May 24, 2024
  5. DanRibbens commented on Jul 22, 2024

    @DanRibbens
    Contributor

    I'm closing this as it has become stale. Tag me if this is still an issue and we can re-open it.

  6. removed
    status: needs-repro
    on Jul 22, 2024
  7. github-actions commented on Sep 7, 2024

    @github-actions
    Contributor

    This issue has been automatically locked.
    Please open a new issue if this issue persists with any additional detail.

  8. locked as resolved and limited conversation to collaborators on Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

db: mongodb

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions