Updating entity attributes - Lock wait timeout exceeded

agraubertagraubert Member, Broadie

I'm trying to update entity attributes via the workspaces/{namespace}/{workspace}/entities/batchUpdate URI but I keep getting "Lock wait timeout exceeded" errors. The first time I tried, the response was:

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>

but since then, the API keeps responding with a json rawls stack trace:

{"source":"rawls","causes":[],"exceptionClass":"com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException","stackTrace":[{"className":"sun.reflect.NativeConstructorAccessorImpl","methodName":"newInstance0","fileName":"NativeConstructorAccessorImpl.java","lineNumber":-2},{"className":"sun.reflect.NativeConstructorAccessorImpl","methodName":"newInstance","fileName":"NativeConstructorAccessorImpl.java","lineNumber":62},{"className":"sun.reflect.DelegatingConstructorAccessorImpl","methodName":"newInstance","fileName":"DelegatingConstructorAccessorImpl.java","lineNumber":45},{"className":"java.lang.reflect.Constructor","methodName":"newInstance","fileName":"Constructor.java","lineNumber":423},{"className":"com.mysql.jdbc.Util","methodName":"handleNewInstance","fileName":"Util.java","lineNumber":425},{"className":"com.mysql.jdbc.Util","methodName":"getInstance","fileName":"Util.java","lineNumber":408},{"className":"com.mysql.jdbc.SQLError","methodName":"createSQLException","fileName":"SQLError.java","lineNumber":951},{"className":"com.mysql.jdbc.MysqlIO","methodName":"checkErrorPacket","fileName":"MysqlIO.java","lineNumber":3973},{"className":"com.mysql.jdbc.MysqlIO","methodName":"checkErrorPacket","fileName":"MysqlIO.java","lineNumber":3909},{"className":"com.mysql.jdbc.MysqlIO","methodName":"sendCommand","fileName":"MysqlIO.java","lineNumber":2527},{"className":"com.mysql.jdbc.MysqlIO","methodName":"sqlQueryDirect","fileName":"MysqlIO.java","lineNumber":2680},{"className":"com.mysql.jdbc.ConnectionImpl","methodName":"execSQL","fileName":"ConnectionImpl.java","lineNumber":2490},{"className":"com.mysql.jdbc.PreparedStatement","methodName":"executeInternal","fileName":"PreparedStatement.java","lineNumber":1858},{"className":"com.mysql.jdbc.PreparedStatement","methodName":"execute","fileName":"PreparedStatement.java","lineNumber":1197},{"className":"com.zaxxer.hikari.pool.ProxyPreparedStatement","methodName":"execute","fileName":"ProxyPreparedStatement.java","lineNumber":44},{"className":"com.zaxxer.hikari.pool.HikariProxyPreparedStatement","methodName":"execute","fileName":"HikariProxyPreparedStatement.java","lineNumber":-1},{"className":"slick.jdbc.StatementInvoker","methodName":"results","fileName":"StatementInvoker.scala","lineNumber":38},{"className":"slick.jdbc.StatementInvoker","methodName":"iteratorTo","fileName":"StatementInvoker.scala","lineNumber":21},{"className":"slick.jdbc.Invoker","methodName":"foreach","fileName":"Invoker.scala","lineNumber":47},{"className":"slick.jdbc.Invoker","methodName":"foreach$","fileName":"Invoker.scala","lineNumber":46},{"className":"slick.jdbc.StatementInvoker","methodName":"foreach","fileName":"StatementInvoker.scala","lineNumber":15},{"className":"slick.jdbc.StreamingInvokerAction","methodName":"run","fileName":"StreamingInvokerAction.scala","lineNumber":22},{"className":"slick.jdbc.StreamingInvokerAction","methodName":"run$","fileName":"StreamingInvokerAction.scala","lineNumber":20},{"className":"slick.jdbc.SQLActionBuilder$$anon$1","methodName":"run","fileName":"StaticQuery.scala","lineNumber":95},{"className":"slick.jdbc.SQLActionBuilder$$anon$1","methodName":"run","fileName":"StaticQuery.scala","lineNumber":95},{"className":"slick.basic.BasicBackend$DatabaseDef$$anon$2","methodName":"liftedTree1$1","fileName":"BasicBackend.scala","lineNumber":242},{"className":"slick.basic.BasicBackend$DatabaseDef$$anon$2","methodName":"run","fileName":"BasicBackend.scala","lineNumber":242},{"className":"slick.util.NewRelicRunnable","methodName":"run","fileName":"AsyncExecutor.scala","lineNumber":94},{"className":"slick.util.AsyncExecutor$$anon$2$$anon$3$$anon$4","methodName":"run","fileName":"AsyncExecutor.scala","lineNumber":122},{"className":"java.util.concurrent.ThreadPoolExecutor","methodName":"runWorker","fileName":"ThreadPoolExecutor.java","lineNumber":1149},{"className":"java.util.concurrent.ThreadPoolExecutor$Worker","methodName":"run","fileName":"ThreadPoolExecutor.java","lineNumber":624},{"className":"java.lang.Thread","methodName":"run","fileName":"Thread.java","lineNumber":748}],"message":"Lock wait timeout exceeded; try restarting transaction"}

