Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Lock Wait Timeout Exception during media operations #8430

@matthieu2607

Description

@matthieu2607
Q A
Sulu Version 2.6.17
PHP Version 8.3
DB Version MySQl 8.0
Browser Version All Browsers
Other Nginx

Actual Behavior

When performing media operations (uploading/editing/deleting files), the system throws a Doctrine\DBAL\Exception\LockWaitTimeoutException resulting in a failed operation.

Error log:
request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\LockWaitTimeoutException: "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction" at ExceptionConverter.php line 42

The error indicates that a database transaction is holding a lock for too long, preventing other operations from completing within the default timeout period.

Expected Behavior

Media operations should complete successfully without database lock timeout errors. Concurrent media operations should be handled gracefully without blocking each other indefinitely.

Steps to Reproduce

Only on production server

  1. Download a media file simultaneously or edit media metadata
  2. The operation fails with a lock timeout exception
  3. The back office is completely frozen for the user

Frequency: Frequent

Possible Solutions

If I restart the MySQL service, the problem persists whenever media is modified or added. If other operations are performed, it works.
Currently, I am forced to restart the server because even after killing the processes causing problems in MySQL, the blockages return.
This problem occurs in the production environment; we are unable to reproduce it locally (we are on ddev).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugError or unexpected behavior of already existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions