Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Unable to acquire IX lock

default discord avatar
ssyberg2 years ago
3

Not sure where to begin on this, ever since upgrading to 2.0 and connecting to a replica set on Atlas, my data seeds are triggering all kinds of transaction related errors. This one is currently the biggest blocker. Any insight would be helpful, I kinda have no idea where to even begin.



[
    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.


Error message continued



         at Connection.onMessage (/Users/seth/dev/projectname/backend/node_modules/mongodb/src/cmap/connection.ts: 449: 20)
              at MessageStream.<anonymous> (/Users/seth/dev/projectname/backend/node_modules/mongodb/src/cmap/connection.ts: 241: 56)
              at MessageStream.emit (node:events: 514: 28)
              at MessageStream.emit (node:domain: 489: 12)
              at processIncomingData (/Users/seth/dev/projectname/backend/node_modules/mongodb/src/cmap/message_stream.ts: 188: 12)
              at MessageStream._write (/Users/seth/dev/projectname/backend/node_modules/mongodb/src/cmap/message_stream.ts: 69: 5)
              at writeOrBuffer (node:internal/streams/writable: 392: 12)
              at _write (node:internal/streams/writable: 333: 10)
              at MessageStream.Writable.write (node:internal/streams/writable: 337: 10)
              at TLSSocket.ondata (node:internal/streams/readable: 766: 22)
      "ok": 0,
    "code": 24,
    "codeName": "LockTimeout",
    "$clusterTime": {
        "clusterTime": {
            "$timestamp": "7301367759508602902"
        },
        "signature": {
            "hash": "8AaLVDeqjsIq48zXv20v7lBrBcE=",
            "keyId": {
                "low": 5,
                "high": 1694695573,
                "unsigned": false
            }
        }
    },
    "operationTime": {
        "$timestamp": "7301367759508602902"
    }
}
[
    17: 15: 55
] ERROR (payload): There was an error cleaning up old versions for the collection images


FWIW I may have uncovered the underlying bug causing this. Looks like when using

filePath

via local API perhaps the file "upload" isn't properly being

awaited

- adding a sleep on all API interactions that include a

filePath

made this go away (though obviously not a great solution)

  • discord user avatar
    dribbens
    2 years ago

    I'm going to work on recreating this error and fixing it. It would be helpful if you could open an issue on github, but either way I'm going to focus my efforts here.



    Thanks for the details here!

  • default discord avatar
    ssyberg2 years ago

    Thanks

    @969226489549713438

    will do! I wasn't sure it was a bug so didn't go straight to the ticket, but will do so now



    https://github.com/payloadcms/payload/issues/4160
  • discord user avatar
    seanzubrickas
    2 years ago

    Closing this out since you opened an issue on GH. Thanks!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.