This is not the first time I've encountered this issue

Best Answer

Answers

  • Tiffany_at_BroadTiffany_at_Broad Cambridge, MAMember, Administrator, Broadie, Moderator admin

    Hi @agraubert would it be possible for you to share the link of which API you are using from the Swagger page? Was it this one?

    Also, here is a tutorial on how to overwrite or delete entities from the data model. Were you authenticated before trying to update the entities?

  • agraubertagraubert Member, Broadie

    I was using this endpoint. I was definitely authenticated at the time, as I was able to interact with other endpoints

  • KateNKateN Cambridge, MAMember, Broadie, Moderator admin

    Hi @agraubert. I will be marking my previous reply as the correct answer as we have not heard back from you. If this did not solve your issue, please let us know as we would like to investigate further.

  • agraubertagraubert Member, Broadie

    Yep! Sorry for not getting back sooner. I haven't run into this problem recently

  • RLCollinsRLCollins Harvard Medical SchoolMember ✭✭

    Hi @KateN @Tiffany_at_Broad, I'm encountering this exact same behavior when trying to update two cells of a (fairly large) sample set metadata matrix using the online FC portal.

    In the past, when I have encountered these Lock wait timeout exceeded errors, I've solved them by splitting the metadata entity file I'm trying to upload into many smaller chunks and uploading each of those one by one.

    However, in this circumstance, I have a metadata entity file that is tiny (2 attributes x 1 sample set) and I just want to update those two cells in the metadata matrix, so I can't really subset it much smaller than it already is.

    Any suggestions on ways around this? Happy to use the API / Swagger if that's preferred in this instance, but the link Tiffany shared above seems to suggest that the Import option via the FC Portal is the preferred/easier approach?

    Screenshot of the error attached here, if useful.

    Thanks!
    Ryan

  • SChaluvadiSChaluvadi Member, Broadie, Moderator admin

    Hey @RLCollins - Can you check, while trying to use the Import function from the FC portal, that you are importing metadata in the correct order. For example, participant metadata should be loaded before other entities such as samples or sets. The order of load files is listed at the end of this document. If this is not the case, can you try using the API to help determine where the issue is coming from?

  • RLCollinsRLCollins Harvard Medical SchoolMember ✭✭

    Hi @SChaluvadi, sorry for the delay in my reply. I was trying to update existing metadata for a project that's been in progress for the last year, so I can confirm everything was already in place (participants, samples, sample sets, etc).

    I didn't end up resolving the Error: Lock wait timeout exceeded problem, but I ended up rerunning the method as needed to overwrite the desired entry in the FC metadata matrix. It wasn't the most cost- or time-efficient approach, but it worked!

  • SChaluvadiSChaluvadi Member, Broadie, Moderator admin

    @RLCollins Great to hear that you were able to find a workaround!

Sign In or Register to comment.