org.h2.jdbc.JdbcSQLException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Check if you're not creating unused SQL entities, as it might cause this exception.


rafaelrafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Under certain circumstances (yet to be determined) the NuGet h2 database starts throwing errors like these in response to queries: {noformat} 2016-05-26 15:17:34 WARN [qtp1641102868-2377] anonymous com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery - Problem updating NuGet package in: NuGet-Gallery org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: try to remove head"; SQL statement: MERGE INTO PACKAGES VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [50000-175] at org.h2.message.DbException.getJdbcSQLException(DbException.java:332) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.message.DbException.get(DbException.java:161) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.message.DbException.convert(DbException.java:284) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.table.RegularTable.addRow(RegularTable.java:137) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.dml.Merge.merge(Merge.java:161) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.dml.Merge.update(Merge.java:106) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.CommandContainer.update(CommandContainer.java:79) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.Command.executeUpdate(Command.java:253) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:154) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:140) ~[nexus-h2-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery.put(ODataNugetGallery.java:456) ~[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1$1.consume(PassThroughNugetGallery.java:362) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.FeedSplicer.ended(FeedSplicer.java:108) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.XmlSplicer.consume(XmlSplicer.java:81) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.FeedSplicer.consumePage(FeedSplicer.java:57) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.feed.NugetFeedFetcher.cachePackageFeed(NugetFeedFetcher.java:78) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1.call(PassThroughNugetGallery.java:358) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1.call(PassThroughNugetGallery.java:355) [nexus-nuget-plugin-2.12.1-01/:na] at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4739) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4736) [guava-16.0.1.jar:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery.passQueryToRemoteRepos(PassThroughNugetGallery.java:289) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery.feed(PassThroughNugetGallery.java:156) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.rest.NugetGalleryResource.get(NugetGalleryResource.java:157) [nexus-nuget-plugin-2.12.1-01/:na] at org.sonatype.plexus.rest.resource.RestletResource.represent(RestletResource.java:233) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.sonatype.nexus.rest.NexusRestletResource.represent(NexusRestletResource.java:39) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.resource.Resource.getRepresentation(Resource.java:302) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.resource.Resource.handleGet(Resource.java:464) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Finder.handle(Finder.java:353) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Router.handle(Router.java:504) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.sonatype.plexus.rest.RetargetableRestlet.doHandle(RetargetableRestlet.java:36) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] {noformat} We've seen this twice now. I haven't been able to determine the cause from available information. In both cases it was necessary to rebuild the h2 database to recover.
    via by Rich Seddon,
    • org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: try to remove head"; SQL statement: MERGE INTO PACKAGES VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [50000-175] at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.message.DbException.get(DbException.java:161)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.message.DbException.convert(DbException.java:284)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.table.RegularTable.addRow(RegularTable.java:137)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.dml.Merge.merge(Merge.java:161)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.dml.Merge.update(Merge.java:106)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.CommandContainer.update(CommandContainer.java:79)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.Command.executeUpdate(Command.java:253)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:154)[nexus-h2-plugin-2.12.1-01/:na] at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:140)[nexus-h2-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery.put(ODataNugetGallery.java:456)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1$1.consume(PassThroughNugetGallery.java:362)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.FeedSplicer.ended(FeedSplicer.java:108)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.XmlSplicer.consume(XmlSplicer.java:81)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.FeedSplicer.consumePage(FeedSplicer.java:57)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.feed.NugetFeedFetcher.cachePackageFeed(NugetFeedFetcher.java:78)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1.call(PassThroughNugetGallery.java:358)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1.call(PassThroughNugetGallery.java:355)[nexus-nuget-plugin-2.12.1-01/:na] at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4739)[guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)[guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)[guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)[guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)[guava-16.0.1.jar:na] at com.google.common.cache.LocalCache.get(LocalCache.java:3934)[guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4736)[guava-16.0.1.jar:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery.passQueryToRemoteRepos(PassThroughNugetGallery.java:289)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery.feed(PassThroughNugetGallery.java:156)[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.rest.NugetGalleryResource.get(NugetGalleryResource.java:157)[nexus-nuget-plugin-2.12.1-01/:na] at org.sonatype.plexus.rest.resource.RestletResource.represent(RestletResource.java:233)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.sonatype.nexus.rest.NexusRestletResource.represent(NexusRestletResource.java:39)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.resource.Resource.getRepresentation(Resource.java:302)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.resource.Resource.handleGet(Resource.java:464)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Finder.handle(Finder.java:353)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Router.handle(Router.java:504)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.sonatype.plexus.rest.RetargetableRestlet.doHandle(RetargetableRestlet.java:36)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195)[nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na]

    Users with the same issue

    tvrmsmithtvrmsmith
    23 times, last one,
    Andreas HäberAndreas Häber
    1 times, last one,
    Victor_ITVictor_IT
    3 times, last one,
    batwalrus76batwalrus76
    3 times, last one,
    andyglickandyglick
    4 times, last one,
    143 more bugmates