Page MenuHomePhabricator

"1205: Lock wait timeout exceeded; try restarting transaction" when creating a new project.
Closed, InvalidPublic

Description

I'm on a fresh install of Phabricator. I cannot overcome the problem with:

Lock wait timeout exceeded; try restarting transaction

This occurs only when I try to create a new Project, or edit a user profile by clicking on "Edit" on the user's avatar.

I've tested Phabricator on both - a local database and RDS - both MariaDB, InnoDB engine - the problem occurs with both. I've also tested with the daemons running and being stopped - with the same effect.

I'm on the latest "stable" branch of Phabricator. Innodb_lock_wait_timeout is set to 50.

SHOW ENGINE INNODB STATUS reports (only part of the "Transactions" section is shown):

---TRANSACTION 0, not started
MySQL thread id 355, OS thread handle 0x7f7d846db700, query id 2304 localhost root cleaning up
---TRANSACTION 0, not started
MySQL thread id 354, OS thread handle 0x7f7d83732700, query id 2302 localhost root cleaning up
---TRANSACTION 0, not started
MySQL thread id 196, OS thread handle 0x7f7d83657700, query id 2343 localhost root init
show engine innodb status
---TRANSACTION 9093, ACTIVE 13 sec
7 lock struct(s), heap size 1184, 2 row lock(s), undo log entries 10
MySQL thread id 298, OS thread handle 0x7f7d8077b700, query id 2075 localhost root cleaning up
Trx read view will not see trx with id >= 9098, sees < 9098

SHOW FULL PROCESSLIST:

MariaDB [(none)]> show full processlist;
+-----+------+-----------+---------------------+---------+------+-------+-----------------------+----------+
| Id  | User | Host      | db                  | Command | Time | State | Info                  | Progress |
+-----+------+-----------+---------------------+---------+------+-------+-----------------------+----------+
| 196 | root | localhost | NULL                | Query   |    0 | init  | show full processlist |    0.000 |
| 292 | root | localhost | phabricator_config  | Sleep   |   48 |       | NULL                  |    0.000 |
| 293 | root | localhost | phabricator_cache   | Sleep   |   48 |       | NULL                  |    0.000 |
| 294 | root | localhost | phabricator_user    | Sleep   |   48 |       | NULL                  |    0.000 |
| 295 | root | localhost | phabricator_spaces  | Sleep   |   48 |       | NULL                  |    0.000 |
| 296 | root | localhost | phabricator_search  | Sleep   |   48 |       | NULL                  |    0.000 |
| 297 | root | localhost | phabricator_project | Sleep   |   47 |       | NULL                  |    0.000 |
| 298 | root | localhost | phabricator_project | Sleep   |   47 |       | NULL                  |    0.000 |
| 299 | root | localhost | phabricator_file    | Sleep   |   47 |       | NULL                  |    0.000 |
+-----+------+-----------+---------------------+---------+------+-------+-----------------------+----------+

The above would result either in an exception or 504 Gateway Timeout. Other post requests pass without problems - the issue relates only to adding a new project and editing a user profile - at leat I know only of these to places. Please also notice that the actual INSERT query does not seem to be executed at all. The transaction seem to hang on cleaning up.

Event Timeline

lukasz.tarasiewicz86 renamed this task from 1205: Lock wait timeout exceeded; try restarting transaction whnn creating a new project. to 1205: Lock wait timeout exceeded; try restarting transaction when creating a new project..Aug 20 2016, 10:36 PM
lukasz.tarasiewicz86 renamed this task from 1205: Lock wait timeout exceeded; try restarting transaction when creating a new project. to "1205: Lock wait timeout exceeded; try restarting transaction" when creating a new project..Aug 20 2016, 10:44 PM
lukasz.tarasiewicz86 updated the task description. (Show Details)

I can't reproduce this. Here's what I did:

  • Created a new project.

This worked as expected:

Screen Shot 2016-08-20 at 3.51.27 PM.png (958×1 px, 148 KB)

We need to be able to reproduce issues before we can fix them -- see Contributing Bug Reports and Providing Reproduction Steps for some details. What can I do differently to reproduce the issue?

I've now tried on MySQL 5.6.27 instead of MariaDB. The same thing - cannot create a project. This time the process results in 504 Gateway Time-out. I guess if I'm the only person reporting this issue, the problem might lie with my setup. What's puzzling my is that it's only with the projects. 60sec should be enough for the FPM to process this request, I guess. Thanks for looking into it.

We haven't seen other reports of similar issues and can't reproduce this issue ourselves in a variety of production and development environments.

Feel free to file a new report if you're able to come up with reproduction steps we can follow to recreate the issue locally.